From b46ffd0059d949cf78cc13011c84bf195d9a44f4 Mon Sep 17 00:00:00 2001 From: aiongg Date: Fri, 16 Oct 2026 16:39:46 +0000 Subject: [PATCH 001/545] Links: Edit Original opens only regular files of a format VectorCraft reads A folder or app bundle, a link to another kind of file, or a file with any other extension is refused with a message instead of being handed to the system's default app. On Windows, a path containing a quotation mark is refused before it reaches Explorer. --- apps/vectorcraft/src/main.rs | 8 ++++++ crates/ui-egui/src/menus.rs | 2 +- crates/ui-egui/src/panels/links.rs | 26 ++++++++++++++++- crates/ui-egui/src/panels/tests_links.rs | 36 ++++++++++++++++++++++++ 4 files changed, 70 insertions(+), 2 deletions(-) diff --git a/apps/vectorcraft/src/main.rs b/apps/vectorcraft/src/main.rs index bfa0f3a49d..c719a001a8 100644 --- a/apps/vectorcraft/src/main.rs +++ b/apps/vectorcraft/src/main.rs @@ -386,6 +386,7 @@ fn pick_now(request: PickRequest, _parent: &Parent) -> Vec { /// File → Show in Folder: select `path` in Finder / Explorer, or open its folder elsewhere. fn reveal(path: &str) -> Result<(), String> { + explorer_safe(path)?; reveal_command(path).spawn().map(|_| ()).map_err(|e| format!("can't show {path}: {e}")) } @@ -548,8 +549,15 @@ fn services(parent: Parent, ui: egui::Context) -> Services { } } +/// Windows passes `path` to Explorer inside quotes it adds itself, so a path holding a quote (which +/// no Windows file name has) is refused rather than split into other arguments. +fn explorer_safe(path: &str) -> Result<(), String> { + if cfg!(windows) && path.contains('"') { Err(format!("can't open {path}: the path contains a quotation mark")) } else { Ok(()) } +} + /// Edit Original, Show Package: open `path` (a file or a folder) in the system's default app for it. fn open_file(path: &str) -> Result<(), String> { + explorer_safe(path)?; #[cfg(windows)] let mut c = { use std::os::windows::process::CommandExt as _; diff --git a/crates/ui-egui/src/menus.rs b/crates/ui-egui/src/menus.rs index 6b322a8919..7ba3ff6add 100644 --- a/crates/ui-egui/src/menus.rs +++ b/crates/ui-egui/src/menus.rs @@ -733,7 +733,7 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "links.editOriginal", "Edit Original", "", - "{id?} open the file of linked image `id` (default: the selected linked image) in the system's default app for its type (Links panel, Edit › Edit Original); a placed document's file opens here in a new tab, and saving it updates the documents placing it → {path}; edits saved elsewhere show after links.update", + "{id?} open the file of linked image `id` (default: the selected linked image) in the system's default app for its type (Links panel, Edit › Edit Original; only a regular file with the extension of a format document.open reads); a placed document's file opens here in a new tab, and saving it updates the documents placing it → {path}; edits saved elsewhere show after links.update", ), ( "links.reveal", diff --git a/crates/ui-egui/src/panels/links.rs b/crates/ui-egui/src/panels/links.rs index dcf9f024c5..73ecc53bac 100644 --- a/crates/ui-egui/src/panels/links.rs +++ b/crates/ui-egui/src/panels/links.rs @@ -205,10 +205,34 @@ pub(crate) fn open_file(app: &mut VectorcraftApp, p: &Value, reveal: bool) -> Re crate::dialogs::settle(app); return Ok(json!({ "path": path })); } - if reveal { crate::io::reveal_path(app, &path) } else { crate::io::open_in_app(app, &path) }?; + if reveal { + crate::io::reveal_path(app, &path)?; + } else { + openable_original(&path)?; + crate::io::open_in_app(app, &path)?; + } Ok(json!({ "path": path })) } +/// Whether Edit Original may hand `path` to the system's default app: a regular file (after +/// following links) whose name, and the name it links to, have the extension of a format +/// VectorCraft reads. Anything else (a folder or app bundle, a script, a shortcut) is refused. +pub(crate) fn openable_original(path: &str) -> Result<(), String> { + let readable = |p: &std::path::Path| { + let ext = p.extension().map(|e| e.to_string_lossy().to_ascii_lowercase()).unwrap_or_default(); + !ext.is_empty() && vectorcraft_engine::cmd::fileio::FORMATS.iter().any(|f| f.read && f.extensions.contains(&ext.as_str())) + }; + let name = std::path::Path::new(path).file_name().map_or_else(|| path.to_string(), |n| n.to_string_lossy().into_owned()); + let real = std::fs::canonicalize(path).map_err(|e| format!("can't open “{name}”: {e}"))?; + if !real.is_file() { + return Err(format!("“{name}” is not a file")); + } + if !readable(std::path::Path::new(path)) || !readable(&real) { + return Err(format!("Edit Original opens image and document files only; “{name}” is not one")); + } + Ok(()) +} + /// A status badge: missing (red, ?), modified (amber, !), embedded (the image icon). fn badge(ui: &Ui, r: egui::Rect, status: &str) { let t = Tokens::get(ui.ctx()); diff --git a/crates/ui-egui/src/panels/tests_links.rs b/crates/ui-egui/src/panels/tests_links.rs index f27a42b53d..7d5c2ce7c5 100644 --- a/crates/ui-egui/src/panels/tests_links.rs +++ b/crates/ui-egui/src/panels/tests_links.rs @@ -111,6 +111,42 @@ fn edit_original_and_show_in_folder_hand_the_file_to_the_system() { assert!(app.run("links.editOriginal", json!({"id": linked})).is_err()); } +/// Edit Original hands only regular image and document files to the system's default app. +#[test] +fn edit_original_opens_image_and_document_files_only() { + let dir = Folder::new("kinds"); + for f in ["photo.png", "Art.SVG", "run.exe", "run.bat", "photo.png.lnk", "page.hta", "app.desktop"] { + dir.file(f, b""); + } + for f in ["Tool.app", "folder.png"] { + std::fs::create_dir_all(dir.0.join(f)).unwrap(); + } + let ok = |f: &str| super::links::openable_original(&dir.0.join(f).to_string_lossy()).is_ok(); + assert!(ok("photo.png") && ok("Art.SVG")); + for f in ["run.exe", "run.bat", "photo.png.lnk", "page.hta", "app.desktop", "Tool.app", "folder.png", "missing.png", ""] { + assert!(!ok(f), "{f}"); + } + #[cfg(unix)] + { + std::os::unix::fs::symlink(dir.0.join("app.desktop"), dir.0.join("link.png")).unwrap(); + assert!(!ok("link.png"), "an image name linking to another kind of file"); + // The command refuses a linked image that became such a link, without opening anything. + let (mut app, linked, _) = app(&dir); + let opened: Rc>> = Rc::default(); + let o = opened.clone(); + app.services.open_file = Some(Box::new(move |p: &str| { + o.borrow_mut().push(p.to_string()); + Ok(()) + })); + let png = dir.0.join("linked.png"); + std::fs::remove_file(&png).unwrap(); + std::os::unix::fs::symlink(dir.0.join("app.desktop"), &png).unwrap(); + let e = app.run("links.editOriginal", json!({"id": linked})).unwrap_err(); + assert!(e.contains("image and document files only"), "{e}"); + assert!(opened.borrow().is_empty()); + } +} + #[test] fn placement_options_dialog_sets_the_options() { let dir = Folder::new("dialog"); From 1ddfb56f666c1ebd635682b6a5539b62122c32a5 Mon Sep 17 00:00:00 2001 From: aiongg Date: Fri, 16 Oct 2026 16:52:19 +0000 Subject: [PATCH 002/545] Attributes: the Browser button opens http, https and mailto URLs only attributes.openUrl refuses other URL schemes with a message. It and links.editOriginal hand a URL or file to another app, so they answer a control or MCP request (and synthetic input) with an error; a placed document still opens in a tab. --- crates/ui-egui/src/lib.rs | 30 +++++++++++++++++++++ crates/ui-egui/src/menus.rs | 4 +-- crates/ui-egui/src/panels/attributes.rs | 36 ++++++++++++++++++++++++- crates/ui-egui/src/panels/links.rs | 1 + crates/ui-egui/src/tests_automation.rs | 36 +++++++++++++++++++++++++ docs/control-protocol.md | 5 +++- docs/mcp.md | 3 ++- 7 files changed, 110 insertions(+), 5 deletions(-) diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index b6c58414ff..6467d43024 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -200,6 +200,18 @@ pub type DownloadFn = Box Result<(), String>>; /// Opens a URL in the system browser. pub type OpenUrlFn = Box; +/// Whether a URL from a document may open in the browser: an `http:`, `https:` or `mailto:` URL +/// without control characters. The system hands other schemes (`file:`, application schemes) to +/// other programs. +pub(crate) fn browsable_url(url: &str) -> Result<(), String> { + let scheme = url.split_once(':').map_or("", |(s, _)| s); + if ["http", "https", "mailto"].iter().any(|k| scheme.eq_ignore_ascii_case(k)) && !url.chars().any(char::is_control) { + Ok(()) + } else { + Err(format!("only http, https and mailto URLs open in the browser, not “{url}”")) + } +} + /// Shows a file in the system file manager, or opens it in its app. pub type RevealFn = Box Result<(), String>>; @@ -766,6 +778,24 @@ impl VectorcraftApp { self.ui.status = format!("Opened {url}"); } + /// Open `url`, which came from a document (an object's URL attribute), in the browser: + /// [`browsable_url`]s only. + pub(crate) fn open_document_url(&mut self, url: &str) -> Result<(), String> { + browsable_url(url)?; + self.open_url(url); + Ok(()) + } + + /// Refuse UI command `id`, which hands something to another app, when automation sent it (a + /// control or MCP request, or a frame of synthetic input): the automation roots don't confine + /// what that app does. + pub(crate) fn refuse_automation(&self, id: &str) -> Result<(), String> { + if self.ui.answering_control || self.synthetic_frame { + return Err(format!("{id} opens another app: only the person at the keyboard can run it")); + } + Ok(()) + } + /// Run a Help link command and open the URL it returns. pub fn open_link(&mut self, id: &str) { if let Ok(v) = self.run(id, serde_json::json!({})) diff --git a/crates/ui-egui/src/menus.rs b/crates/ui-egui/src/menus.rs index 7ba3ff6add..f087a6f4d4 100644 --- a/crates/ui-egui/src/menus.rs +++ b/crates/ui-egui/src/menus.rs @@ -622,7 +622,7 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "attributes.openUrl", "Browser", "", - "{url?} open url, else the selection's URL (attributes.info), in the web browser (the Attributes panel's Browser button) → {url}", + "{url?} open url, else the selection's URL (attributes.info), in the web browser (the Attributes panel's Browser button; http, https and mailto URLs only; not over the control channel or MCP) → {url}", ), ( "ui.spotColors", @@ -733,7 +733,7 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "links.editOriginal", "Edit Original", "", - "{id?} open the file of linked image `id` (default: the selected linked image) in the system's default app for its type (Links panel, Edit › Edit Original; only a regular file with the extension of a format document.open reads); a placed document's file opens here in a new tab, and saving it updates the documents placing it → {path}; edits saved elsewhere show after links.update", + "{id?} open the file of linked image `id` (default: the selected linked image) in the system's default app for its type (Links panel, Edit › Edit Original; only a regular file with the extension of a format document.open reads, and not over the control channel or MCP); a placed document's file opens here in a new tab, and saving it updates the documents placing it → {path}; edits saved elsewhere show after links.update", ), ( "links.reveal", diff --git a/crates/ui-egui/src/panels/attributes.rs b/crates/ui-egui/src/panels/attributes.rs index 58fdfb7b81..ad3fdd7fad 100644 --- a/crates/ui-egui/src/panels/attributes.rs +++ b/crates/ui-egui/src/panels/attributes.rs @@ -161,11 +161,12 @@ pub fn menu(_app: &mut VectorcraftApp, ui: &mut Ui) { /// `attributes.openUrl {url?}`: open `url`, else the selection's URL, in the web browser. pub(crate) fn open_url(app: &mut VectorcraftApp, p: &Value) -> Result { + app.refuse_automation("attributes.openUrl")?; let url = match p.get("url").and_then(Value::as_str) { Some(u) => u.to_string(), None => app.session.attributes_info().url.filter(|u| !u.is_empty()).ok_or("the selection has no URL (or they differ)")?, }; - app.open_url(&url); + app.open_document_url(&url)?; Ok(json!({ "url": url })) } @@ -223,4 +224,37 @@ mod tests { assert!(!texts.iter().any(|t| t == "https://example.com/a" || t == "first note"), "{texts:?}"); assert!(open_url(&mut app, &json!({})).is_err()); } + + /// Only web and mail URLs reach the browser. + #[test] + fn the_browser_opens_web_and_mail_urls_only() { + for ok in ["https://example.com/a", "HTTP://example.com", "mailto:someone@example.com"] { + assert!(crate::browsable_url(ok).is_ok(), "{ok}"); + } + for refused in [ + "file:///tmp/a.html", + "javascript:void(0)", + "ms-settings:", + "smb://host/share", + "x-app://run", + "example.com", + " https://example.com", + "https://a\nb", + "", + ] { + assert!(crate::browsable_url(refused).is_err(), "{refused}"); + } + let opened = std::rc::Rc::new(std::cell::RefCell::new(Vec::::new())); + let o = opened.clone(); + let services = crate::Services { open_url: Some(Box::new(move |u: &str| o.borrow_mut().push(u.to_string()))), ..Default::default() }; + let mut app = VectorcraftApp::new(Session::new(), services); + run(&mut app, "file.new", json!({"width": 100, "height": 100})); + run(&mut app, "shape.rectangle", json!({"x": 0, "y": 0, "width": 50, "height": 50})); + run(&mut app, "attributes.set", json!({"url": "file:///tmp/run.desktop"})); + assert!(open_url(&mut app, &json!({})).is_err()); + assert!(open_url(&mut app, &json!({"url": "vscode://file/x"})).is_err()); + assert!(opened.borrow().is_empty()); + open_url(&mut app, &json!({"url": "https://example.com/b"})).unwrap(); + assert_eq!(*opened.borrow(), ["https://example.com/b"]); + } } diff --git a/crates/ui-egui/src/panels/links.rs b/crates/ui-egui/src/panels/links.rs index 73ecc53bac..2e030bb01a 100644 --- a/crates/ui-egui/src/panels/links.rs +++ b/crates/ui-egui/src/panels/links.rs @@ -208,6 +208,7 @@ pub(crate) fn open_file(app: &mut VectorcraftApp, p: &Value, reveal: bool) -> Re if reveal { crate::io::reveal_path(app, &path)?; } else { + app.refuse_automation("links.editOriginal")?; openable_original(&path)?; crate::io::open_in_app(app, &path)?; } diff --git a/crates/ui-egui/src/tests_automation.rs b/crates/ui-egui/src/tests_automation.rs index cbfa2f2513..2ce1cd6c79 100644 --- a/crates/ui-egui/src/tests_automation.rs +++ b/crates/ui-egui/src/tests_automation.rs @@ -118,3 +118,39 @@ fn frames_with_injected_input_are_confined() { assert!(!app.synthetic_frame, "the frames after it are the person's"); let _ = std::fs::remove_dir_all(base); } + +/// Edit Original and the Attributes panel's Browser button hand a file or URL to another app: a +/// control request (or MCP, which comes through it) can't run them, roots or not. +#[test] +fn automation_cannot_hand_files_or_urls_to_other_apps() { + let base = std::env::temp_dir().join(format!("vc-ui-handoff-{}", std::process::id())); + std::fs::create_dir_all(&base).unwrap(); + let png = base.join("linked.png"); + image::RgbaImage::from_pixel(4, 4, image::Rgba([0, 0, 0, 255])).save(&png).unwrap(); + let opened = std::rc::Rc::new(std::cell::RefCell::new(Vec::::new())); + let (u, f) = (opened.clone(), opened.clone()); + let services = Services { + open_url: Some(Box::new(move |p: &str| u.borrow_mut().push(p.to_string()))), + open_file: Some(Box::new(move |p: &str| { + f.borrow_mut().push(p.to_string()); + Ok(()) + })), + ..Default::default() + }; + let (tx, rx) = std::sync::mpsc::channel(); + let mut app = VectorcraftApp::new(Session::new(), services).with_control(rx); + app.run("file.new", json!({"width": 100, "height": 100})).unwrap(); + let image = app.run("file.place", json!({"path": s(png.clone())})).unwrap()["ids"][0].as_u64().unwrap(); + app.run("shape.rectangle", json!({"x": 0, "y": 0, "width": 50, "height": 50})).unwrap(); + app.run("attributes.set", json!({"url": "https://example.com/a"})).unwrap(); + for (command, params) in [("attributes.openUrl", json!({})), ("links.editOriginal", json!({"id": image}))] { + let r = request(&mut app, &tx, "engine.execute", json!({"command": command, "params": params})); + assert!(r["error"].as_str().is_some_and(|e| e.contains("only the person at the keyboard")), "{command}: {r}"); + } + assert!(opened.borrow().is_empty()); + // The person at the keyboard can. + app.run("attributes.openUrl", json!({})).unwrap(); + app.run("links.editOriginal", json!({"id": image})).unwrap(); + assert_eq!(opened.borrow().len(), 2); + let _ = std::fs::remove_dir_all(base); +} diff --git a/docs/control-protocol.md b/docs/control-protocol.md index d8ce4596ca..63584dd2e2 100644 --- a/docs/control-protocol.md +++ b/docs/control-protocol.md @@ -405,6 +405,8 @@ one undo step. Attributes panel: `window.panel {panel: "attributes"}` (Cmd+F11) shows it; its controls run `attributes.set`, `path.reverse {reversed}` and `path.setFillRule {rule}`, and its Browser button runs the UI command `attributes.openUrl {url?}`, which opens the URL (default: the selection's) in the web browser and answers `{url}`. +It opens `http:`, `https:` and `mailto:` URLs only, and answers a control request with an error: it hands the URL to +another app. Spot Colors: the Swatches panel menu's Spot Colors… (`ui.spotColors`) opens the `spotColors` dialog (field `useLab`: true shows and separates spot colours defined in Lab from their Lab values, false from their working-CMYK @@ -598,7 +600,8 @@ Placement Options: the Links panel's flyout (or `ui.placementOptionsDialog {ids? `fit`/`fill`, `align`: `topLeft` … `bottomRight`, `clip`). `ui.dialog.confirm` runs `links.placementOptions` with them as one undo step. The Links panel (`window.panel {panel: "links"}`) shows `links.list` and the first selected image's `links.info`; `links.editOriginal` and `links.reveal` (Edit › Edit Original, Show in Folder) hand the linked file to -the system and return `{path}`. +the system and return `{path}`. Edit Original opens only a regular file whose extension is a format `document.open` +reads, and answers a control request with an error unless the file is a placed document (which opens in a tab). Package: File → Package… (`ui.packageDialog`) opens the `package` dialog for a saved document (a document never saved gets a `confirm` dialog whose OK runs `file.saveAs`). Fields: `folder` (the location), `name` (the package folder), diff --git a/docs/mcp.md b/docs/mcp.md index b6c980a1cd..1e8e9875b7 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -2547,7 +2547,8 @@ file is missing stays linked: relink it first); `links.unembed {id, path}` write `links.placementOptions {ids?, preserve?: transforms|bounds|fileDimensions|fit|fill, align?: topLeft…bottomRight, clip?}` decides how a relinked or updated file takes an image's place (default `bounds`: stretched into the old bounds; `clip` puts it in a clip group of the old bounds when it is larger). The UI commands `links.editOriginal` and -`links.reveal` open the linked file in its app or show it in its folder (desktop). +`links.reveal` open the linked file in its app or show it in its folder (desktop). Edit Original runs only from the app's window, +except for a placed document, which opens in a tab. ```json {"name":"run_command","arguments":{"command":"links.list","params":{"show":"missing"}}} From ef5084f48be118d17bea6bb51def21d3924e18bd Mon Sep 17 00:00:00 2001 From: aiongg Date: Fri, 16 Oct 2026 17:36:51 +0000 Subject: [PATCH 003/545] Links: follow linked file paths only on this computer or the document's share Paths stored with linked images and placed documents, and the hrefs of SVG images, go through fileio::document_path (craft-docpath): a relative path is taken from the document's folder, and only local files or files on the document's own network share are looked at. Opening a document, Link Info, Package, the linked-file watch and SVG import all use it; the watch stats files through fileio, so automation roots apply to it too. A path that is not followed counts as missing; document.open, links.check and links.info say why in `refused`. --- Cargo.lock | 6 ++ Cargo.toml | 1 + crates/engine/Cargo.toml | 2 + crates/engine/src/cmd/fileio/load.rs | 3 + crates/engine/src/cmd/fileio/mod.rs | 55 +++++++++++- crates/engine/src/cmd/links.rs | 92 +++++++++++--------- crates/engine/src/lib.rs | 2 + crates/engine/src/link_watch.rs | 17 ++-- crates/engine/src/tests_link_paths.rs | 120 ++++++++++++++++++++++++++ crates/svg/Cargo.toml | 2 + crates/svg/src/import/files.rs | 74 +++++++++------- docs/mcp.md | 11 ++- 12 files changed, 301 insertions(+), 84 deletions(-) create mode 100644 crates/engine/src/tests_link_paths.rs diff --git a/Cargo.lock b/Cargo.lock index eca47581bf..78b0e378b9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -806,6 +806,10 @@ dependencies = [ "libc", ] +[[package]] +name = "craft-docpath" +version = "0.1.0" + [[package]] name = "craft-pdf" version = "0.1.0" @@ -4650,6 +4654,7 @@ dependencies = [ name = "vectorcraft-engine" version = "0.12.0" dependencies = [ + "craft-docpath", "crc32fast", "flate2", "image", @@ -4857,6 +4862,7 @@ dependencies = [ name = "vectorcraft-svg" version = "0.12.0" dependencies = [ + "craft-docpath", "flate2", "image", "kurbo 0.13.1", diff --git a/Cargo.toml b/Cargo.toml index 1c10d551b5..9536a0b248 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,6 +13,7 @@ repository = "https://github.com/storytold/vectorcraft" [workspace.dependencies] craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "ca50d63b773c99f96e75c77ce5a1d21e7c9cda0d", default-features = false, features = ["interpret", "write"] } craft-print = { git = "https://github.com/storytold/craft-libs", rev = "d991bf6792f8ade99c51358bf3c1d902c8cd96b5" } +craft-docpath = { path = "../secfix-craft-libs/crates/docpath" } craft-ui = { git = "https://github.com/storytold/craft-libs", rev = "5c874d51eeb3de70e735c8ce87a59a7dedd47675", features = ["serde"] } # internal vectorcraft-geom = { path = "crates/geom" } diff --git a/crates/engine/Cargo.toml b/crates/engine/Cargo.toml index c51728ef27..4fd4fa52fa 100644 --- a/crates/engine/Cargo.toml +++ b/crates/engine/Cargo.toml @@ -15,6 +15,8 @@ default = ["bundled-fonts"] bundled-fonts = ["vectorcraft-text/bundled-fonts"] [dependencies] +# Which paths stored in documents may be opened. +craft-docpath = { workspace = true } vectorcraft-geom = { workspace = true } vectorcraft-color = { workspace = true } vectorcraft-doc = { workspace = true } diff --git a/crates/engine/src/cmd/fileio/load.rs b/crates/engine/src/cmd/fileio/load.rs index 58200162c2..841a9f8255 100644 --- a/crates/engine/src/cmd/fileio/load.rs +++ b/crates/engine/src/cmd/fileio/load.rs @@ -286,8 +286,11 @@ pub(crate) fn import_svg(text: &str, folder: Option<&str>) -> Result<(Document, // The importer reads on a thread of its own (for its stack): what may be read is what may be // read here. let scope = crate::file_access::ScopeHandle::capture(); + // Paths are checked as stored in a document inside `folder` (only the folder is used). + let document = folder.map(|f| std::path::Path::new(f).join("-").to_string_lossy().into_owned()); let read = |path: &str| { scope.clone().run(|| { + let path = &super::document_path(path, document.as_deref()).ok()?; // Only files (not folders or devices) are read. file_stamp(path)?; let bytes = read_file(path).ok()?; diff --git a/crates/engine/src/cmd/fileio/mod.rs b/crates/engine/src/cmd/fileio/mod.rs index 93282d33d9..a14545e0d2 100644 --- a/crates/engine/src/cmd/fileio/mod.rs +++ b/crates/engine/src/cmd/fileio/mod.rs @@ -820,9 +820,36 @@ fn formats(_: &mut Session, _: &Value) -> Result { /// `path` checked for reading against the automation roots in force. #[cfg(not(target_arch = "wasm32"))] fn may_read(path: &str) -> Result<()> { + #[cfg(test)] + touch(path); crate::file_access::check_read(path).map_err(EngineError::Other) } +/// Paths read while [`touched`] runs, on any thread (the SVG importer reads on one of its own). +#[cfg(test)] +static TOUCHED: std::sync::Mutex> = std::sync::Mutex::new(Vec::new()); +#[cfg(test)] +static RECORDING: std::sync::atomic::AtomicUsize = std::sync::atomic::AtomicUsize::new(0); + +#[cfg(test)] +fn touch(path: &str) { + if RECORDING.load(std::sync::atomic::Ordering::SeqCst) > 0 { + TOUCHED.lock().unwrap_or_else(std::sync::PoisonError::into_inner).push(path.to_string()); + } +} + +/// Run `f` and list the paths read through this module meanwhile (by any test running then). +#[cfg(test)] +pub(crate) fn touched(f: impl FnOnce() -> T) -> (T, Vec) { + use std::sync::atomic::Ordering::SeqCst; + let start = TOUCHED.lock().unwrap_or_else(std::sync::PoisonError::into_inner).len(); + RECORDING.fetch_add(1, SeqCst); + let out = f(); + RECORDING.fetch_sub(1, SeqCst); + let seen = TOUCHED.lock().unwrap_or_else(std::sync::PoisonError::into_inner).get(start..).unwrap_or_default().to_vec(); + (out, seen) +} + /// `path` checked for writing against the automation roots in force. #[cfg(not(target_arch = "wasm32"))] fn may_write(path: &str) -> Result<()> { @@ -977,8 +1004,7 @@ fn list_dir(_: &str, _: usize) -> Result<(Vec, bool)> { /// keeps one); `None` when there is no file at `path` (or automation may not read it). #[cfg(not(target_arch = "wasm32"))] pub(crate) fn file_stamp(path: &str) -> Option<(u64, Option)> { - may_read(path).ok()?; - let m = std::fs::metadata(path).ok().filter(std::fs::Metadata::is_file)?; + let m = file_metadata(path).filter(std::fs::Metadata::is_file)?; let modified = m.modified().ok().and_then(|t| t.duration_since(std::time::UNIX_EPOCH).ok()).map(|d| d.as_millis() as u64); Some((m.len(), modified)) } @@ -987,11 +1013,17 @@ pub(crate) fn file_stamp(path: &str) -> Option<(u64, Option)> { /// (and automation may read it). #[cfg(not(target_arch = "wasm32"))] pub(crate) fn file_created(path: &str) -> Option { - may_read(path).ok()?; - let t = std::fs::metadata(path).ok()?.created().ok()?; + let t = file_metadata(path)?.created().ok()?; t.duration_since(std::time::UNIX_EPOCH).ok().map(|d| d.as_millis() as u64) } +/// The file system's metadata of `path`, following links (when automation may read it). +#[cfg(not(target_arch = "wasm32"))] +pub(crate) fn file_metadata(path: &str) -> Option { + may_read(path).ok()?; + std::fs::metadata(path).ok() +} + #[cfg(target_arch = "wasm32")] pub(crate) fn file_created(_: &str) -> Option { None @@ -1007,6 +1039,21 @@ pub(crate) fn absolute_path(path: &str) -> String { std::path::absolute(path).map_or_else(|_| path.to_string(), |p| p.to_string_lossy().into_owned()) } +/// The file to open for `stored`, a path or `file:` URL stored in a document (a linked file, an +/// SVG image's href), or why it is not followed. `document` is the path of the document it is +/// stored in, when it has one: a relative path is taken from its folder. Only files on this +/// computer, or on the network share the document is on, are followed (see `craft_docpath`); a +/// path that is still relative (no document) is refused, as the working directory isn't the +/// document's choice. Every stored path reaches the file system through this. +pub(crate) fn document_path(stored: &str, document: Option<&str>) -> std::result::Result { + let document = document.map(absolute_path); + let path = craft_docpath::resolve(stored, document.as_deref().map(std::path::Path::new))?; + if !path.is_absolute() { + return Err(craft_docpath::Refused::Invalid); + } + path.into_os_string().into_string().map_err(|_| craft_docpath::Refused::Invalid) +} + #[cfg(target_arch = "wasm32")] pub(crate) fn file_stamp(_: &str) -> Option<(u64, Option)> { None diff --git a/crates/engine/src/cmd/links.rs b/crates/engine/src/cmd/links.rs index 3b72828dc2..99eb2af888 100644 --- a/crates/engine/src/cmd/links.rs +++ b/crates/engine/src/cmd/links.rs @@ -39,7 +39,7 @@ pub fn specs() -> Vec { "Check Links", [], None, - "{ids?: [image or placed document ids] (default: every linked image and placed document)} where each linked file is and whether it changed since it was read → {links: [{name, path, status: ok|modified|missing, ids, found?: path (found away from its path: relative to the document, or by name in its folder), preview: true (showing the low-resolution preview, not the file)}], missing, modified}", + "{ids?: [image or placed document ids] (default: every linked image and placed document)} where each linked file is and whether it changed since it was read → {links: [{name, path, status: ok|modified|missing, ids, found?: path (found away from its path: relative to the document, or by name in its folder), preview: true (showing the low-resolution preview, not the file), refused?: why the path is not followed (another computer, a device or a URL: it counts as missing)}], missing, modified}", has_doc, check ), @@ -111,7 +111,7 @@ pub fn specs() -> Vec { "Link Info", [], None, - "{id?} an image's or placed document's Link Info (default: the one selected) → image.info's fields (id, name, linked, link, colorMode, pixelWidth, pixelHeight, width, height) and status: ok|modified|missing|embedded, format, ppi: [x, y] (the file's), effectivePpi: [x, y] (at its placed size), scale: [x%, y%] (of its 100% size), rotation (degrees, counter-clockwise), placement: {preserve, align, clip}; linked images also fileName, location (its folder), page?, fileSize? (bytes), modified?, created? (ms since the Unix epoch); a placed document has document: true, pageWidth and pageHeight (pt) instead of pixels, ppi and colorMode, and its scale is of its artboard's 100% size", + "{id?} an image's or placed document's Link Info (default: the one selected) → image.info's fields (id, name, linked, link, colorMode, pixelWidth, pixelHeight, width, height) and status: ok|modified|missing|embedded, format, ppi: [x, y] (the file's), effectivePpi: [x, y] (at its placed size), scale: [x%, y%] (of its 100% size), rotation (degrees, counter-clockwise), placement: {preserve, align, clip}; linked images also fileName, location (its folder), page?, fileSize? (bytes), modified?, created? (ms since the Unix epoch), refused? (why the path is not followed); a placed document has document: true, pageWidth and pageHeight (pt) instead of pixels, ppi and colorMode, and its scale is of its artboard's 100% size", has_doc, info ), @@ -245,21 +245,24 @@ fn found_at(path: String) -> Option { Some(Found { path, size, modified, bytes: None }) } -/// Where the file of `link` is: at its path, else at its relative path or by name in the -/// document's folder `dir`. -fn locate(link: &LinkInfo, dir: Option<&Path>) -> Option { - let mut paths = vec![link.path.clone()]; - if let Some(dir) = dir { - let near = link.relative.iter().map(|r| dir.join(r)).chain([dir.join(link.name())]); - paths.extend(near.map(|p| p.to_string_lossy().into_owned())); - } - paths.into_iter().find_map(found_at) +/// Where the file of `link` (stored in the document saved at `doc_path`) is: at its path, else at +/// its relative path or by name in the document's folder. Only paths +/// [`fileio::document_path`] follows are looked at. +fn locate(link: &LinkInfo, doc_path: Option<&str>) -> Option { + let stored = [Some(link.path.as_str()), link.relative.as_deref(), Some(link.name())]; + stored.into_iter().flatten().filter_map(|p| fileio::document_path(p, doc_path).ok()).find_map(found_at) } -/// Where the file of group `g` is and whether it still has the content shown. Its bytes are read -/// only when its size or modification time changed. -fn probe(g: &Group, dir: Option<&Path>) -> (Status, Option) { - let Some(mut f) = locate(&g.link, dir) else { return (Status::Missing, None) }; +/// Why the path of `link` (stored in the document saved at `doc_path`) isn't followed, when it +/// names another computer, a device or a URL. +fn refused(link: &LinkInfo, doc_path: Option<&str>) -> Option { + fileio::document_path(&link.path, doc_path).err().filter(|r| *r != craft_docpath::Refused::Invalid) +} + +/// Where the file of group `g` (of the document saved at `doc_path`) is and whether it still has +/// the content shown. Its bytes are read only when its size or modification time changed. +fn probe(g: &Group, doc_path: Option<&str>) -> (Status, Option) { + let Some(mut f) = locate(&g.link, doc_path) else { return (Status::Missing, None) }; let l = &g.link; if l.size == Some(f.size) && l.modified.is_some() && l.modified == f.modified { return (Status::Ok, Some(f)); @@ -274,11 +277,6 @@ fn probe(g: &Group, dir: Option<&Path>) -> (Status, Option) { (if same { Status::Ok } else { Status::Modified }, Some(f)) } -/// The folder of the document saved at `doc_path`. -fn folder(doc_path: Option<&str>) -> Option<&Path> { - doc_path.and_then(|p| Path::new(p).parent()) -} - /// Is image `key` of `d` showing its preview (its file not read)? fn previewing(d: &Document, key: &str) -> bool { d.images.get(key).is_none_or(ImageBlob::is_proxy) @@ -314,7 +312,7 @@ pub(crate) fn linked_files(d: &Document, doc_path: Option<&str>) -> Vec) -> Vec) -> Vec<(LinkInfo, Vec)> { groups(&st.doc, ids) .into_iter() - .filter(|g| !g.ids.is_empty() && (ids.is_some() || probe(g, folder(st.path.as_deref())).0 == Status::Missing)) + .filter(|g| !g.ids.is_empty() && (ids.is_some() || probe(g, st.path.as_deref()).0 == Status::Missing)) .map(|g| (g.link, g.ids)) .collect() } @@ -510,9 +508,23 @@ fn install(d: &mut Document, ids: &[NodeId], (link, img): FileRead, force: Optio clips.into_iter().try_for_each(|(id, clip)| clip_image(d, id, clip)) } -/// Groups as `{name, path, ids}` rows (those with objects in the layers). -fn rows<'a>(gs: impl Iterator) -> Vec { - gs.filter(|g| !g.ids.is_empty()).map(|g| json!({ "name": g.link.name(), "path": g.link.path, "ids": ids_json(&g.ids) })).collect() +/// Groups (of the document saved at `doc_path`) as `{name, path, ids}` rows (those with objects in +/// the layers), with `refused`: why the path isn't followed, when it isn't. +fn rows<'a>(gs: impl Iterator, doc_path: Option<&str>) -> Vec { + gs.filter(|g| !g.ids.is_empty()) + .map(|g| { + let mut row = json!({ "name": g.link.name(), "path": g.link.path, "ids": ids_json(&g.ids) }); + note_refused(&mut row, &g.link, doc_path); + row + }) + .collect() +} + +/// `row["refused"]`: why the path of `link` isn't followed, when it isn't ([`refused`]). +fn note_refused(row: &mut Value, link: &LinkInfo, doc_path: Option<&str>) { + if let Some(r) = refused(link, doc_path) { + row["refused"] = json!(r.to_string()); + } } fn ids_json(ids: &[NodeId]) -> Vec { @@ -545,9 +557,9 @@ impl Resolved { pub fn resolve(d: &mut Document, doc_path: Option<&str>, update: bool) -> Resolved { let mut out = Resolved::default(); for g in groups(d, None) { - let row = rows(std::iter::once(&g)); + let row = rows(std::iter::once(&g), doc_path); let unread = g.document.is_none() && g.link.hash.is_none() && g.link.size.is_none() && previewing(d, &g.key); - match probe(&g, folder(doc_path)) { + match probe(&g, doc_path) { (Status::Missing, _) => out.missing.extend(row), (Status::Modified, Some(mut f)) if update || unread => { match read_for(&mut f, &g, "document.open").and_then(|read| install_read(d, &g.ids, read, unread.then_some(Preserve::Bounds))) { @@ -714,10 +726,11 @@ fn check(s: &mut Session, p: &Value) -> Result { let (mut missing, mut modified) = (0, 0); let mut links = vec![]; for g in groups(&st.doc, ids.as_deref()).iter().filter(|g| !g.ids.is_empty()) { - let (status, found) = probe(g, folder(st.path.as_deref())); + let (status, found) = probe(g, st.path.as_deref()); missing += usize::from(status == Status::Missing); modified += usize::from(status == Status::Modified); let mut row = json!({ "name": g.link.name(), "path": g.link.path, "status": status.as_str(), "ids": ids_json(&g.ids) }); + note_refused(&mut row, &g.link, st.path.as_deref()); if let Some(f) = found.filter(|f| f.path != g.link.path) { row["found"] = json!(f.path); } @@ -734,7 +747,7 @@ fn update(s: &mut Session, p: &Value) -> Result { let ids = ids_param(p, "ids"); let (mut reads, mut missing) = (vec![], vec![]); for g in groups(&st.doc, ids.as_deref()).into_iter().filter(|g| !g.ids.is_empty()) { - match probe(&g, folder(st.path.as_deref())) { + match probe(&g, st.path.as_deref()) { (Status::Missing, _) | (_, None) => missing.extend(ids_json(&g.ids)), // Unchanged and showing the file: nothing to read unless asked for by id. (Status::Ok, Some(_)) if ids.is_none() && !stale(&st.doc, &g) => {} @@ -783,11 +796,9 @@ fn relink(s: &mut Session, p: &Value) -> Result { None => { let selected: Vec = st.selection.objects.iter().copied().filter(|id| image(id).is_some()).collect(); match folder_param { - Some(_) if selected.is_empty() => groups(&st.doc, None) - .into_iter() - .filter(|g| probe(g, folder(st.path.as_deref())).0 == Status::Missing) - .flat_map(|g| g.ids) - .collect(), + Some(_) if selected.is_empty() => { + groups(&st.doc, None).into_iter().filter(|g| probe(g, st.path.as_deref()).0 == Status::Missing).flat_map(|g| g.ids).collect() + } _ => selected, } } @@ -969,7 +980,7 @@ fn linked_param(st: &crate::DocState, p: &Value, cmd: &str) -> Result { fn statuses(st: &crate::DocState) -> BTreeMap, bool)> { let mut out = BTreeMap::new(); for g in groups(&st.doc, None).iter().filter(|g| !g.ids.is_empty()) { - let (status, found) = probe(g, folder(st.path.as_deref())); + let (status, found) = probe(g, st.path.as_deref()); let found = found.map(|f| f.path).filter(|p| *p != g.link.path); let preview = stale(&st.doc, g); out.extend(g.ids.iter().map(|id| (*id, (status, found.clone(), preview)))); @@ -1110,7 +1121,7 @@ fn embed(s: &mut Session, p: &Value) -> Result { done.extend(g.ids); continue; } - match probe(&g, folder(st.path.as_deref())) { + match probe(&g, st.path.as_deref()) { (Status::Ok | Status::Modified, Some(mut f)) => match read_image(&mut f, &g.link) { Ok(read) => { done.extend(&g.ids); @@ -1190,10 +1201,13 @@ fn placement_json(o: PlacementOptions) -> Value { /// Link Info's fields of the linked file `l` (of object `id` of `st`) into `out`. fn file_fields(st: &crate::DocState, id: NodeId, l: &LinkInfo, out: &mut Value) { - let status = groups(&st.doc, Some(&[id])).first().map_or(Status::Missing, |g| probe(g, folder(st.path.as_deref())).0); - let stamp = file_stamp(&l.path); + let status = groups(&st.doc, Some(&[id])).first().map_or(Status::Missing, |g| probe(g, st.path.as_deref()).0); + let doc_path = st.path.as_deref(); + let path = fileio::document_path(&l.path, doc_path).ok(); + let stamp = path.as_deref().and_then(file_stamp); let folder_len = l.path.len().saturating_sub(l.name().len()); out["status"] = json!(status.as_str()); + note_refused(out, l, doc_path); out["path"] = json!(l.path); out["fileName"] = json!(l.name()); out["location"] = json!(l.path.get(..folder_len).unwrap_or_default().trim_end_matches(['/', '\\'])); @@ -1201,7 +1215,7 @@ fn file_fields(st: &crate::DocState, id: NodeId, l: &LinkInfo, out: &mut Value) ("page", l.page.map(u64::from)), ("fileSize", stamp.map(|s| s.0).or(l.size)), ("modified", stamp.and_then(|s| s.1).or(l.modified)), - ("created", file_created(&l.path)), + ("created", path.as_deref().and_then(file_created)), ] { if let Some(v) = v { out[k] = json!(v); diff --git a/crates/engine/src/lib.rs b/crates/engine/src/lib.rs index ced1ccef7c..8f2fdcfbdd 100644 --- a/crates/engine/src/lib.rs +++ b/crates/engine/src/lib.rs @@ -1991,6 +1991,8 @@ mod tests_legacy_ai; #[cfg(test)] mod tests_library; #[cfg(test)] +mod tests_link_paths; +#[cfg(test)] mod tests_linked_stops; #[cfg(test)] mod tests_linkfiles; diff --git a/crates/engine/src/link_watch.rs b/crates/engine/src/link_watch.rs index 8d9df187e1..94fc568f44 100644 --- a/crates/engine/src/link_watch.rs +++ b/crates/engine/src/link_watch.rs @@ -30,15 +30,19 @@ pub type Stamp = (u64, u128); /// object ids, stamp)]). pub type LinkScan = Arc, Option)>)>>>; +/// The stamp of the linked file stored as `path` in the document saved at `doc_path`; `None` when +/// there is no file, its path isn't followed ([`crate::cmd::fileio::document_path`]) or +/// automation may not read it. #[cfg(not(target_arch = "wasm32"))] -fn stamp(path: &str) -> Option { - let meta = std::fs::metadata(path).ok()?; +fn stamp(path: &str, doc_path: Option<&str>) -> Option { + let path = crate::cmd::fileio::document_path(path, doc_path).ok()?; + let meta = crate::cmd::fileio::file_metadata(&path)?; let modified = meta.modified().ok()?.duration_since(std::time::UNIX_EPOCH).ok()?; Some((meta.len(), modified.as_nanos())) } #[cfg(target_arch = "wasm32")] -fn stamp(_: &str) -> Option { +fn stamp(_: &str, _: Option<&str>) -> Option { None } @@ -52,7 +56,7 @@ pub fn linked_files(d: &vectorcraft_doc::Document) -> Vec<(String, Vec)> { pub(crate) fn update_changed(s: &mut Session, _: &Value) -> Result { let st = s.doc()?; let (uid, files) = (st.uid, crate::cmd::links::linked_groups(&st.doc)); - let now = files.into_iter().map(|(p, ids)| (p.clone(), ids, stamp(&p))).collect(); + let now = files.into_iter().map(|(p, ids)| (p.clone(), ids, stamp(&p, st.path.as_deref()))).collect(); s.apply_link_stamps(uid, now, true) } @@ -64,14 +68,15 @@ impl Session { return; } let Some(st) = self.active() else { return }; - let (uid, files) = (st.uid, crate::cmd::links::linked_groups(&st.doc)); + let (uid, files, doc_path) = (st.uid, crate::cmd::links::linked_groups(&st.doc), st.path.clone()); if files.is_empty() { return; } let slot: LinkScan = Arc::default(); let out = slot.clone(); + let scope = crate::file_access::ScopeHandle::capture(); let spawned = std::thread::Builder::new().name("link-watch".into()).spawn(move || { - let stamps = files.into_iter().map(|(p, ids)| (p.clone(), ids, stamp(&p))).collect(); + let stamps = scope.run(|| files.into_iter().map(|(p, ids)| (p.clone(), ids, stamp(&p, doc_path.as_deref()))).collect()); *out.lock().unwrap_or_else(PoisonError::into_inner) = Some((uid, stamps)); }); if spawned.is_ok() { diff --git a/crates/engine/src/tests_link_paths.rs b/crates/engine/src/tests_link_paths.rs new file mode 100644 index 0000000000..cd15f092be --- /dev/null +++ b/crates/engine/src/tests_link_paths.rs @@ -0,0 +1,120 @@ +//! Paths stored with linked files and SVG images are followed only on this computer or on the +//! document's own share (`fileio::document_path`): opening a document, Link Info, watching linked +//! files, and the images an SVG file links to. + +use serde_json::{Value, json}; +use vectorcraft_doc::{NodeId, NodeKind}; + +use super::*; +use crate::cmd::fileio::touched; +use crate::tests_links::{Folder, RED, place, png, session}; + +/// Paths to other computers (and, on Unix, a local file written as one: `//tmp/…`, which Linux +/// reads as `/tmp/…`). +fn far(dir: &Folder) -> Vec { + let mut out = vec![r"\\192.0.2.1\share\x.png".to_string(), "file://192.0.2.1/s/x.png".to_string()]; + if cfg!(unix) { + out.push(format!("/{}", dir.file("far/far.png"))); + } + out +} + +/// Did any path read reach another computer (or the local file written as one)? +fn far_reads(seen: &[String]) -> Vec<&String> { + seen.iter().filter(|p| p.contains("192.0.2.1") || p.starts_with("//") || p.starts_with(r"\\")).collect() +} + +/// A document saved at `dir/doc.vectorcraft` with one linked image per path in `paths`, each +/// showing `dir/pic.png` until its link is set → the document's path. +fn save_linked(dir: &Folder, paths: &[String]) -> String { + let pic = dir.file("pic.png"); + std::fs::write(&pic, png(8, 8, RED)).unwrap(); + let mut s = session(); + let ids: Vec = paths.iter().map(|_| place(&mut s, &pic)).collect(); + let mut doc = (*s.doc().unwrap().doc).clone(); + for (id, path) in ids.iter().zip(paths) { + let Some(NodeKind::Image(im)) = doc.node_mut(*id).map(|n| &mut n.kind) else { panic!("not an image") }; + im.link = Some(vectorcraft_doc::LinkInfo::new(path.clone())); + } + let path = dir.file("doc.vectorcraft"); + std::fs::write(&path, vectorcraft_format::save(&doc, false)).unwrap(); + path +} + +fn names(rows: &Value) -> Vec<&str> { + rows.as_array().unwrap().iter().map(|r| r["path"].as_str().unwrap()).collect() +} + +#[test] +fn linked_files_on_other_computers_are_never_read() { + let dir = Folder::new("docpath-open"); + std::fs::create_dir_all(dir.0.join("far")).unwrap(); + std::fs::write(dir.file("far/far.png"), png(8, 8, RED)).unwrap(); + std::fs::write(dir.file("near.png"), png(8, 8, RED)).unwrap(); + let far = far(&dir); + let mut paths = far.clone(); + paths.push("near.png".into()); + let doc = save_linked(&dir, &paths); + + let mut s = Session::new(); + let (r, seen) = touched(|| s.execute("document.open", &json!({"path": doc})).unwrap()); + assert_eq!(far_reads(&seen), Vec::<&String>::new()); + // The far paths are missing, saying why; the file beside the document is found. + assert_eq!(names(&r["missingLinks"]), far.iter().map(String::as_str).collect::>(), "{r}"); + for row in r["missingLinks"].as_array().unwrap() { + assert_eq!(row["refused"], "the path is on another computer", "{row}"); + } + let check = s.execute("links.check", &json!({})).unwrap(); + let near = check["links"].as_array().unwrap().iter().find(|l| l["name"] == "near.png").unwrap(); + assert_ne!(near["status"], "missing", "{check}"); + + // Link Info and the linked-file watch don't look at them either. + let ids: Vec = r["missingLinks"].as_array().unwrap().iter().map(|row| row["ids"][0].as_u64().unwrap()).collect(); + let (_, seen) = touched(|| { + for id in &ids { + let info = s.execute("links.info", &json!({"id": id})).unwrap(); + assert_eq!(info["refused"], "the path is on another computer", "{info}"); + } + s.execute("links.updateChanged", &json!({})).unwrap(); + s.start_link_scan(); + let t0 = std::time::Instant::now(); + while s.poll_link_scan().is_none() { + assert!(t0.elapsed().as_secs() < 10, "the look never finished"); + std::thread::yield_now(); + } + }); + assert_eq!(far_reads(&seen), Vec::<&String>::new()); + // The watch kept no stamp of them (`//tmp/…` would have one had it been looked at). + assert!(s.link_stamps.keys().all(|(_, p)| !far.contains(p)), "{:?}", s.link_stamps.keys()); +} + +#[test] +fn svg_images_on_other_computers_are_never_read() { + let dir = Folder::new("docpath-svg"); + std::fs::create_dir_all(dir.0.join("far")).unwrap(); + std::fs::write(dir.file("far/far.png"), png(8, 8, RED)).unwrap(); + std::fs::write(dir.file("near.png"), png(8, 8, RED)).unwrap(); + let mut hrefs = vec![r"\\192.0.2.1\share\x.png".to_string(), "file:////192.0.2.1/s/x.png".to_string(), "file://192.0.2.1/s/x.png".to_string()]; + if cfg!(unix) { + hrefs.push(format!("/{}", dir.file("far/far.png"))); + } + hrefs.push("near.png".into()); + let images: String = hrefs.iter().map(|h| format!("")).collect(); + let svg = format!("{images}"); + let path = dir.file("art.svg"); + std::fs::write(&path, &svg).unwrap(); + + let mut s = Session::new(); + let (r, seen) = touched(|| s.execute("document.open", &json!({"path": path})).unwrap()); + assert_eq!(far_reads(&seen), Vec::<&String>::new()); + // Every far image is a placeholder; only the one beside the SVG is read. + let warnings = r["warnings"].as_array().unwrap(); + assert_eq!(warnings.iter().filter(|w| w.as_str().unwrap().contains("a placeholder keeps its place")).count(), hrefs.len() - 1, "{r}"); + let near = |p: &&String| p.contains("docpath-svg") && p.ends_with("near.png"); + assert!(seen.iter().any(|p| near(&p)), "{seen:?}"); + + // Pasted SVG text has no folder: only absolute local paths are read. + let (_, seen) = touched(|| crate::cmd::fileio::import_svg(&svg, None).unwrap()); + assert_eq!(far_reads(&seen), Vec::<&String>::new()); + assert!(!seen.iter().any(|p| near(&p)), "{seen:?}"); +} diff --git a/crates/svg/Cargo.toml b/crates/svg/Cargo.toml index 7b679365ff..27be13e207 100644 --- a/crates/svg/Cargo.toml +++ b/crates/svg/Cargo.toml @@ -9,6 +9,8 @@ description = "VectorCraft SVG import and export" workspace = true [dependencies] +# Which paths stored in documents may be opened. +craft-docpath = { workspace = true } vectorcraft-geom = { workspace = true } vectorcraft-color = { workspace = true } vectorcraft-doc = { workspace = true } diff --git a/crates/svg/src/import/files.rs b/crates/svg/src/import/files.rs index 886072778a..b18d5595c7 100644 --- a/crates/svg/src/import/files.rs +++ b/crates/svg/src/import/files.rs @@ -79,33 +79,25 @@ fn percent_decoded(s: &str) -> String { String::from_utf8_lossy(&out).into_owned() } -/// Is `p` an absolute path here or on another system (`/…`, `C:/…`, `C:\…`)? -fn is_absolute(p: &str) -> bool { - Path::new(p).is_absolute() || p.starts_with('/') || matches!(p.as_bytes(), [d, b':', b'/' | b'\\', ..] if d.is_ascii_alphabetic()) -} - -/// Where href `h` points (a path, made absolute from `folder`, or a URL) and whether it is a -/// file that can be read. +/// Where href `h` points (a path, or a URL) and whether it is a file that may be read: a local +/// file, or one on the network share the SVG is on. A relative path is taken from `folder`, the +/// SVG's own; without it, only absolute paths are read (see `craft_docpath`). fn target(h: &str, folder: Option<&str>) -> (String, bool) { - let h = percent_decoded(h.trim()); - let path = match h.strip_prefix("file://") { - Some(rest) => { - let rest = rest.strip_prefix("localhost").unwrap_or(rest); - // `file:///C:/art.png` → `C:/art.png`. - match rest.as_bytes() { - [b'/', d, b':', ..] if d.is_ascii_alphabetic() => rest.get(1..).unwrap_or(rest).to_string(), - _ => rest.to_string(), - } - } - None if h.contains("://") => return (h, false), - None => h, - }; - if is_absolute(&path) { - return (path, true); + let h = h.trim(); + // `craft_docpath` decodes a `file:` URL itself; any other href is decoded here, once. + let file_url = h.get(..5).is_some_and(|s| s.eq_ignore_ascii_case("file:")); + let stored = if file_url { h.to_string() } else { percent_decoded(h) }; + if !file_url && stored.contains("://") { + return (stored, false); } - match folder { - Some(f) => (Path::new(f).join(&path).to_string_lossy().into_owned(), true), - None => (path, false), + // Resolved as a document inside `folder`: only the folder is used. + let document = folder.map(|f| Path::new(f).join("-")); + match craft_docpath::resolve(&stored, document.as_deref()) { + Ok(path) => { + let local = path.is_absolute(); + (path.to_string_lossy().into_owned(), local) + } + Err(_) => (stored, false), } } @@ -235,12 +227,32 @@ mod tests { #[test] fn hrefs_resolve_against_the_folder() { let sep = std::path::MAIN_SEPARATOR; - assert_eq!(target("photo%20one.png", Some("/art")), (format!("/art{sep}photo one.png"), true)); - assert_eq!(target("photo.png", None), ("photo.png".into(), false)); - assert_eq!(target("/abs/photo.png", Some("/art")), ("/abs/photo.png".into(), true)); - assert_eq!(target("file:///C:/art/a.png", None), ("C:/art/a.png".into(), true)); - assert_eq!(target("file:///home/a.png", None), ("/home/a.png".into(), true)); - assert_eq!(target("https://example.com/a.png", Some("/art")), ("https://example.com/a.png".into(), false)); + let art = std::env::temp_dir().join("art"); + let art = art.to_str().unwrap(); + assert_eq!(target("photo%20one.png", Some(art)), (format!("{art}{sep}photo one.png"), true)); + assert!(!target("photo.png", None).1); + assert_eq!(target("file:///C:/art/a.png", None), (r"C:\art\a.png".into(), cfg!(windows))); + assert_eq!(target("https://example.com/a.png", Some(art)), ("https://example.com/a.png".into(), false)); + #[cfg(unix)] + { + assert_eq!(target("/abs/photo.png", Some("/art")), ("/abs/photo.png".into(), true)); + assert_eq!(target("file:///home/a.png", None), ("/home/a.png".into(), true)); + } + } + + #[test] + fn hrefs_to_other_computers_are_not_read() { + let art = std::env::temp_dir().join("art"); + for h in [ + r"\\192.0.2.1\share\x.png", + "//192.0.2.1/share/x.png", + "file:////192.0.2.1/share/x.png", + "file://192.0.2.1/share/x.png", + "%5C%5C192.0.2.1%5Cshare%5Cx.png", + ] { + assert!(!target(h, art.to_str()).1, "{h}"); + assert!(!target(h, None).1, "{h}"); + } } #[test] diff --git a/docs/mcp.md b/docs/mcp.md index 1e8e9875b7..0c329acb13 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -466,7 +466,8 @@ symbol with strokes) stays art. `feGaussianBlur`, `feDropShadow` and the usual s colour matrix, composite, merge) become Gaussian Blur, Drop Shadow, Outer Glow, Inner Glow and Feather effects; other filters are listed in `warnings`. Undisplayed objects (`display:none`) come back hidden, nested clip paths intersect, and reflected or repeated gradients (`spreadMethod`) are expanded into stops. `` files (relative links are -found in the SVG's folder) stay linked images (see Linked images); SVG files and `data:` SVGs become art; a file that +found in the SVG's folder; only files on this computer or the SVG's network share are read, and pasted SVG reads only +absolute paths) stay linked images (see Linked images); SVG files and `data:` SVGs become art; a file that can't be read becomes a placeholder in its box, named in `warnings` and `missingLinks`. Native files: `run_command document.save {compress: true}` writes a gzip-compressed `.vectorcraft` (the @@ -2372,9 +2373,11 @@ A placed image linked to its file (`file.place {path}`, Link on) records the fil modification time and hash, and keeps a low-resolution preview (at most 256 px a side): a `.vectorcraft` save writes the preview instead of the pixels, plus the path relative to the saved file. `document.open` reads the linked files again, looking for each at its path, then at its relative path and by name in the document's folder -(so a folder moved with its links still opens): the result lists `missingLinks` (their images show the preview), -`modifiedLinks` (left as they were; read again only with the preference `updateLinks: "automatically"`, then they are -in `updatedLinks`), each as `{name, path, ids}`. The desktop app also checks the active document's links when its window +(so a folder moved with its links still opens). Only files on this computer, or on the network share the document is +on, are looked at: a path to another computer, a device or a URL counts as missing. The result lists `missingLinks` +(their images show the preview), `modifiedLinks` (left as they were; read again only with the preference +`updateLinks: "automatically"`, then they are in `updatedLinks`), each as `{name, path, ids}`, with `refused` (why the +path isn't followed) when it isn't. The desktop app also checks the active document's links when its window comes back to the front, following the same preference. `links.check` reports every link's `status` (`ok`, `modified`, `missing`), `links.update {ids?}` reads modified files again and `links.relink {ids?, path | folder}` points images at another file (or each at the file of its name in a folder); images keep their bounds, one undo step each. Without a From b05043c7599780de44a7147358f504f919bc6a93 Mon Sep 17 00:00:00 2001 From: aiongg Date: Fri, 16 Oct 2026 21:00:40 +0000 Subject: [PATCH 004/545] i18n: translate the new link and file-name messages --- crates/ui-egui/src/i18n/bg.tsv | 5 +++++ crates/ui-egui/src/i18n/cs.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/hu.tsv | 5 +++++ crates/ui-egui/src/i18n/it.tsv | 5 +++++ crates/ui-egui/src/i18n/ja.tsv | 5 +++++ crates/ui-egui/src/i18n/ko.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/uk.tsv | 5 +++++ crates/ui-egui/src/i18n/vi.tsv | 5 +++++ 17 files changed, 85 insertions(+) diff --git a/crates/ui-egui/src/i18n/bg.tsv b/crates/ui-egui/src/i18n/bg.tsv index 9acbb54a9d..924482dbac 100644 --- a/crates/ui-egui/src/i18n/bg.tsv +++ b/crates/ui-egui/src/i18n/bg.tsv @@ -4981,3 +4981,8 @@ theme Appearance Външен вид Movie Clip Филмов клип @msg name is empty името е празно @msg no symbol named `{n}` няма символ с име `{n}` +# Links and Attributes: files and URLs handed to other apps. +@msg Edit Original opens image and document files only; “{name}” is not one „Редактиране на оригинал“ отваря само файлове с изображения и документи; „{name}“ не е такъв файл +@msg only http, https and mailto URLs open in the browser, not “{url}” в браузъра се отварят само URL адреси с http, https и mailto, не „{url}“ +@msg {id} opens another app: only the person at the keyboard can run it {id} отваря друга програма: само човекът пред клавиатурата може да изпълни командата +@msg “{name}” is not a file „{name}“ не е файл diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv index b289026ba0..36e4fba26d 100644 --- a/crates/ui-egui/src/i18n/cs.tsv +++ b/crates/ui-egui/src/i18n/cs.tsv @@ -4999,3 +4999,8 @@ mark-style Japanese Japonské Movie Clip Filmový klip @msg name is empty název je prázdný @msg no symbol named `{n}` žádný symbol s názvem `{n}` +# Links and Attributes: files and URLs handed to other apps. +@msg Edit Original opens image and document files only; “{name}” is not one Upravit originál otevírá pouze soubory obrázků a dokumentů; „{name}“ mezi ně nepatří +@msg only http, https and mailto URLs open in the browser, not “{url}” v prohlížeči se otevírají pouze adresy URL http, https a mailto, ne „{url}“ +@msg {id} opens another app: only the person at the keyboard can run it {id} otevírá jinou aplikaci: spustit ho může pouze člověk u klávesnice +@msg “{name}” is not a file „{name}“ není soubor diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsv index 0dd943820c..76cae96b5f 100644 --- a/crates/ui-egui/src/i18n/de.tsv +++ b/crates/ui-egui/src/i18n/de.tsv @@ -4536,3 +4536,8 @@ theme Appearance Erscheinungsbild Movie Clip Movieclip @msg name is empty Name ist leer @msg no symbol named `{n}` kein Symbol namens `{n}` +# Links and Attributes: files and URLs handed to other apps. +@msg Edit Original opens image and document files only; “{name}” is not one Original bearbeiten öffnet nur Bild- und Dokumentdateien; „{name}“ gehört nicht dazu +@msg only http, https and mailto URLs open in the browser, not “{url}” nur http-, https- und mailto-URLs werden im Browser geöffnet, nicht „{url}“ +@msg {id} opens another app: only the person at the keyboard can run it {id} öffnet eine andere Anwendung: Nur die Person an der Tastatur kann den Befehl ausführen +@msg “{name}” is not a file „{name}“ ist keine Datei diff --git a/crates/ui-egui/src/i18n/el.tsv b/crates/ui-egui/src/i18n/el.tsv index 56703aea08..74855fb736 100644 --- a/crates/ui-egui/src/i18n/el.tsv +++ b/crates/ui-egui/src/i18n/el.tsv @@ -4951,3 +4951,8 @@ effect Points Σημεία Movie Clip Κλιπ ταινίας @msg name is empty το όνομα είναι κενό @msg no symbol named `{n}` κανένα σύμβολο με όνομα `{n}` +# Links and Attributes: files and URLs handed to other apps. +@msg Edit Original opens image and document files only; “{name}” is not one η Επεξεργασία πρωτοτύπου ανοίγει μόνο αρχεία εικόνων και εγγράφων· το «{name}» δεν είναι τέτοιο αρχείο +@msg only http, https and mailto URLs open in the browser, not “{url}” στο πρόγραμμα περιήγησης ανοίγουν μόνο URL http, https και mailto, όχι το «{url}» +@msg {id} opens another app: only the person at the keyboard can run it η εντολή {id} ανοίγει άλλη εφαρμογή: μόνο όποιος βρίσκεται στο πληκτρολόγιο μπορεί να την εκτελέσει +@msg “{name}” is not a file το «{name}» δεν είναι αρχείο diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index 4c6b07cb3c..4647291892 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -4941,3 +4941,8 @@ mark-style Japanese Japonesas Movie Clip Clip de película @msg name is empty el nombre está vacío @msg no symbol named `{n}` no hay ningún símbolo llamado `{n}` +# Links and Attributes: files and URLs handed to other apps. +@msg Edit Original opens image and document files only; “{name}” is not one Editar original solo abre archivos de imagen y de documento; “{name}” no lo es +@msg only http, https and mailto URLs open in the browser, not “{url}” solo se abren en el navegador las URL http, https y mailto, no “{url}” +@msg {id} opens another app: only the person at the keyboard can run it {id} abre otra aplicación: solo puede ejecutarlo la persona que está frente al teclado +@msg “{name}” is not a file “{name}” no es un archivo diff --git a/crates/ui-egui/src/i18n/fi.tsv b/crates/ui-egui/src/i18n/fi.tsv index f2750d8a06..c437243231 100644 --- a/crates/ui-egui/src/i18n/fi.tsv +++ b/crates/ui-egui/src/i18n/fi.tsv @@ -4963,3 +4963,8 @@ mark-style Japanese Japanilainen Movie Clip Elokuvaleike @msg name is empty nimi on tyhjä @msg no symbol named `{n}` symbolia nimeltä `{n}` ei ole +# Links and Attributes: files and URLs handed to other apps. +@msg Edit Original opens image and document files only; “{name}” is not one Muokkaa alkuperäistä avaa vain kuva- ja asiakirjatiedostoja; “{name}” ei ole sellainen +@msg only http, https and mailto URLs open in the browser, not “{url}” selaimessa avataan vain http-, https- ja mailto-URL-osoitteet, ei “{url}” +@msg {id} opens another app: only the person at the keyboard can run it {id} avaa toisen sovelluksen: vain näppäimistön ääressä oleva henkilö voi suorittaa sen +@msg “{name}” is not a file “{name}” ei ole tiedosto diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index 03146f17ad..24697bd5fb 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -4998,3 +4998,8 @@ theme Appearance Apparence Movie Clip Clip @msg name is empty le nom est vide @msg no symbol named `{n}` aucun symbole nommé `{n}` +# Links and Attributes: files and URLs handed to other apps. +@msg Edit Original opens image and document files only; “{name}” is not one Modifier l’original n’ouvre que les fichiers d’image et de document ; « {name} » n’en est pas un +@msg only http, https and mailto URLs open in the browser, not “{url}” seules les URL http, https et mailto s’ouvrent dans le navigateur, pas « {url} » +@msg {id} opens another app: only the person at the keyboard can run it {id} ouvre une autre application : seule la personne devant le clavier peut l’exécuter +@msg “{name}” is not a file « {name} » n’est pas un fichier diff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsv index 461070dcf3..1b4e56959e 100644 --- a/crates/ui-egui/src/i18n/hu.tsv +++ b/crates/ui-egui/src/i18n/hu.tsv @@ -4966,3 +4966,8 @@ imageTrace Outline Körvonal Movie Clip Mozgóklip @msg name is empty a név üres @msg no symbol named `{n}` nincs `{n}` nevű szimbólum +# Links and Attributes: files and URLs handed to other apps. +@msg Edit Original opens image and document files only; “{name}” is not one az Eredeti szerkesztése csak kép- és dokumentumfájlokat nyit meg; ez nem ilyen: „{name}” +@msg only http, https and mailto URLs open in the browser, not “{url}” a böngészőben csak a http-, https- és mailto-URL-ek nyílnak meg; ez nem ilyen: „{url}” +@msg {id} opens another app: only the person at the keyboard can run it {id}: másik alkalmazást nyit meg, ezért csak a billentyűzetnél ülő felhasználó futtathatja +@msg “{name}” is not a file nem fájl: „{name}” diff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsv index 21cfcf18a8..9e4b829e18 100644 --- a/crates/ui-egui/src/i18n/it.tsv +++ b/crates/ui-egui/src/i18n/it.tsv @@ -4576,3 +4576,8 @@ lighting Light Luce Movie Clip Clip filmato @msg name is empty il nome è vuoto @msg no symbol named `{n}` nessun simbolo denominato `{n}` +# Links and Attributes: files and URLs handed to other apps. +@msg Edit Original opens image and document files only; “{name}” is not one Modifica originale apre solo file di immagini e documenti; “{name}” non lo è +@msg only http, https and mailto URLs open in the browser, not “{url}” nel browser si aprono solo URL http, https e mailto, non “{url}” +@msg {id} opens another app: only the person at the keyboard can run it {id} apre un'altra applicazione: solo chi è alla tastiera può eseguirlo +@msg “{name}” is not a file “{name}” non è un file diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsv index 525c112f44..9733847564 100644 --- a/crates/ui-egui/src/i18n/ja.tsv +++ b/crates/ui-egui/src/i18n/ja.tsv @@ -4617,3 +4617,8 @@ lighting Light ライト Movie Clip ムービークリップ @msg name is empty 名前が空です @msg no symbol named `{n}` `{n}` という名前のシンボルはありません +# Links and Attributes: files and URLs handed to other apps. +@msg Edit Original opens image and document files only; “{name}” is not one 「オリジナルを編集」で開けるのは画像ファイルとドキュメントファイルだけです: 「{name}」はどちらでもありません +@msg only http, https and mailto URLs open in the browser, not “{url}” ブラウザーで開けるのは http、https、mailto の URL だけです: 「{url}」は開けません +@msg {id} opens another app: only the person at the keyboard can run it {id} は別のアプリを開きます: 実行できるのはキーボードの前にいるユーザーだけです +@msg “{name}” is not a file 「{name}」はファイルではありません diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsv index 6443cfcc4f..d92038db6b 100644 --- a/crates/ui-egui/src/i18n/ko.tsv +++ b/crates/ui-egui/src/i18n/ko.tsv @@ -4540,3 +4540,8 @@ lighting Light 광원 Movie Clip 무비 클립 @msg name is empty 이름이 비어 있습니다 @msg no symbol named `{n}` 이름이 `{n}`인 심볼이 없습니다 +# Links and Attributes: files and URLs handed to other apps. +@msg Edit Original opens image and document files only; “{name}” is not one 원본 편집은 이미지 및 문서 파일만 엽니다. “{name}”은(는) 해당하지 않습니다 +@msg only http, https and mailto URLs open in the browser, not “{url}” 브라우저에서는 http, https, mailto URL만 열립니다. “{url}”은(는) 열 수 없습니다 +@msg {id} opens another app: only the person at the keyboard can run it {id}은(는) 다른 앱을 엽니다. 키보드 앞에 있는 사용자만 실행할 수 있습니다 +@msg “{name}” is not a file “{name}”은(는) 파일이 아닙니다 diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv index ae9765d1d0..7c98ef5976 100644 --- a/crates/ui-egui/src/i18n/pl.tsv +++ b/crates/ui-egui/src/i18n/pl.tsv @@ -4844,3 +4844,8 @@ mark-style Japanese Japońskie Movie Clip Klip filmowy @msg name is empty nazwa jest pusta @msg no symbol named `{n}` brak symbolu o nazwie `{n}` +# Links and Attributes: files and URLs handed to other apps. +@msg Edit Original opens image and document files only; “{name}” is not one Edytuj oryginał otwiera tylko pliki obrazów i dokumentów; „{name}” do nich nie należy +@msg only http, https and mailto URLs open in the browser, not “{url}” w przeglądarce otwierają się tylko adresy URL http, https i mailto, a nie „{url}” +@msg {id} opens another app: only the person at the keyboard can run it {id} otwiera inną aplikację: uruchomić to polecenie może tylko osoba przy klawiaturze +@msg “{name}” is not a file „{name}” nie jest plikiem diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsv index 63e725edf1..ec1a2edfe4 100644 --- a/crates/ui-egui/src/i18n/pt-br.tsv +++ b/crates/ui-egui/src/i18n/pt-br.tsv @@ -4916,3 +4916,8 @@ mark-style Japanese Japonesas # Symbol Options › Export Type @msg name is empty o nome está vazio @msg no symbol named `{n}` nenhum símbolo chamado `{n}` +# Links and Attributes: files and URLs handed to other apps. +@msg Edit Original opens image and document files only; “{name}” is not one Editar Original abre apenas arquivos de imagem e de documento; “{name}” não é um deles +@msg only http, https and mailto URLs open in the browser, not “{url}” apenas URLs http, https e mailto abrem no navegador, não “{url}” +@msg {id} opens another app: only the person at the keyboard can run it {id} abre outro aplicativo: apenas a pessoa ao teclado pode executá-lo +@msg “{name}” is not a file “{name}” não é um arquivo diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsv index ee7c6e5cdd..4510c4c7fd 100644 --- a/crates/ui-egui/src/i18n/ru.tsv +++ b/crates/ui-egui/src/i18n/ru.tsv @@ -4572,3 +4572,8 @@ lighting Light Свет Movie Clip Видеоклип @msg name is empty имя пустое @msg no symbol named `{n}` нет символа с именем `{n}` +# Links and Attributes: files and URLs handed to other apps. +@msg Edit Original opens image and document files only; “{name}” is not one «Редактировать оригинал» открывает только файлы изображений и документов; «{name}» к ним не относится +@msg only http, https and mailto URLs open in the browser, not “{url}” в браузере открываются только URL с http, https и mailto, а не «{url}» +@msg {id} opens another app: only the person at the keyboard can run it {id} открывает другое приложение: выполнить эту команду может только человек за клавиатурой +@msg “{name}” is not a file «{name}» не является файлом diff --git a/crates/ui-egui/src/i18n/sv.tsv b/crates/ui-egui/src/i18n/sv.tsv index fb6ef9f239..54d260cb47 100644 --- a/crates/ui-egui/src/i18n/sv.tsv +++ b/crates/ui-egui/src/i18n/sv.tsv @@ -4955,3 +4955,8 @@ theme Appearance Utseende Movie Clip Filmklipp @msg name is empty namnet är tomt @msg no symbol named `{n}` ingen symbol med namnet `{n}` +# Links and Attributes: files and URLs handed to other apps. +@msg Edit Original opens image and document files only; “{name}” is not one Redigera original öppnar bara bild- och dokumentfiler; ”{name}” är ingen sådan +@msg only http, https and mailto URLs open in the browser, not “{url}” bara http-, https- och mailto-URL:er öppnas i webbläsaren, inte ”{url}” +@msg {id} opens another app: only the person at the keyboard can run it {id} öppnar en annan app: bara personen vid tangentbordet kan köra kommandot +@msg “{name}” is not a file ”{name}” är inte en fil diff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsv index d80b7657e3..055724b026 100644 --- a/crates/ui-egui/src/i18n/uk.tsv +++ b/crates/ui-egui/src/i18n/uk.tsv @@ -4556,3 +4556,8 @@ lighting Light Світло Movie Clip Кліп @msg name is empty ім’я порожнє @msg no symbol named `{n}` немає символу з назвою `{n}` +# Links and Attributes: files and URLs handed to other apps. +@msg Edit Original opens image and document files only; “{name}” is not one «Редагувати оригінал» відкриває лише файли зображень і документів; «{name}» до них не належить +@msg only http, https and mailto URLs open in the browser, not “{url}” у браузері відкриваються лише URL з http, https і mailto, а не «{url}» +@msg {id} opens another app: only the person at the keyboard can run it {id} відкриває іншу програму: виконати цю команду може лише людина за клавіатурою +@msg “{name}” is not a file «{name}» не є файлом diff --git a/crates/ui-egui/src/i18n/vi.tsv b/crates/ui-egui/src/i18n/vi.tsv index 68faa3b093..dbf9ead982 100644 --- a/crates/ui-egui/src/i18n/vi.tsv +++ b/crates/ui-egui/src/i18n/vi.tsv @@ -4556,3 +4556,8 @@ theme Appearance Giao diện Movie Clip Clip phim @msg name is empty tên trống @msg no symbol named `{n}` không có biểu tượng nào tên `{n}` +# Links and Attributes: files and URLs handed to other apps. +@msg Edit Original opens image and document files only; “{name}” is not one Chỉnh sửa bản gốc chỉ mở tệp hình ảnh và tài liệu; “{name}” không thuộc loại đó +@msg only http, https and mailto URLs open in the browser, not “{url}” chỉ URL http, https và mailto mới được mở trong trình duyệt, không mở “{url}” +@msg {id} opens another app: only the person at the keyboard can run it {id} mở một ứng dụng khác: chỉ người đang ở bàn phím mới chạy được lệnh này +@msg “{name}” is not a file “{name}” không phải là tệp From 82e363c73b4bb09fc7f02b732ed3481b3789c2f0 Mon Sep 17 00:00:00 2001 From: aiongg Date: Sat, 17 Oct 2026 02:20:38 +0000 Subject: [PATCH 005/545] Build: use craft-docpath from craft-libs --- Cargo.lock | 1 + Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 78b0e378b9..e2bcf3f46c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -809,6 +809,7 @@ dependencies = [ [[package]] name = "craft-docpath" version = "0.1.0" +source = "git+https://github.com/aiongg/craft-libs?rev=12281d07fedff5c955bb68344fb287aa5d87971e#12281d07fedff5c955bb68344fb287aa5d87971e" [[package]] name = "craft-pdf" diff --git a/Cargo.toml b/Cargo.toml index 9536a0b248..59a5853d45 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,7 +13,7 @@ repository = "https://github.com/storytold/vectorcraft" [workspace.dependencies] craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "ca50d63b773c99f96e75c77ce5a1d21e7c9cda0d", default-features = false, features = ["interpret", "write"] } craft-print = { git = "https://github.com/storytold/craft-libs", rev = "d991bf6792f8ade99c51358bf3c1d902c8cd96b5" } -craft-docpath = { path = "../secfix-craft-libs/crates/docpath" } +craft-docpath = { git = "https://github.com/aiongg/craft-libs", version = "0.1.0", rev = "12281d07fedff5c955bb68344fb287aa5d87971e" } craft-ui = { git = "https://github.com/storytold/craft-libs", rev = "5c874d51eeb3de70e735c8ce87a59a7dedd47675", features = ["serde"] } # internal vectorcraft-geom = { path = "crates/geom" } From 39f9204d57bc4c00a330ff84730ee1e1b00f5b08 Mon Sep 17 00:00:00 2001 From: skylar taylor-barrick Date: Sat, 17 Oct 2026 12:03:53 -0600 Subject: [PATCH 006/545] Build: take craft-docpath from the merged craft-libs rev craft-libs#169 is merged, so the fork pin is no longer needed. Pinned to storytold/craft-libs 82a24b006eefa036b43c09a67fb9a3fbd17ffe63 (main after the merge) rather than the older 12281d07, which predates resolve_absolute and the Windows colon refusal. --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e2bcf3f46c..507606b332 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -809,7 +809,7 @@ dependencies = [ [[package]] name = "craft-docpath" version = "0.1.0" -source = "git+https://github.com/aiongg/craft-libs?rev=12281d07fedff5c955bb68344fb287aa5d87971e#12281d07fedff5c955bb68344fb287aa5d87971e" +source = "git+https://github.com/storytold/craft-libs?rev=82a24b006eefa036b43c09a67fb9a3fbd17ffe63#82a24b006eefa036b43c09a67fb9a3fbd17ffe63" [[package]] name = "craft-pdf" diff --git a/Cargo.toml b/Cargo.toml index 59a5853d45..19d3ccb840 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,7 +13,7 @@ repository = "https://github.com/storytold/vectorcraft" [workspace.dependencies] craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "ca50d63b773c99f96e75c77ce5a1d21e7c9cda0d", default-features = false, features = ["interpret", "write"] } craft-print = { git = "https://github.com/storytold/craft-libs", rev = "d991bf6792f8ade99c51358bf3c1d902c8cd96b5" } -craft-docpath = { git = "https://github.com/aiongg/craft-libs", version = "0.1.0", rev = "12281d07fedff5c955bb68344fb287aa5d87971e" } +craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "82a24b006eefa036b43c09a67fb9a3fbd17ffe63" } craft-ui = { git = "https://github.com/storytold/craft-libs", rev = "5c874d51eeb3de70e735c8ce87a59a7dedd47675", features = ["serde"] } # internal vectorcraft-geom = { path = "crates/geom" } From 61905254828ec81956c8cf17f2bdedf357b15158 Mon Sep 17 00:00:00 2001 From: Victor <124060164+VL420@users.noreply.github.com> Date: Sat, 17 Oct 2026 14:27:01 -0300 Subject: [PATCH 007/545] =?UTF-8?q?G4:=20Paragraph=20panel=20menu=20?= =?UTF-8?q?=E2=80=BA=20Roman=20Hanging=20Punctuation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Paragraph panel menu's Roman Hanging Punctuation was a disabled stub. It is now a per-paragraph attribute: in a left-to-right paragraph of point or area type with it on, the punctuation Optical Margin Alignment hangs (quotation marks, hyphens, full stops and commas wholly; asterisks, tildes, ellipses, en and em dashes, colons and semicolons by half) hangs outside the margin when it starts or ends a line, on the same sides (left-aligned lines at their left, right-aligned at their right, centered and justified at both); letters don't hang. With Optical Margin Alignment on as well, letters hang too. East Asian punctuation keeps hanging only through burasagari. The layout shares Optical Margin Alignment's hanging code, given the share of each glyph that hangs. text.setFormat takes romanHangingPunctuation; it is off by default, saved only when on, carried by paragraph styles (New and Redefine capture it) and turned off by Reset Panel. The panel menu item is a checkbox enabled with type selected. Docs: docs/mcp.md, docs/type-parity.md, docs/gaps.md. Closes #2756. Co-Authored-By: Claude Opus 5.5 --- crates/doc/src/text.rs | 10 +++++++ crates/engine/src/cmd/panelcmds.rs | 6 +++- crates/engine/src/cmd/textstyles.rs | 1 + crates/engine/src/cmd/typecmd.rs | 37 ++++++++++++++++++++++++ crates/text/src/layout.rs | 27 +++++++++++------ crates/text/src/tests.rs | 40 ++++++++++++++++++++++++++ crates/ui-egui/src/panels/paragraph.rs | 28 ++++++++++++------ docs/gaps.md | 3 +- docs/mcp.md | 16 +++++++++++ docs/type-parity.md | 2 ++ 10 files changed, 151 insertions(+), 19 deletions(-) diff --git a/crates/doc/src/text.rs b/crates/doc/src/text.rs index b0e29883e5..e1ed1cd3be 100644 --- a/crates/doc/src/text.rs +++ b/crates/doc/src/text.rs @@ -458,6 +458,10 @@ pub struct ParaStyle { /// Kinsoku (Paragraph panel › Kinsoku Set): which Japanese characters may not start or end a /// line. pub kinsoku: Kinsoku, + /// Roman Hanging Punctuation (Paragraph panel menu): quotation marks, hyphens, full stops and + /// commas starting or ending a line hang outside the margin, and asterisks, tildes, ellipses, + /// dashes, colons and semicolons hang by half. East Asian punctuation hangs by burasagari. + pub roman_hanging: bool, } /// [`ParaStyle`] as saved. [`Justify::Auto`] is written as the alignment it has in the paragraph @@ -499,6 +503,8 @@ struct ParaStyleFile { burasagari: Burasagari, #[serde(default, skip_serializing_if = "crate::skip::is_default")] kinsoku: Kinsoku, + #[serde(default, skip_serializing_if = "crate::skip::is_default")] + roman_hanging: bool, } impl From for ParaStyleFile { @@ -525,6 +531,7 @@ impl From for ParaStyleFile { leading_model, burasagari, kinsoku, + roman_hanging, .. } = p; Self { @@ -545,6 +552,7 @@ impl From for ParaStyleFile { leading_model, burasagari, kinsoku, + roman_hanging, } } } @@ -568,6 +576,7 @@ impl From for ParaStyle { leading_model, burasagari, kinsoku, + roman_hanging, .. } = f; Self { @@ -587,6 +596,7 @@ impl From for ParaStyle { leading_model, burasagari, kinsoku, + roman_hanging, } } } diff --git a/crates/engine/src/cmd/panelcmds.rs b/crates/engine/src/cmd/panelcmds.rs index 34576b9277..3b5dc2e770 100644 --- a/crates/engine/src/cmd/panelcmds.rs +++ b/crates/engine/src/cmd/panelcmds.rs @@ -43,7 +43,7 @@ pub fn specs() -> Vec { "Character / Paragraph", [], None, - "{ids?|id?, kerning?: 1/1000 em|\"auto\", baselineShift?: pt, hScale?: %, vScale?: %, rotation?: deg, underline?, strikethrough?, allCaps?, smallCaps?: bool, position?: \"normal\"|\"superscript\"|\"subscript\" (sizes from Document Setup), leftIndent?, rightIndent?, firstLineIndent?, spaceBefore?, spaceAfter?: pt (±1296), hyphenate?: bool, wordsLongerThan?: letters 1..25 (5), afterFirst?, beforeLast?: letters 1..15 (3), hyphenLimit?: lines 0..25 (0: no limit), hyphenationZone?: pt 0..1296 (0; Single-line Composer only), hyphenateCapitalized?: bool (true) (Paragraph panel menu › Hyphenation…: only words longer than wordsLongerThan break, keeping afterFirst letters before the hyphen and beforeLast after it; at most hyphenLimit lines in a row end with a hyphen; a line whose text already ends within hyphenationZone of its right edge breaks before the next word instead of hyphenating it; the counts are rounded, and every value is clamped to its range), mojikumi?: \"none\"|\"lineEndHalf\" (Japanese punctuation spacing), kinsoku?: \"none\"|\"hard\"|\"soft\" (Kinsoku Set: Soft lets 々, ー and small kana start a line), direction?: \"auto\"|\"leftToRight\"|\"rightToLeft\" (paragraph direction; auto: from each paragraph's first strong character), leadingModel?: \"romanBaseline\"|\"emBoxTop\" (leading measured baseline to baseline, or em box top to top), charAlign?: \"romanBaseline\"|\"emBoxTop\"|\"emBoxCenter\"|\"emBoxBottom\"|\"icfTop\"|\"icfBottom\" (where characters smaller than the largest on their line line up with it), proportionalMetrics?: bool (full-width glyphs on the font's proportional widths: `palt` in horizontal type, `vpal` in vertical type), digits?: \"default\"|\"arabic\"|\"hindi\"|\"farsi\" (Character panel menu › Digits: the numeral system every digit is drawn in, whatever was typed), fontAxes?: {\"wght\": 650, …} (Character panel › Variable Font, as text.setRangeStyle: each axis named set in its units and clamped to its range, null back to the style's own setting), burasagari?: \"none\"|\"standard\"|\"forced\" (Paragraph panel menu › Burasagari None/Regular/Force: an East Asian comma or full stop ending an area type line hangs outside it: when it doesn't fit, or always; new type: \"standard\"), composer?: \"singleLine\"|\"everyLine\" (line breaking, Every-line by default), start?: byte, end?: byte} (baselineShift is in document points and hScale includes the object transform; groups include their text descendants; with a range: the character attributes style that range and the paragraph attributes apply to the paragraphs it touches; without: all the text)", + "{ids?|id?, kerning?: 1/1000 em|\"auto\", baselineShift?: pt, hScale?: %, vScale?: %, rotation?: deg, underline?, strikethrough?, allCaps?, smallCaps?: bool, position?: \"normal\"|\"superscript\"|\"subscript\" (sizes from Document Setup), leftIndent?, rightIndent?, firstLineIndent?, spaceBefore?, spaceAfter?: pt (±1296), hyphenate?: bool, wordsLongerThan?: letters 1..25 (5), afterFirst?, beforeLast?: letters 1..15 (3), hyphenLimit?: lines 0..25 (0: no limit), hyphenationZone?: pt 0..1296 (0; Single-line Composer only), hyphenateCapitalized?: bool (true) (Paragraph panel menu › Hyphenation…: only words longer than wordsLongerThan break, keeping afterFirst letters before the hyphen and beforeLast after it; at most hyphenLimit lines in a row end with a hyphen; a line whose text already ends within hyphenationZone of its right edge breaks before the next word instead of hyphenating it; the counts are rounded, and every value is clamped to its range), mojikumi?: \"none\"|\"lineEndHalf\" (Japanese punctuation spacing), kinsoku?: \"none\"|\"hard\"|\"soft\" (Kinsoku Set: Soft lets 々, ー and small kana start a line), direction?: \"auto\"|\"leftToRight\"|\"rightToLeft\" (paragraph direction; auto: from each paragraph's first strong character), leadingModel?: \"romanBaseline\"|\"emBoxTop\" (leading measured baseline to baseline, or em box top to top), charAlign?: \"romanBaseline\"|\"emBoxTop\"|\"emBoxCenter\"|\"emBoxBottom\"|\"icfTop\"|\"icfBottom\" (where characters smaller than the largest on their line line up with it), proportionalMetrics?: bool (full-width glyphs on the font's proportional widths: `palt` in horizontal type, `vpal` in vertical type), digits?: \"default\"|\"arabic\"|\"hindi\"|\"farsi\" (Character panel menu › Digits: the numeral system every digit is drawn in, whatever was typed), fontAxes?: {\"wght\": 650, …} (Character panel › Variable Font, as text.setRangeStyle: each axis named set in its units and clamped to its range, null back to the style's own setting), burasagari?: \"none\"|\"standard\"|\"forced\" (Paragraph panel menu › Burasagari None/Regular/Force: an East Asian comma or full stop ending an area type line hangs outside it: when it doesn't fit, or always; new type: \"standard\"), romanHangingPunctuation?: bool (Paragraph panel menu › Roman Hanging Punctuation: quotation marks, hyphens, full stops and commas starting or ending a line hang outside the margin, asterisks, tildes, ellipses, dashes, colons and semicolons by half; off by default), composer?: \"singleLine\"|\"everyLine\" (line breaking, Every-line by default), start?: byte, end?: byte} (baselineShift is in document points and hScale includes the object transform; groups include their text descendants; with a range: the character attributes style that range and the paragraph attributes apply to the paragraphs it touches; without: all the text)", has_doc, set_format ), @@ -278,6 +278,7 @@ fn set_format(s: &mut Session, p: &Value) -> Result { "digits", "fontAxes", "burasagari", + "romanHangingPunctuation", "composer", ]; if !keys.iter().any(|k| p.get(*k).is_some()) { @@ -444,6 +445,9 @@ fn set_format(s: &mut Session, p: &Value) -> Result { if let Some(v) = burasagari { para.burasagari = v; } + if let Some(v) = flag("romanHangingPunctuation") { + para.roman_hanging = v; + } if let Some(v) = composer { para.composer = v; } diff --git a/crates/engine/src/cmd/textstyles.rs b/crates/engine/src/cmd/textstyles.rs index a5f6361db4..9ae6813498 100644 --- a/crates/engine/src/cmd/textstyles.rs +++ b/crates/engine/src/cmd/textstyles.rs @@ -177,6 +177,7 @@ pub fn para_attrs(v: &ParaStyle) -> Map { ("leading_model", json!(v.leading_model)), ("burasagari", json!(v.burasagari)), ("kinsoku", json!(v.kinsoku)), + ("roman_hanging", json!(v.roman_hanging)), ] { m.insert(k.into(), x); } diff --git a/crates/engine/src/cmd/typecmd.rs b/crates/engine/src/cmd/typecmd.rs index 7217f705fd..114de14b74 100644 --- a/crates/engine/src/cmd/typecmd.rs +++ b/crates/engine/src/cmd/typecmd.rs @@ -1061,6 +1061,43 @@ mod area_tests { assert_eq!(old.hyphenation, HyphenationOptions::default()); } + /// Paragraph panel menu › Roman Hanging Punctuation: `text.setFormat {romanHangingPunctuation}` + /// sets it per paragraph in one undo step, the opening quotation mark then hangs left of the + /// frame, it is saved only when on, and paragraph styles carry it. + #[test] + fn roman_hanging_punctuation_is_set_per_paragraph_and_saved_only_when_on() { + let mut s = Session::new(); + s.execute("file.new", &json!({"width": 400, "height": 400})).unwrap(); + let id = s + .execute("text.create", &json!({"x": 10, "y": 10, "size": 40, "text": "“Quoted”\n“Two”", "area": {"width": 300, "height": 200}})) + .unwrap()["id"] + .as_u64() + .unwrap(); + let text = |s: &Session| match &s.doc().unwrap().doc.node(NodeId(id)).unwrap().kind { + NodeKind::Text(t) => (**t).clone(), + _ => panic!("text"), + }; + let left = |s: &Session| text(s).cached_bounds.unwrap().x0; + assert!(!text(&s).para_at(0).roman_hanging); + assert!(serde_json::to_value(text(&s).para_at(0)).unwrap().get("roman_hanging").is_none()); + let inside = left(&s); + s.execute("select.set", &json!({"ids": [id]})).unwrap(); + // Only the first paragraph (the caret's range). + s.execute("text.setFormat", &json!({"romanHangingPunctuation": true, "start": 0, "end": 0})).unwrap(); + assert!(text(&s).para_at(0).roman_hanging && !text(&s).para_at(1).roman_hanging); + assert!(left(&s) < inside - 5.0, "{} {inside}", left(&s)); + assert_eq!(serde_json::to_value(text(&s).para_at(0)).unwrap()["roman_hanging"], true); + let back: vectorcraft_doc::ParaStyle = serde_json::from_value(serde_json::to_value(text(&s).para_at(0)).unwrap()).unwrap(); + assert!(back.roman_hanging); + s.execute("edit.undo", &json!({})).unwrap(); + assert!(!text(&s).para_at(0).roman_hanging); + assert!((left(&s) - inside).abs() < 1e-9); + // A paragraph style carries it. + s.execute("paraStyle.new", &json!({"name": "Hung", "attrs": {"roman_hanging": true}})).unwrap(); + s.execute("paraStyle.apply", &json!({"name": "Hung", "id": id})).unwrap(); + assert!(text(&s).para_at(1).roman_hanging); + } + /// #432: while the interface is in Japanese, new type (text.create, text.createInPath) starts /// with em box top-to-top leading and em box centre alignment, and new styles made from nothing /// carry them; params override; the values are journaled; imported text keeps the Roman diff --git a/crates/text/src/layout.rs b/crates/text/src/layout.rs index 97c08ed05d..b4d5418fec 100644 --- a/crates/text/src/layout.rs +++ b/crates/text/src/layout.rs @@ -1354,6 +1354,12 @@ fn optical_share(g: &SGlyph) -> f64 { } } +/// Roman Hanging Punctuation: the share of glyph `g`'s advance that hangs outside the margin when +/// `g` starts or ends a line: [`optical_share`]'s punctuation, and no letters. +fn roman_share(g: &SGlyph) -> f64 { + if g.ch.is_alphabetic() { 0.0 } else { optical_share(g) } +} + /// A punctuation mark that hangs ([`optical_share`]), not a letter. fn optical_punct(g: &SGlyph) -> bool { !g.ch.is_alphabetic() && optical_share(g) > 0.0 @@ -1364,20 +1370,20 @@ fn is_quote(c: char) -> bool { matches!(c, '\'' | '"' | '‘' | '’' | '‚' | '‛' | '“' | '”' | '„' | '‟') } -/// Optical Margin Alignment: how far a line hangs outside its left and right margins, from the -/// glyph at each end of `line` (its glyphs in visual order, each with the advance it is set with) -/// and its [`optical_share`], and how many glyphs hang at each end → (left, right, left glyphs, +/// Optical Margin Alignment and Roman Hanging Punctuation: how far a line hangs outside its left +/// and right margins, from the glyph at each end of `line` (its glyphs in visual order, each with +/// the advance it is set with) and its `share` ([`optical_share`] or [`roman_share`]), and how many glyphs hang at each end → (left, right, left glyphs, /// right glyphs). A punctuation mark followed by a quotation mark hangs together with it: `."` /// ending a line and `'"` starting one hang both their glyphs. A line of one glyph hangs at /// neither end. -fn optical_hangs(line: &[(&SGlyph, f64)]) -> (f64, f64, usize, usize) { +fn optical_hangs(line: &[(&SGlyph, f64)], share: fn(&SGlyph) -> f64) -> (f64, f64, usize, usize) { let n = line.len(); if n < 2 { return (0.0, 0.0, 0, 0); } - let hang = |k: usize| line.get(k).map_or(0.0, |&(g, adv)| optical_share(g) * adv.max(0.0)); + let hang = |k: usize| line.get(k).map_or(0.0, |&(g, adv)| share(g) * adv.max(0.0)); let punct = |k: usize| line.get(k).is_some_and(|&(g, _)| optical_punct(g)); - let quote = |k: usize| line.get(k).is_some_and(|&(g, _)| is_quote(g.ch) && optical_share(g) > 0.0); + let quote = |k: usize| line.get(k).is_some_and(|&(g, _)| is_quote(g.ch) && share(g) > 0.0); let mut left = hang(0); // The glyphs that hang at the left; the right end takes none of them. let mut taken = usize::from(left > 0.0); @@ -1843,15 +1849,18 @@ fn flow(cx: &mut Ctx<'_>, paras: &[Range], t: &TextObject, regions: Optio // hang at both. A line that ends in a burasagari mark hangs only at its left. // Justification adds no space after a punctuation mark hanging at the left, nor before // one hanging at the right (`held`). A letter that hangs by part of its width keeps its - // gaps. - let (opt_l, opt_r, held) = if t.optical_margin && !rtl { + // gaps. Roman Hanging Punctuation (a paragraph attribute) hangs the same punctuation + // by the same amounts, and no letters; with Optical Margin Alignment on as well, the + // letters hang too. + let (opt_l, opt_r, held) = if (t.optical_margin || para.roman_hanging) && !rtl { + let share: fn(&SGlyph) -> f64 = if t.optical_margin { optical_share } else { roman_share }; let at: Vec = order.iter().map(|&offset| i + offset).filter(|&j| j < body).collect(); let mut visible: Vec<(&SGlyph, f64)> = at.iter().filter_map(|&j| sg.get(j).map(|g| (g, if j + 1 == trimmed { g.adv - end_trim } else { g.adv }))).collect(); if let Some(h) = &hyphen { visible.push((h, h.adv)); } - let (l, r, left_glyphs, right_glyphs) = optical_hangs(&visible); + let (l, r, left_glyphs, right_glyphs) = optical_hangs(&visible, share); let (r, right_glyphs) = if hang.is_some() { (0.0, 0) } else { (r, right_glyphs) }; let n_visible = visible.len(); let punct = |k: usize| visible.get(k).is_some_and(|&(g, _)| optical_punct(g)); diff --git a/crates/text/src/tests.rs b/crates/text/src/tests.rs index aa7d4dbee0..5cd6114e3f 100644 --- a/crates/text/src/tests.rs +++ b/crates/text/src/tests.rs @@ -907,6 +907,46 @@ fn optical_margin_alignment_hangs_punctuation_and_letter_edges_outside_the_margi assert_eq!(rtl(true), rtl(false)); } +/// Roman Hanging Punctuation (a paragraph attribute) hangs the punctuation Optical Margin +/// Alignment hangs, by the same amounts, and no letters; only the paragraphs that have it hang. +#[test] +fn roman_hanging_punctuation_hangs_punctuation_but_not_letters() { + let frame = Rect::new(0.0, 0.0, 300.0, 400.0); + let lay = |text: &str, justify: Justify, on: bool| { + let mut t = area(text, style(20.0), frame, justify); + t.para.roman_hanging = on; + layout(db(), &t).glyphs + }; + let near = |a: f64, b: f64| (a - b).abs() < 1e-6; + let end = |g: &PositionedGlyph| g.origin.x + g.advance; + // Left aligned: the opening quotation mark hangs wholly. + let on = lay("“Hello” there", Justify::Left, true); + assert!(near(on[1].origin.x, 0.0) && near(on[0].origin.x, -on[0].advance) && on[0].advance > 1.0, "{:?}", on[0].origin); + // An em dash hangs by half its advance. + let dash = lay("—ab", Justify::Left, true); + assert!(near(dash[0].origin.x, -0.5 * dash[0].advance), "{}", dash[0].origin.x); + // Letters don't hang, where Optical Margin Alignment hangs an A by a tenth. + assert!(near(lay("AVA", Justify::Left, true)[0].origin.x, 0.0)); + // Right aligned: the full stop and the closing quotation mark after it hang at the right. + let r = lay("“Hi.”", Justify::Right, true); + assert!(near(end(&r[2]), 300.0), "{}", end(&r[2])); + // Justified: a hyphen at each end hangs, the words fill the frame between them. + let j = lay("-ab cd-", Justify::JustifyAll, true); + let n = j.len(); + assert!(near(j[1].origin.x, 0.0) && near(j[n - 1].origin.x, 300.0), "{} {}", j[1].origin.x, j[n - 1].origin.x); + // Off: nothing hangs. + assert!(near(lay("“Hello” there", Justify::Left, false)[0].origin.x, 0.0)); + // Per paragraph: the second paragraph, without it, doesn't hang. + let mut t = area("“One\n“Two", style(20.0), frame, Justify::Left); + let mut first = t.para.clone(); + first.roman_hanging = true; + t.set_paragraph_styles(vec![first, t.para.clone()]); + let l = layout(db(), &t); + let at = |b: usize| l.glyphs.iter().find(|g| g.byte == b).unwrap().origin.x; + assert!(at(0) < -1.0, "first paragraph hangs: {}", at(0)); + assert!(near(at("“One\n".len()), 0.0), "second doesn't: {}", at("“One\n".len())); +} + /// With craft-fonts and no installed fonts (the web), Thai is set in Noto Sans Thai, not as empty /// boxes. Skipped when built without craft-fonts or with a checkout that has no Thai font. #[test] diff --git a/crates/ui-egui/src/panels/paragraph.rs b/crates/ui-egui/src/panels/paragraph.rs index 84c52281fc..af33f0d6b5 100644 --- a/crates/ui-egui/src/panels/paragraph.rs +++ b/crates/ui-egui/src/panels/paragraph.rs @@ -1,6 +1,7 @@ //! Paragraph panel: seven alignment buttons, Paragraph Direction (with the Indic options), indents, //! space before/after, Hyphenate, Mojikumi Set and Kinsoku Set (with the East Asian options); the panel menu -//! opens Hyphenation… and picks the Single-line or Every-line Composer. +//! turns Roman Hanging Punctuation on and off, opens Hyphenation… and picks the Single-line or +//! Every-line Composer. use egui::{Ui, vec2}; use serde_json::{Value, json}; @@ -282,9 +283,12 @@ pub fn menu(app: &mut VectorcraftApp, ui: &mut Ui) { set_pstate(ui.ctx(), "pa-hide-options", !hidden); } ui.separator(); - for l in [tl!("Roman Hanging Punctuation"), tl!("Justification…")] { - menu_item(ui, l, false, false); + // Quotation marks, hyphens, full stops and commas at a line's ends hang outside the margin. + let roman = style.as_ref().is_some_and(|(_, p)| p.roman_hanging); + if menu_item(ui, tl!("Roman Hanging Punctuation"), has, roman) { + format(app, json!({"romanHangingPunctuation": !roman})); } + menu_item(ui, tl!("Justification…"), false, false); if menu_item(ui, tl!("Hyphenation…"), has, false) && let Err(e) = app.run("ui.hyphenation", json!({})) { @@ -336,7 +340,8 @@ pub fn menu(app: &mut VectorcraftApp, ui: &mut Ui) { /// Reset Panel: the paragraphs the panel acts on ([`format`]) take Auto alignment, no indents or /// paragraph spacing, Hyphenate off with the default Hyphenation options, Auto direction, -/// Bottom-to-Bottom Leading, Regular burasagari, the Hard kinsoku set and the Every-line Composer. +/// Bottom-to-Bottom Leading, Regular burasagari, the Hard kinsoku set, the Every-line Composer and +/// Roman Hanging Punctuation off. fn reset_panel(app: &mut VectorcraftApp) { let h = HyphenationOptions::default(); para_cmd(app, "text.setStyle", json!({"justify": "auto"})); @@ -346,7 +351,8 @@ fn reset_panel(app: &mut VectorcraftApp) { "leftIndent": 0, "rightIndent": 0, "firstLineIndent": 0, "spaceBefore": 0, "spaceAfter": 0, "hyphenate": false, "wordsLongerThan": h.words_longer_than, "afterFirst": h.after_first, "beforeLast": h.before_last, "hyphenLimit": h.hyphen_limit, "hyphenationZone": h.zone, "hyphenateCapitalized": h.capitalized, - "direction": "auto", "leadingModel": "romanBaseline", "burasagari": "standard", "kinsoku": "hard", "composer": "everyLine" + "direction": "auto", "leadingModel": "romanBaseline", "burasagari": "standard", "kinsoku": "hard", "composer": "everyLine", + "romanHangingPunctuation": false }), ); } @@ -574,8 +580,9 @@ mod tests { assert!(tips(&mut app) > without, "two more buttons"); } - /// Reset Panel turns Hyphenate off and sets the Hyphenation options back to their defaults in - /// every paragraph it acts on, so the paragraphs save no hyphenation options. + /// Reset Panel turns Hyphenate and Roman Hanging Punctuation off and sets the Hyphenation + /// options back to their defaults in every paragraph it acts on, so the paragraphs save no + /// hyphenation options. #[test] fn reset_panel_resets_the_hyphenation_options() { let mut app = VectorcraftApp::new(Session::new(), Default::default()); @@ -583,7 +590,10 @@ mod tests { let id = app.run("text.create", json!({"x": 20, "y": 50, "text": "First\nSecond"})).unwrap()["id"].clone(); app.run( "text.setFormat", - json!({"hyphenate": true, "wordsLongerThan": 8, "afterFirst": 2, "beforeLast": 4, "hyphenLimit": 2, "hyphenationZone": 18, "hyphenateCapitalized": false}), + json!({ + "hyphenate": true, "wordsLongerThan": 8, "afterFirst": 2, "beforeLast": 4, "hyphenLimit": 2, "hyphenationZone": 18, "hyphenateCapitalized": false, + "romanHangingPunctuation": true + }), ) .unwrap(); let paras = |app: &VectorcraftApp| { @@ -594,12 +604,14 @@ mod tests { for para in paras(&app) { assert!(para.hyphenate); assert_ne!(para.hyphenation, HyphenationOptions::default()); + assert!(para.roman_hanging); } reset_panel(&mut app); for para in paras(&app) { assert!(!para.hyphenate); assert_eq!(para.hyphenation, HyphenationOptions::default()); assert_eq!(serde_json::to_value(¶).unwrap().get("hyphenation"), None, "saves no hyphenation options"); + assert!(!para.roman_hanging, "Roman Hanging Punctuation off"); } } } diff --git a/docs/gaps.md b/docs/gaps.md index 6b5507ecb6..7471a5ed4b 100644 --- a/docs/gaps.md +++ b/docs/gaps.md @@ -187,7 +187,8 @@ from G14 and the budget run of G15: **~170–270 h** one agent, ~50–80 h wall - **Improved:** mixed paragraph alignments leave the existing Paragraph/Properties alignment buttons unselected; choosing an alignment still uses the range-aware command. Headless regressions, full integration CI and visual review pass. Other mixed paragraph fields remain; estimate unchanged. - **Improved (#1258):** full font names (name ID 4) resolve the face instead of falling back, and Missing Fonts searches recognize the same aliases. Synthetic regressions cover loaded/cataloged fonts, localized names, real-family precedence and variable default faces. Windows font-service activation still needs reporter QA; estimate unchanged. -- **Missing:** hyphenation and justification options, Optical Margin Alignment (type core); CJK vertical +- **Done:** Paragraph panel menu › Roman Hanging Punctuation (#2756), per paragraph; estimate unchanged. +- **Missing:** Justification… options (#2755, type core); CJK vertical composition (ruby, mojikumi sets and dialog, kinsoku settings #633, manual tate-chu-yoko), Middle Eastern features beyond bidi and digit types (Character Direction, kashidas, composers), variable font axes, spell check with an open dictionary, Touch Type, Retype, Snap to Glyph; optional preservation of font sizes during group scaling (#1034 enhancement). diff --git a/docs/mcp.md b/docs/mcp.md index c49b9e6e3d..3341457722 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -3531,6 +3531,22 @@ New type and documents from before it have it off, and it is saved only when on. {"name":"run_command","arguments":{"command":"type.opticalMarginAlignment","params":{"on":true}}} ``` +## Roman Hanging Punctuation + +`text.setFormat {romanHangingPunctuation: bool}` (Paragraph panel menu › Roman Hanging Punctuation) turns it on or off +for the paragraphs of the selected type (or `ids`, or the paragraphs a `start` / `end` range touches). In those +paragraphs the punctuation Optical Margin Alignment hangs hangs outside the margin by the same amounts (quotation marks, +hyphens, full stops and commas wholly; asterisks, tildes, ellipses, en and em dashes, colons and semicolons by half), +on the same sides (left-aligned lines at their left, right-aligned at their right, centered and justified at both), and +letters don't hang. With Optical Margin Alignment on as well, the letters hang too. East Asian punctuation hangs only +through burasagari; type on a path and right-to-left paragraphs are laid out as before. Off by default, saved with the +paragraph (`roman_hanging` in `para`) only when on, carried by paragraph styles, and turned off by Reset Panel. One undo +step. The menu item is checked while the paragraph the Paragraph panel shows has it on. + +```json +{"name":"run_command","arguments":{"command":"text.setFormat","params":{"romanHangingPunctuation":true}}} +``` + ## Small Caps, Superscript and Subscript `text.setFormat {smallCaps, position}` (the selected type, or `ids`) and `text.setRangeStyle {id, start, end, smallCaps, position}` (a range) set what the Character panel's Small Caps, Superscript and Subscript buttons and menu items set. diff --git a/docs/type-parity.md b/docs/type-parity.md index 07bf72659d..abab77ad5e 100644 --- a/docs/type-parity.md +++ b/docs/type-parity.md @@ -35,6 +35,7 @@ against Illustrator's public documentation; **estimated** unless noted. | Colour fonts (OpenType SVG / COLR) | partial | | | Every-line and Single-line composers | done | tuned by eye, never compared side by side | | Optical Margin Alignment | done | Type › Optical Margin Alignment, `type.opticalMarginAlignment`: per type object, in point and area type of left-to-right paragraphs; type on a path and right-to-left paragraphs do not hang | +| Roman Hanging Punctuation | done | Paragraph panel menu › Roman Hanging Punctuation, `text.setFormat {romanHangingPunctuation}` (#2756): per paragraph, Optical Margin Alignment's punctuation and amounts without the letters; paragraph styles carry it. Evidence: `tests::roman_hanging_punctuation_hangs_punctuation_but_not_letters`, `typecmd::area_tests::roman_hanging_punctuation_is_set_per_paragraph_and_saved_only_when_on` | | Hyphenation… and Justification… options | partial | Hyphenation… (`ui.hyphenation`, `text.setFormat`) sets each paragraph's Words Longer Than, After First, Before Last, Hyphen Limit, Hyphenation Zone (Single-line Composer only) and Hyphenate Capitalized Words, and paragraph styles carry them (#2310); Justification… missing (menu stub) | | Tab stops and leaders; Tabs panel | partial | Tabs panel and stops with leaders in the model (`text.tabs.set`); a stop drags from where the press landed (#1458); leaders fill the tab's gap, repeated on a grid so they line up from line to line (#1877) | | Hidden characters (Show Hidden Characters) | done | `type.hiddenCharacters` | @@ -61,6 +62,7 @@ Character Styles menu New/Redefine and footer New capture the first selected cha | Date | Change | Summary | |---|---|---| +| 2026-10-17 | minor | Roman Hanging Punctuation (#2756): per-paragraph hanging of Latin punctuation outside the margin; scores unchanged | | 2026-10-17 | minor | A click on area type's red out port loads the Selection tool with the overflow text; the next click threads it into a closed path or a new frame of the same shape there, a drag into a new rectangle (`text.thread.add`, #2572 in part). The out port moved up the frame's right side, clear of the corner handle. Scores and hours unchanged. | | 2026-10-16 | minor | Native font-family labels fall back from English-only typographic names to localized legacy names (#2208). English labels and native typographic precedence are preserved; synthetic loaded/catalog tests. Scores and estimates unchanged. | | 2026-10-16 | minor | Align Stroke on live type: the characters' stroke goes inside or outside the glyphs without creating outlines, for every run or a range; kept in the native file and in canvas, PDF, EPS and SVG output (#2294); beyond Illustrator, scores and hours unchanged | From 2a5dfa6a94b76c57ed6574a15ca7c583fbf15b58 Mon Sep 17 00:00:00 2001 From: Guillem Hermida Date: Sat, 17 Oct 2026 15:52:57 +0200 Subject: [PATCH 008/545] Fix #1876: Artboard Options has X and Y with a reference point Artboard Options showed Name, Width and Height only: the generic form hides x and y, which in the shape dialogs are the click position. The artboard's position could be dragged but not typed. The dialog now draws its own rows after the form's, in the same grid: the reference point locator the Transform panel, the Control bar and Properties share, then X and Y. They show where the reference point lies, counted from the ruler origin (#1212), as the Transform panel and the Control bar show an artboard's position. A typed X or Y moves the artboard so that its reference point lands there, and a new Width or Height keeps the reference point in place. The fields still hold the top-left corner in document points, so OK runs artboard.setProps as before, in one undo step. The shape dialogs keep their x and y hidden. form::grid_then lets a dialog add rows to the generic grid. --- .../ui-egui/src/dialogs/artboard_options.rs | 70 +++++++++- crates/ui-egui/src/dialogs/form.rs | 9 +- crates/ui-egui/src/dialogs/tests.rs | 121 +++++++++++++++++- docs/mcp.md | 4 +- docs/target-app-parity.md | 4 +- docs/ui-parity.md | 4 +- 6 files changed, 203 insertions(+), 9 deletions(-) diff --git a/crates/ui-egui/src/dialogs/artboard_options.rs b/crates/ui-egui/src/dialogs/artboard_options.rs index 6a340b9e37..324ba88568 100644 --- a/crates/ui-egui/src/dialogs/artboard_options.rs +++ b/crates/ui-egui/src/dialogs/artboard_options.rs @@ -1,13 +1,77 @@ //! Artboard Options (double-click with the Artboard tool, double-click the tool, or the Artboards -//! panel's options icon or menu): the artboard's fields, sizes parsed with units. +//! panel's options icon or menu): the artboard's fields, sizes parsed with units, and its position +//! from a reference point. use serde_json::{Value, json}; +use vectorcraft_doc::Unit; +use vectorcraft_geom::{Point, Rect}; -use super::{DialogSpec, run_and_close}; +use super::{DialogSpec, form, run_and_close}; use crate::VectorcraftApp; +use crate::panels::transform::{artboard_rect, reference_index, reference_locator}; use crate::state::Dialog; -pub(super) const SPEC: DialogSpec = DialogSpec { heading: |_| tl!("Artboard Options").into(), confirm, ..DialogSpec::FORM }; +pub(super) const SPEC: DialogSpec = DialogSpec { heading: |_| tl!("Artboard Options").into(), body, confirm, ..DialogSpec::FORM }; + +/// Where the fields put the artboard: `x` and `y` are its top-left corner in document points, as +/// `artboard.setProps` and `artboard.new` take them. +fn placed(d: &Dialog) -> Rect { + let (x, y) = (d.f64("x", 0.0), d.f64("y", 0.0)); + Rect::new(x, y, x + d.f64("width", 0.0), y + d.f64("height", 0.0)) +} + +/// The form's Name, Width and Height, then X and Y in the same grid, the reference point locator +/// before X (#1876). The locator is the one the Transform panel, the Control bar and Properties +/// share, and X and Y are where its point lies on the rulers, counted from the ruler origin (#1212), +/// as the Transform panel and the Control bar show an artboard's. A new Width or Height keeps the +/// reference point where it was, as their sizes do. +fn body(app: &mut VectorcraftApp, ui: &mut egui::Ui, d: &mut Dialog) -> bool { + let (unit, origin, refi) = (app.session.general_unit(), app.ruler_origin(), reference_index(ui)); + let (was, w0, h0) = (placed(d), d.f64("width", 0.0), d.f64("height", 0.0)); + form::grid_then(ui, d, unit, |ui, d| { + let (w, h) = (d.f64("width", 0.0), d.f64("height", 0.0)); + let n = artboard_rect(was, refi, None, None, Some(w), Some(h), false); + // Only the side that changed moves, so an untouched coordinate stays exactly as it was. + for (key, changed, at) in [("x", w != w0, n.x0), ("y", h != h0, n.y0)] { + if changed { + d.fields.insert(key.into(), json!(at)); + } + } + position_rows(ui, d, refi, unit, origin); + }); + false +} + +/// The X and Y rows: where reference point `refi` lies, counted from the ruler origin `origin`, +/// with the locator before X's label. A typed X or Y moves the artboard so that its reference point +/// lands there. +fn position_rows(ui: &mut egui::Ui, d: &mut Dialog, refi: usize, unit: Unit, origin: Point) { + let r = placed(d); + let rp = vectorcraft_geom::reference_point(r, refi); + let mut indent = 0.0; + for (key, label, at, zero) in [("x", "X:", rp.x, origin.x), ("y", "Y:", rp.y, origin.y)] { + ui.horizontal(|ui| { + // Y's label lines up with X's, after the locator. + if key == "x" { + let left = ui.cursor().min.x; + reference_locator(ui, refi); + indent = ui.min_rect().right() - left; + } else { + ui.add_space(indent); + } + form::row_label(ui, label); + }); + if let Some(v) = crate::widgets::num_field(ui, ("dlg-ab-xy", key), Some(at - zero), unit, form::FIELD_W) { + let n = if key == "x" { + artboard_rect(r, refi, Some(v + zero), None, None, None, false).x0 + } else { + artboard_rect(r, refi, None, Some(v + zero), None, None, false).y0 + }; + d.fields.insert(key.into(), json!(n)); + } + ui.end_row(); + } +} /// The dialog kind of Artboard Options. pub const KIND: &str = "artboardOptions"; diff --git a/crates/ui-egui/src/dialogs/form.rs b/crates/ui-egui/src/dialogs/form.rs index db08ca6360..842125359a 100644 --- a/crates/ui-egui/src/dialogs/form.rs +++ b/crates/ui-egui/src/dialogs/form.rs @@ -8,7 +8,7 @@ use crate::state::Dialog; use crate::theme::Tokens; /// Width of a dialog's value fields ([`text`] and [`length`], frame included). -const FIELD_W: f32 = 132.0; +pub(super) const FIELD_W: f32 = 132.0; /// A labelled text field bound to `d.fields[key]` (one grid row). pub(super) fn field(ui: &mut egui::Ui, d: &mut Dialog, key: &str, label: &str) { @@ -193,6 +193,12 @@ fn dropdown(ui: &mut egui::Ui, d: &mut Dialog, key: &str, width: f32, options: & /// hidden) in the kind's [`order`], the distances in `unit`, the [`choices`] as dropdowns and the /// [`skew_ends`] fields as sliders. pub(super) fn grid(ui: &mut egui::Ui, d: &mut Dialog, unit: Unit) { + grid_then(ui, d, unit, |_, _| {}); +} + +/// [`grid`], then the rows `more` draws in the same grid, so that their labels and fields line up +/// with the generic ones. +pub(super) fn grid_then(ui: &mut egui::Ui, d: &mut Dialog, unit: Unit, more: impl FnOnce(&mut egui::Ui, &mut Dialog)) { let rail = Tokens::get(ui.ctx()).input_border; let (lengths, first) = (lengths(&d.kind), order(&d.kind)); let mut keys: Vec = d @@ -237,6 +243,7 @@ pub(super) fn grid(ui: &mut egui::Ui, d: &mut Dialog, unit: Unit) { ui.end_row(); } } + more(ui, d); }); } diff --git a/crates/ui-egui/src/dialogs/tests.rs b/crates/ui-egui/src/dialogs/tests.rs index ec4efb4d93..2dc11289f6 100644 --- a/crates/ui-egui/src/dialogs/tests.rs +++ b/crates/ui-egui/src/dialogs/tests.rs @@ -1,6 +1,7 @@ //! The dialog registry and the shared frame, drawn headlessly. use serde_json::json; +use vectorcraft_doc::Unit; use vectorcraft_engine::Session; use super::*; @@ -1018,6 +1019,111 @@ fn artboard_options_position_follows_the_tool_option_with_another_tool() { } } +/// The strings a frame painted, each with its rectangle. +fn painted(out: &egui::FullOutput) -> Vec<(String, egui::Rect)> { + fn walk(s: &egui::Shape, v: &mut Vec<(String, egui::Rect)>) { + match s { + egui::Shape::Text(t) => v.push((t.galley.text().to_string(), egui::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 +} + +/// Where to click in the field after the label `label` among the `shown` strings. +fn field_after(shown: &[(String, egui::Rect)], label: &str) -> egui::Pos2 { + let r = shown.iter().find(|(t, _)| t == label).unwrap_or_else(|| panic!("no {label:?} in {shown:?}")).1; + egui::pos2(r.right() + 40.0, r.center().y) +} + +/// A 400 × 300 pt artboard at the page's origin with the ruler origin at (120, 50), and its +/// Artboard Options open. +fn artboard_options_from_a_ruler_origin() -> VectorcraftApp { + let mut app = VectorcraftApp::new(Session::new(), Default::default()); + app.run("file.new", json!({"width": 400, "height": 300})).unwrap(); + app.run("document.setRulerOrigin", json!({"x": 120, "y": 50})).unwrap(); + assert_eq!(app.ruler_origin(), vectorcraft_geom::Point::new(120.0, 50.0)); + app.run("tool.options", json!({"tool": "artboard"})).unwrap(); + app +} + +/// #1876: Artboard Options has X and Y beside the reference point locator, counted from the ruler +/// origin (#1212) as the Transform panel's are. The artboard moves to a typed X and Y, its reference +/// point landing there, in one undo step. The shape dialogs still show no X and Y (theirs are where +/// the click was). +#[test] +fn artboard_options_x_and_y_count_from_the_ruler_origin_at_the_reference_point() { + let mut app = artboard_options_from_a_ruler_origin(); + let before = app.session.doc().unwrap().doc.clone(); + let undo = app.session.doc().unwrap().history.undo.len(); + let mut f = Frames::new(); + let has = |shown: &[(String, egui::Rect)], s: &str| shown.iter().any(|(t, _)| t == s); + // The center by default: (200, 150) on the page, 80 and 100 from the ruler origin. + let shown = f.texts(&mut app); + for s in ["X:".to_string(), "Y:".to_string(), Unit::Points.format(80.0), Unit::Points.format(100.0)] { + assert!(has(&shown, &s), "{s} in {shown:?}"); + } + // The bottom-right corner: (400, 300) on the page, 280 and 250 from the ruler origin. + let corner = f.control(&mut app, "Bottom Right", egui::accesskit::Role::RadioButton); + f.press(&mut app, corner, true); + f.press(&mut app, corner, false); + let shown = f.texts(&mut app); + for v in [280.0, 250.0] { + assert!(has(&shown, &Unit::Points.format(v)), "{v} in {shown:?}"); + } + // Typing X 300 and Y 0 puts that corner at (420, 50) on the page. + for (label, typed) in [("X:", "300"), ("Y:", "0")] { + let at = field_after(&shown, label); + f.press(&mut app, at, true); + f.press(&mut app, at, false); + f.run(&mut app, vec![egui::Event::Text(typed.into())]); + } + f.key(&mut app, egui::Key::Enter, egui::Modifiers::NONE); + assert!(app.ui.dialog.is_none(), "Enter applies the dialog"); + assert_eq!(app.session.doc().unwrap().doc.artboards[0].rect, vectorcraft_geom::Rect::new(20.0, -250.0, 420.0, 50.0)); + assert_eq!(app.session.doc().unwrap().history.undo.len(), undo + 1, "one undo step"); + app.run("edit.undo", json!({})).unwrap(); + assert_eq!(app.session.doc().unwrap().doc, before); + open(&mut app, "rectangle", json!({"x": 10, "y": 20, "width": 30, "height": 40})); + let shown = f.texts(&mut app); + assert!(has(&shown, "Width:") && !has(&shown, "X:") && !has(&shown, "Y:"), "{shown:?}"); +} + +/// #1876: a new Width or Height in Artboard Options keeps the reference point where it was, as the +/// Transform panel's does: about the center by default, so X and Y still read the same, and from +/// the top-left corner with that reference point. +#[test] +fn artboard_options_size_keeps_the_reference_point() { + for (point, want) in + [(None, vectorcraft_geom::Rect::new(-50.0, 0.0, 450.0, 300.0)), (Some("Top Left"), vectorcraft_geom::Rect::new(0.0, 0.0, 500.0, 300.0))] + { + let mut app = artboard_options_from_a_ruler_origin(); + let mut f = Frames::new(); + if let Some(point) = point { + let at = f.control(&mut app, point, egui::accesskit::Role::RadioButton); + f.press(&mut app, at, true); + f.press(&mut app, at, false); + } + let shown = f.texts(&mut app); + let (width, height) = (field_after(&shown, "Width:"), field_after(&shown, "Height:")); + f.press(&mut app, width, true); + f.press(&mut app, width, false); + f.run(&mut app, vec![egui::Event::Text("500".into())]); + // A click on Height ends the Width field's editing; X reads as before. + f.press(&mut app, height, true); + f.press(&mut app, height, false); + let shown = f.texts(&mut app); + let x = Unit::Points.format(if point.is_some() { -120.0 } else { 80.0 }); + assert!(shown.iter().any(|(t, _)| *t == x), "{x} in {shown:?}"); + f.key(&mut app, egui::Key::Enter, egui::Modifiers::NONE); + assert!(app.ui.dialog.is_none(), "Enter applies the dialog"); + assert_eq!(app.session.doc().unwrap().doc.artboards[0].rect, want, "{point:?}"); + } +} + /// Zig Zag's dialog has Size and Ridges per segment sliders, and Relative / Absolute and Smooth / /// Corner as radio buttons, not dropdowns (#1133). #[test] @@ -1058,13 +1164,24 @@ impl Frames { out } + /// The strings the dialog layer paints once it has settled, each with its rectangle. + fn texts(&mut self, app: &mut VectorcraftApp) -> Vec<(String, egui::Rect)> { + self.run(app, vec![]); + painted(&self.run(app, vec![])) + } + /// The center of the button that screen readers name `label`. fn button(&mut self, app: &mut VectorcraftApp, label: &str) -> egui::Pos2 { + self.control(app, label, egui::accesskit::Role::Button) + } + + /// The center of the control of `role` that screen readers name `label`. + fn control(&mut self, app: &mut VectorcraftApp, label: &str, role: egui::accesskit::Role) -> 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 node = nodes.iter().find(|(_, n)| n.label() == Some(label) && n.role() == egui::accesskit::Role::Button); - let b = node.unwrap_or_else(|| panic!("no button named {label:?}")).1.bounds().expect("bounds"); + let node = nodes.iter().find(|(_, n)| n.label() == Some(label) && n.role() == role); + let b = node.unwrap_or_else(|| panic!("no {role:?} named {label:?}")).1.bounds().expect("bounds"); egui::pos2((b.x0 + b.x1) as f32 * 0.5, (b.y0 + b.y1) as f32 * 0.5) } diff --git a/docs/mcp.md b/docs/mcp.md index 3341457722..62feba86e3 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -3858,7 +3858,9 @@ desktop app. The Flare tool's are its Flare Tool Options (dialog `flareOptions`) `direction` (°), and `raysOn` and `ringsOn` (the Rays and Rings checkboxes; off, the flare has none). OK keeps them (`tool.setOption {tool: "flare", values}`) and the next flare dragged out uses them; a click with the tool opens the same dialog, and its OK also draws a flare there. The Artboard tool's are the active artboard's Artboard Options -(dialog `artboardOptions`; the Artboard tool's active artboard while it is in use, else the window's), a graph tool's +(dialog `artboardOptions`; the Artboard tool's active artboard while it is in use, else the window's; its `x` and `y` +are the artboard's top-left corner in document points, while the dialog shows X and Y at the reference point the +Transform panel uses, counted from the ruler origin), a graph tool's the selected graph's Graph Type (an error without one), a Symbolism tool's the Symbolism Tools Options (dialog `symbolismOptions`: `diameter` in points, `intensity` and `density` 1–10, one brush for the eight tools) and the Magic Wand tool's its panel. `ui.newArtboard` (Alt-click on the Artboards panel's New Artboard) opens Artboard Options diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 70a2128140..3a5c64db7f 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-10-17 · **Change:** minor (Image Trace: Auto Color keeps rare but distinct colours; Image Trace: large images trace with a warning; anchor limit raised to 8,000,000; Image Trace: Raster::new returns an error for a buffer of the wrong length; M12 maximal-disc graph pruning and junction merging measured; M12 crop EDT and Guo–Hall thinning measured; M12 centre-lines baseline measured; scores and hours unchanged; installed plug-ins stay installed after a restart, #2541; Group Selection picks and moves one path of a compound path, #2441 in part; the Move dialog opens on the last move and its last checkboxes; Image Trace: a higher Paths never gives fewer segments on collapsed loops; Image Trace: the notch rule reads only its own piece; Image Trace: an edge's sub-pixel shift is the same from either side; Image Trace Flat Logo traces line art on white paper instead of a blank result; score and hours unchanged; Image Trace: a simpler contour walk with no precomputed direction table; transparency grid visibility saved in native documents, #1968; MCP cancellation, progress and busy answers during long exports, #2165, #2171, #2172; EPS editing data: legacy mesh corners, vector opacity masks and compound member paint retained; raster page comparison filters minification without relaxing limits; scores and hours unchanged; native family-name fallback from English-only typographic names, #2208; scores unchanged; batch exporting, #1935; G2: Effect › Sketch › Halftone Pattern; Photoshop filters 30/57, 27 remaining (22–38 h); G5: Symbol Options Export Type (Graphic / Movie Clip); Localization: Brazilian Portuguese complete under the tests, #1914, 71% → 74%; G6 image variables: Automation ~60% → ~62% / detail ~65% → ~68%, hours lowered; Warp Options controls verified by focused checks and original-image review; estimates unchanged; G11: Asset Export Art Optimized seam (#983 / #1037) and supersampled thumbs; Export for Screens 85% → 90%; existing-guide Escape cancellation validated 2026-10-14; scores and hours unchanged; open-path anchor Delete keeps surviving runs separate; estimates unchanged; PDF.R1: shared PDF reader with windowed content scanning and explicit incomplete-content errors; scores and estimates unchanged; PDF.W1: guarded shared PDF writer; output behavior, scores and estimates unchanged; Artboard tab-switch follow-up historically validated on `a0671777`; scores and hours unchanged; Artboard clean active-tab close/Delete follow-up validated 2026-10-15; later 2026-10-14 merges: anchor X/Y/W/H, #1824; Snap to Grid over Snap to Pixel, #1816; toolbar and All Tools, #1751; Actions panel selection, #1629 in part; redo during a drag, #1719; preferences written on OK, #1747; type in symbols after reopening, #1738; macOS save sheets, #1855, the Format menu withdrawn; stroke outlines shared, #1667; untrusted files, #1852, #1862–#1873; failed-save dialog, #1685; effects, #1864, Dim Images, #1683; duplicated rows of the 2026-10-05 table noted for the owner; scores unchanged; Image Trace: Shapes rework, stroke caps, enhanced presets, gradients over noise, measured in `image-trace-quality.md`, score unchanged; verified PngSuite downloads, #1729; synthetic control-input budgets, #1709; 2026-10-14 merges: anchor Align and Distribute, #1636; Direct Selection and Delete fixes, #1674, #1666, #1743; Escape while typing, #1686; Pen clicks, #1663; Expand on repeats, #1756; Roughen and Scribble, #1643, #1648; file and input hardening, #1776–#1783, #1786, #1807; MCP limits and envelope, #1727, #1728; Image Trace levelling and Flat Logo on scans, #1647, #1657; scores unchanged; later 2026-10-13 merges: SVG import, #1565, #1596, #1568, #1598, #1601; type on a path from PDF and `.ai`, #1585, #1586; ICC tag alignment, #1584; saves, #1620 in part; Warp Arc, #1578; Zig Zag, #1558; Pathfinder strokes, #1570; OpenType features, #1607; intersect Smart Guides, #1602 in part; a guide's position in the Transform panel, #1597 in part, a convenience with no parity claim; scores unchanged; TIFF is available in Export for Screens and Asset Export with shared format settings; scores and hours unchanged; G1/M11: Artboard deletion and history selection normalization; history regressions and full workspace CI pass; scores and hours unchanged; Character styles retain explicit Auto leading, propagate resets and preserve local leading overrides; scores and hours unchanged; Width Point Edit: Shift-double-click enables adjoining adjustment; plain double-click keeps it off; scores and hours unchanged; Units › Identify Objects By (`identifyObjectsBy`) acts on Layers, Variables and Layer Options, #394, scores unchanged; Appearance of Black › Printing / Exporting (`blackOutput`) acts on RGB raster export and Print as Bitmap, #394, scores unchanged; per-corner radius fields with a link toggle, split from #1594; control transport deadlines, #1726; Color panel: the mode picked last comes back after a restart, #1675; Image Trace: shared edges, memory, thin lines, strokes, corners, and the Shapes, Auto Grouping and Gradients options, measured in `image-trace-quality.md`, score unchanged; 2026-10-13 merges: Polish interface, #1498; compact native saves, #1492; PDF and EPS paste as vector art, #1499; import fixes for `.ai`, PDF, EPS and SVG, #1528, #1530, #1531, #1544, #1551, #1553; guide objects, #1534; Join after Average, #1533; Keyboard Shortcuts lists commands outside the menus, #1539; correction: Average and Join with a corner or smooth choice is missing; scores unchanged; late 2026-10-12 merges: type that does not fit its frame is reported, #1471; Tabs panel drags, #1458; template layers in Outline view, #1486; dialog slider rails, #1483; Direct Selection anchor precedence, #1508; print-size images, #1517; 3D on outlined type, #1481; French catalog, #1511; scores unchanged; Split Into Grid options, #1462; Transform Objects and Reflect across an angle, #1448 and #1460; Pathfinder panel on a group, #1450; unknown parameter keys refused, #1442; grayscale TIFFs with alpha, #1466 in part; Localization: Vietnamese catalog added, 63% → 71%, hours 60–100 → 55–90, full readiness unchanged at ~62%; scores and hours unchanged; Image Trace places edges to a fraction of a pixel in every mode, measured in `image-trace-quality.md`, score unchanged; 3D and Materials: Extrude & Bevel, Inflate and Rotate added, 3D ~8% → ~25% (estimated), menu stubs 25 → 22; Affinity text frames too short for their first line show it, #1423; Transform dialogs preview, #1412, and the transform tools and commands act on direct-selected anchors, #1408; `.ai` compound path paint, #1410; strokes wider than their shape, #1396; corner drags hide the bounding box, #1229; scores and hours unchanged; PDF and `.ai` import keep overprint, #1388, scores unchanged; `.ai` editing-data follow-ups: gradient stops, type of objects with an appearance, short area-type frames (#1390, #1391, #1392); dialog keyboard focus on every open (#1382, #1395); art flush with an artboard (#1375); font rescan (#1376); symbol instance redraw cache (#1386); scores and hours unchanged; grid tool options, #1377 in part, scores unchanged; `.ai` placed (linked) files read from the editing data, #1264, scores unchanged; gradient shapes import as paths, #1304; white constant alpha masks, #1286 in part; Live Corners widget click selects its corner, #1239; scores and hours unchanged; custom ruler origin, #1212; Artboard click-to-fit verified for objects, groups, visible bounds, undo and cancellation (#1227); scores and hours unchanged; Pathfinder single-result source names and SVG IDs retained, #1293; Localization: Korean catalog added, 54% → 63%, full readiness unchanged at ~62%; desktop print transport adopts craft-print, Windows 7 fallback retained, scores unchanged; Image Trace: an image over 64 megapixels traces scaled down instead of being refused, scores unchanged; Czech render-site localization follow-up; scores and estimates unchanged; Document Setup: Edit Artboards closes the modal after applying valid settings; pointer-click regressions; scores and hours unchanged; Artboards: Escape exits editing; an active drag cancels first; shortcut-routing regression; scores and hours unchanged; Path operations: Simplify preview/counts and component selection (#1272); scores unchanged; G2: Film Grain added; Photoshop effects 29/57; 28 filters remain; Platforms: RPM runtime capabilities and glibc floor (#1275); scores unchanged; Raster effects: squared-distance texture redraws (#1257); pixels unchanged; scores and hours unchanged; Drawing: Curvature point display improved (#1236, in part); scores unchanged; Type core: full-name font matching (#1258), scores and hours unchanged; Selection: no-op anchor Align preserves history and saved state (#1180 follow-up); scores unchanged; UI chrome: Eyedropper cursor and precise-setting regressions (#1269); scores unchanged; Colour: Eyedropper reads visible locked and outside-isolation sources (#1251); scores and hours unchanged; Selection: segment click/Delete preserves neighboring edges (#1278); scores unchanged; Colour: unpainted zero-width strokes regain 1 pt when painted (#1253); scores and hours unchanged; graphs: designs and markers, data, Graph Type and label options; UI chrome: native macOS save Format menu, #866, scores unchanged; compound paths inherit the backmost appearance and member fill-rule edits reach their owner, #1197; scores unchanged; Type core: Middle Eastern digit types done, Character panel menu › Digits; PDF export warns when the pixel cap lowers raster-effect resolution; Drawing tools: Live Corners round corners between curved sides, #1144; Type advanced: proportional vertical metrics (`vpal`) done, #966; Shape Builder: #893 fixed, merged regions of crossing lines no longer keep seams; scores unchanged while #937 is open; #1034: document-point character controls after object/group scaling; full readiness recomputed as the standard's additive weighted sum, ~62%; per-audience hours; essentials-user score ~75% added; ready-for-real-work re-examined: 50% → 55%, mainstream 65% added; earlier the same day: full re-measure against Illustrator 2026 30.x; merged the ROADMAP's parity estimate, honest assessment and "Shipped so far" into this file; SVG knockout groups of opaque art export without masks; Image Trace: colour presets no longer shatter noisy flat art and photos trace into smooth tones, measured in `image-trace-quality.md`, score unchanged; Split Into Grid options, #1462; Transform Objects and Reflect across an angle, #1448 and #1460; Pathfinder panel on a group, #1450; unknown parameter keys refused, #1442; grayscale TIFFs with alpha, #1466 in part; scores and hours unchanged; Image Trace places edges to a fraction of a pixel in every mode, measured in `image-trace-quality.md`, score unchanged; 3D and Materials: Extrude & Bevel, Inflate and Rotate added, 3D ~8% → ~25% (estimated), menu stubs 25 → 22; Affinity text frames too short for their first line show it, #1423; Transform dialogs preview, #1412, and the transform tools and commands act on direct-selected anchors, #1408; `.ai` compound path paint, #1410; strokes wider than their shape, #1396; corner drags hide the bounding box, #1229; scores and hours unchanged; PDF and `.ai` import keep overprint, #1388, scores unchanged; `.ai` editing-data follow-ups: gradient stops, type of objects with an appearance, short area-type frames (#1390, #1391, #1392); dialog keyboard focus on every open (#1382, #1395); art flush with an artboard (#1375); font rescan (#1376); symbol instance redraw cache (#1386); scores and hours unchanged; grid tool options, #1377 in part, scores unchanged; `.ai` placed (linked) files read from the editing data, #1264, scores unchanged; gradient shapes import as paths, #1304; white constant alpha masks, #1286 in part; Live Corners widget click selects its corner, #1239; scores and hours unchanged; custom ruler origin, #1212; Artboard click-to-fit verified for objects, groups, visible bounds, undo and cancellation (#1227); scores and hours unchanged; Pathfinder single-result source names and SVG IDs retained, #1293; Localization: Korean catalog added, 54% → 63%, full readiness unchanged at ~62%; desktop print transport adopts craft-print, Windows 7 fallback retained, scores unchanged; Image Trace: an image over 64 megapixels traces scaled down instead of being refused, scores unchanged; Czech render-site localization follow-up; scores and estimates unchanged; Document Setup: Edit Artboards closes the modal after applying valid settings; pointer-click regressions; scores and hours unchanged; Artboards: Escape exits editing; an active drag cancels first; shortcut-routing regression; scores and hours unchanged; Path operations: Simplify preview/counts and component selection (#1272); scores unchanged; G2: Film Grain added; Photoshop effects 29/57; 28 filters remain; Platforms: RPM runtime capabilities and glibc floor (#1275); scores unchanged; Raster effects: squared-distance texture redraws (#1257); pixels unchanged; scores and hours unchanged; Drawing: Curvature point display improved (#1236, in part); scores unchanged; Type core: full-name font matching (#1258), scores and hours unchanged; Selection: no-op anchor Align preserves history and saved state (#1180 follow-up); scores unchanged; UI chrome: Eyedropper cursor and precise-setting regressions (#1269); scores unchanged; Colour: Eyedropper reads visible locked and outside-isolation sources (#1251); scores and hours unchanged; Selection: segment click/Delete preserves neighboring edges (#1278); scores unchanged; Colour: unpainted zero-width strokes regain 1 pt when painted (#1253); scores and hours unchanged; graphs: designs and markers, data, Graph Type and label options; UI chrome: native macOS save Format menu, #866, scores unchanged; compound paths inherit the backmost appearance and member fill-rule edits reach their owner, #1197; scores unchanged; Type core: Middle Eastern digit types done, Character panel menu › Digits; PDF export warns when the pixel cap lowers raster-effect resolution; Drawing tools: Live Corners round corners between curved sides, #1144; Type advanced: proportional vertical metrics (`vpal`) done, #966; Shape Builder: #893 fixed, merged regions of crossing lines no longer keep seams; scores unchanged while #937 is open; #1034: document-point character controls after object/group scaling; full readiness recomputed as the standard's additive weighted sum, ~62%; per-audience hours; essentials-user score ~75% added; ready-for-real-work re-examined: 50% → 55%, mainstream 65% added; earlier the same day: full re-measure against Illustrator 2026 30.x; merged the ROADMAP's parity estimate, honest assessment and "Shipped so far" into this file; SVG knockout groups of opaque art export without masks; MCP `add_text` exposes the existing `vertical` option for point, area and path type; horizontal remains the default; scores and hours unchanged; Vertical fullwidth question and exclamation marks keep their nominal glyph upright when the font has no vertical alternate; scores and hours unchanged.; Curvature curve geometry, #1236 in part; Width-point finite-arithmetic follow-up validated; scores and hours unchanged; Image Trace adjustment discovery; File interop: legacy `.ai` of version 7 saved with type as text, hidden objects kept and an artboard picker, #868, scores unchanged; Revolve: automatic smooth shading and default-on Cap with continuous rims; PDF.R1: shared PDF reader with windowed content scanning and explicit incomplete-content errors; scores and estimates unchanged; PDF.W1: guarded shared PDF writer; output behavior, scores and estimates unchanged; later 2026-10-14 merges: anchor X/Y/W/H, #1824; Snap to Grid over Snap to Pixel, #1816; toolbar and All Tools, #1751; Actions panel selection, #1629 in part; redo during a drag, #1719; preferences written on OK, #1747; type in symbols after reopening, #1738; macOS save sheets, #1855, the Format menu withdrawn; stroke outlines shared, #1667; untrusted files, #1852, #1862–#1873; failed-save dialog, #1685; effects, #1864, Dim Images, #1683; duplicated rows of the 2026-10-05 table noted for the owner; scores unchanged; Image Trace: Shapes rework, stroke caps, enhanced presets, gradients over noise, measured in `image-trace-quality.md`, score unchanged; verified PngSuite downloads, #1729; synthetic control-input budgets, #1709; 2026-10-14 merges: anchor Align and Distribute, #1636; Direct Selection and Delete fixes, #1674, #1666, #1743; Escape while typing, #1686; Pen clicks, #1663; Expand on repeats, #1756; Roughen and Scribble, #1643, #1648; file and input hardening, #1776–#1783, #1786, #1807; MCP limits and envelope, #1727, #1728; Image Trace levelling and Flat Logo on scans, #1647, #1657; scores unchanged; later 2026-10-13 merges: SVG import, #1565, #1596, #1568, #1598, #1601; type on a path from PDF and `.ai`, #1585, #1586; ICC tag alignment, #1584; saves, #1620 in part; Warp Arc, #1578; Zig Zag, #1558; Pathfinder strokes, #1570; OpenType features, #1607; intersect Smart Guides, #1602 in part; a guide's position in the Transform panel, #1597 in part, a convenience with no parity claim; scores unchanged; TIFF is available in Export for Screens and Asset Export with shared format settings; scores and hours unchanged; G1/M11: Artboard deletion and history selection normalization; history regressions and full workspace CI pass; scores and hours unchanged; Character styles retain explicit Auto leading, propagate resets and preserve local leading overrides; scores and hours unchanged; Width Point Edit: Shift-double-click enables adjoining adjustment; plain double-click keeps it off; scores and hours unchanged; Units › Identify Objects By (`identifyObjectsBy`) acts on Layers, Variables and Layer Options, #394, scores unchanged; Appearance of Black › Printing / Exporting (`blackOutput`) acts on RGB raster export and Print as Bitmap, #394, scores unchanged; per-corner radius fields with a link toggle, split from #1594; control transport deadlines, #1726; Color panel: the mode picked last comes back after a restart, #1675; Image Trace: shared edges, memory, thin lines, strokes, corners, and the Shapes, Auto Grouping and Gradients options, measured in `image-trace-quality.md`, score unchanged; 2026-10-13 merges: Polish interface, #1498; compact native saves, #1492; PDF and EPS paste as vector art, #1499; import fixes for `.ai`, PDF, EPS and SVG, #1528, #1530, #1531, #1544, #1551, #1553; guide objects, #1534; Join after Average, #1533; Keyboard Shortcuts lists commands outside the menus, #1539; correction: Average and Join with a corner or smooth choice is missing; scores unchanged; late 2026-10-12 merges: type that does not fit its frame is reported, #1471; Tabs panel drags, #1458; template layers in Outline view, #1486; dialog slider rails, #1483; Direct Selection anchor precedence, #1508; print-size images, #1517; 3D on outlined type, #1481; French catalog, #1511; scores unchanged; Split Into Grid options, #1462; Transform Objects and Reflect across an angle, #1448 and #1460; Pathfinder panel on a group, #1450; unknown parameter keys refused, #1442; grayscale TIFFs with alpha, #1466 in part; Localization: Vietnamese catalog added, 63% → 71%, hours 60–100 → 55–90, full readiness unchanged at ~62%; scores and hours unchanged; Image Trace places edges to a fraction of a pixel in every mode, measured in `image-trace-quality.md`, score unchanged; 3D and Materials: Extrude & Bevel, Inflate and Rotate added, 3D ~8% → ~25% (estimated), menu stubs 25 → 22; Affinity text frames too short for their first line show it, #1423; Transform dialogs preview, #1412, and the transform tools and commands act on direct-selected anchors, #1408; `.ai` compound path paint, #1410; strokes wider than their shape, #1396; corner drags hide the bounding box, #1229; scores and hours unchanged; PDF and `.ai` import keep overprint, #1388, scores unchanged; `.ai` editing-data follow-ups: gradient stops, type of objects with an appearance, short area-type frames (#1390, #1391, #1392); dialog keyboard focus on every open (#1382, #1395); art flush with an artboard (#1375); font rescan (#1376); symbol instance redraw cache (#1386); scores and hours unchanged; grid tool options, #1377 in part, scores unchanged; `.ai` placed (linked) files read from the editing data, #1264, scores unchanged; gradient shapes import as paths, #1304; white constant alpha masks, #1286 in part; Live Corners widget click selects its corner, #1239; scores and hours unchanged; custom ruler origin, #1212; Artboard click-to-fit verified for objects, groups, visible bounds, undo and cancellation (#1227); scores and hours unchanged; Pathfinder single-result source names and SVG IDs retained, #1293; Localization: Korean catalog added, 54% → 63%, full readiness unchanged at ~62%; desktop print transport adopts craft-print, Windows 7 fallback retained, scores unchanged; Image Trace: an image over 64 megapixels traces scaled down instead of being refused, scores unchanged; Czech render-site localization follow-up; scores and estimates unchanged; Document Setup: Edit Artboards closes the modal after applying valid settings; pointer-click regressions; scores and hours unchanged; Artboards: Escape exits editing; an active drag cancels first; shortcut-routing regression; scores and hours unchanged; Path operations: Simplify preview/counts and component selection (#1272); scores unchanged; G2: Film Grain added; Photoshop effects 29/57; 28 filters remain; Platforms: RPM runtime capabilities and glibc floor (#1275); scores unchanged; Raster effects: squared-distance texture redraws (#1257); pixels unchanged; scores and hours unchanged; Drawing: Curvature point display improved (#1236, in part); scores unchanged; Type core: full-name font matching (#1258), scores and hours unchanged; Selection: no-op anchor Align preserves history and saved state (#1180 follow-up); scores unchanged; UI chrome: Eyedropper cursor and precise-setting regressions (#1269); scores unchanged; Colour: Eyedropper reads visible locked and outside-isolation sources (#1251); scores and hours unchanged; Selection: segment click/Delete preserves neighboring edges (#1278); scores unchanged; Colour: unpainted zero-width strokes regain 1 pt when painted (#1253); scores and hours unchanged; graphs: designs and markers, data, Graph Type and label options; UI chrome: native macOS save Format menu, #866, scores unchanged; compound paths inherit the backmost appearance and member fill-rule edits reach their owner, #1197; scores unchanged; Type core: Middle Eastern digit types done, Character panel menu › Digits; PDF export warns when the pixel cap lowers raster-effect resolution; Drawing tools: Live Corners round corners between curved sides, #1144; Type advanced: proportional vertical metrics (`vpal`) done, #966; Shape Builder: #893 fixed, merged regions of crossing lines no longer keep seams; scores unchanged while #937 is open; #1034: document-point character controls after object/group scaling; full readiness recomputed as the standard's additive weighted sum, ~62%; per-audience hours; essentials-user score ~75% added; ready-for-real-work re-examined: 50% → 55%, mainstream 65% added; earlier the same day: full re-measure against Illustrator 2026 30.x; merged the ROADMAP's parity estimate, honest assessment and "Shipped so far" into this file; SVG knockout groups of opaque art export without masks; Image Trace: colour presets no longer shatter noisy flat art and photos trace into smooth tones, measured in `image-trace-quality.md`, score unchanged; Split Into Grid options, #1462; Transform Objects and Reflect across an angle, #1448 and #1460; Pathfinder panel on a group, #1450; unknown parameter keys refused, #1442; grayscale TIFFs with alpha, #1466 in part; scores and hours unchanged; Image Trace places edges to a fraction of a pixel in every mode, measured in `image-trace-quality.md`, score unchanged; 3D and Materials: Extrude & Bevel, Inflate and Rotate added, 3D ~8% → ~25% (estimated), menu stubs 25 → 22; Affinity text frames too short for their first line show it, #1423; Transform dialogs preview, #1412, and the transform tools and commands act on direct-selected anchors, #1408; `.ai` compound path paint, #1410; strokes wider than their shape, #1396; corner drags hide the bounding box, #1229; scores and hours unchanged; PDF and `.ai` import keep overprint, #1388, scores unchanged; `.ai` editing-data follow-ups: gradient stops, type of objects with an appearance, short area-type frames (#1390, #1391, #1392); dialog keyboard focus on every open (#1382, #1395); art flush with an artboard (#1375); font rescan (#1376); symbol instance redraw cache (#1386); scores and hours unchanged; grid tool options, #1377 in part, scores unchanged; `.ai` placed (linked) files read from the editing data, #1264, scores unchanged; gradient shapes import as paths, #1304; white constant alpha masks, #1286 in part; Live Corners widget click selects its corner, #1239; scores and hours unchanged; custom ruler origin, #1212; Artboard click-to-fit verified for objects, groups, visible bounds, undo and cancellation (#1227); scores and hours unchanged; Pathfinder single-result source names and SVG IDs retained, #1293; Localization: Korean catalog added, 54% → 63%, full readiness unchanged at ~62%; desktop print transport adopts craft-print, Windows 7 fallback retained, scores unchanged; Image Trace: an image over 64 megapixels traces scaled down instead of being refused, scores unchanged; Czech render-site localization follow-up; scores and estimates unchanged; Document Setup: Edit Artboards closes the modal after applying valid settings; pointer-click regressions; scores and hours unchanged; Artboards: Escape exits editing; an active drag cancels first; shortcut-routing regression; scores and hours unchanged; Path operations: Simplify preview/counts and component selection (#1272); scores unchanged; G2: Film Grain added; Photoshop effects 29/57; 28 filters remain; Platforms: RPM runtime capabilities and glibc floor (#1275); scores unchanged; Raster effects: squared-distance texture redraws (#1257); pixels unchanged; scores and hours unchanged; Drawing: Curvature point display improved (#1236, in part); scores unchanged; Type core: full-name font matching (#1258), scores and hours unchanged; Selection: no-op anchor Align preserves history and saved state (#1180 follow-up); scores unchanged; UI chrome: Eyedropper cursor and precise-setting regressions (#1269); scores unchanged; Colour: Eyedropper reads visible locked and outside-isolation sources (#1251); scores and hours unchanged; Selection: segment click/Delete preserves neighboring edges (#1278); scores unchanged; Colour: unpainted zero-width strokes regain 1 pt when painted (#1253); scores and hours unchanged; graphs: designs and markers, data, Graph Type and label options; UI chrome: native macOS save Format menu, #866, scores unchanged; compound paths inherit the backmost appearance and member fill-rule edits reach their owner, #1197; scores unchanged; Type core: Middle Eastern digit types done, Character panel menu › Digits; PDF export warns when the pixel cap lowers raster-effect resolution; Drawing tools: Live Corners round corners between curved sides, #1144; Type advanced: proportional vertical metrics (`vpal`) done, #966; Shape Builder: #893 fixed, merged regions of crossing lines no longer keep seams; scores unchanged while #937 is open; #1034: document-point character controls after object/group scaling; full readiness recomputed as the standard's additive weighted sum, ~62%; per-audience hours; essentials-user score ~75% added; ready-for-real-work re-examined: 50% → 55%, mainstream 65% added; earlier the same day: full re-measure against Illustrator 2026 30.x; merged the ROADMAP's parity estimate, honest assessment and "Shipped so far" into this file; SVG knockout groups of opaque art export without masks) · **Target:** Adobe Illustrator 2026 (30.x; public release notes through 30.7, August 2026) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-17 · **Change:** minor (Artboard Options' X and Y with a reference point, #1876; Image Trace: Auto Color keeps rare but distinct colours; Image Trace: large images trace with a warning; anchor limit raised to 8,000,000; Image Trace: Raster::new returns an error for a buffer of the wrong length; M12 maximal-disc graph pruning and junction merging measured; M12 crop EDT and Guo–Hall thinning measured; M12 centre-lines baseline measured; scores and hours unchanged; installed plug-ins stay installed after a restart, #2541; Group Selection picks and moves one path of a compound path, #2441 in part; the Move dialog opens on the last move and its last checkboxes; Image Trace: a higher Paths never gives fewer segments on collapsed loops; Image Trace: the notch rule reads only its own piece; Image Trace: an edge's sub-pixel shift is the same from either side; Image Trace Flat Logo traces line art on white paper instead of a blank result; score and hours unchanged; Image Trace: a simpler contour walk with no precomputed direction table; transparency grid visibility saved in native documents, #1968; MCP cancellation, progress and busy answers during long exports, #2165, #2171, #2172; EPS editing data: legacy mesh corners, vector opacity masks and compound member paint retained; raster page comparison filters minification without relaxing limits; scores and hours unchanged; native family-name fallback from English-only typographic names, #2208; scores unchanged; batch exporting, #1935; G2: Effect › Sketch › Halftone Pattern; Photoshop filters 30/57, 27 remaining (22–38 h); G5: Symbol Options Export Type (Graphic / Movie Clip); Localization: Brazilian Portuguese complete under the tests, #1914, 71% → 74%; G6 image variables: Automation ~60% → ~62% / detail ~65% → ~68%, hours lowered; Warp Options controls verified by focused checks and original-image review; estimates unchanged; G11: Asset Export Art Optimized seam (#983 / #1037) and supersampled thumbs; Export for Screens 85% → 90%; existing-guide Escape cancellation validated 2026-10-14; scores and hours unchanged; open-path anchor Delete keeps surviving runs separate; estimates unchanged; PDF.R1: shared PDF reader with windowed content scanning and explicit incomplete-content errors; scores and estimates unchanged; PDF.W1: guarded shared PDF writer; output behavior, scores and estimates unchanged; Artboard tab-switch follow-up historically validated on `a0671777`; scores and hours unchanged; Artboard clean active-tab close/Delete follow-up validated 2026-10-15; later 2026-10-14 merges: anchor X/Y/W/H, #1824; Snap to Grid over Snap to Pixel, #1816; toolbar and All Tools, #1751; Actions panel selection, #1629 in part; redo during a drag, #1719; preferences written on OK, #1747; type in symbols after reopening, #1738; macOS save sheets, #1855, the Format menu withdrawn; stroke outlines shared, #1667; untrusted files, #1852, #1862–#1873; failed-save dialog, #1685; effects, #1864, Dim Images, #1683; duplicated rows of the 2026-10-05 table noted for the owner; scores unchanged; Image Trace: Shapes rework, stroke caps, enhanced presets, gradients over noise, measured in `image-trace-quality.md`, score unchanged; verified PngSuite downloads, #1729; synthetic control-input budgets, #1709; 2026-10-14 merges: anchor Align and Distribute, #1636; Direct Selection and Delete fixes, #1674, #1666, #1743; Escape while typing, #1686; Pen clicks, #1663; Expand on repeats, #1756; Roughen and Scribble, #1643, #1648; file and input hardening, #1776–#1783, #1786, #1807; MCP limits and envelope, #1727, #1728; Image Trace levelling and Flat Logo on scans, #1647, #1657; scores unchanged; later 2026-10-13 merges: SVG import, #1565, #1596, #1568, #1598, #1601; type on a path from PDF and `.ai`, #1585, #1586; ICC tag alignment, #1584; saves, #1620 in part; Warp Arc, #1578; Zig Zag, #1558; Pathfinder strokes, #1570; OpenType features, #1607; intersect Smart Guides, #1602 in part; a guide's position in the Transform panel, #1597 in part, a convenience with no parity claim; scores unchanged; TIFF is available in Export for Screens and Asset Export with shared format settings; scores and hours unchanged; G1/M11: Artboard deletion and history selection normalization; history regressions and full workspace CI pass; scores and hours unchanged; Character styles retain explicit Auto leading, propagate resets and preserve local leading overrides; scores and hours unchanged; Width Point Edit: Shift-double-click enables adjoining adjustment; plain double-click keeps it off; scores and hours unchanged; Units › Identify Objects By (`identifyObjectsBy`) acts on Layers, Variables and Layer Options, #394, scores unchanged; Appearance of Black › Printing / Exporting (`blackOutput`) acts on RGB raster export and Print as Bitmap, #394, scores unchanged; per-corner radius fields with a link toggle, split from #1594; control transport deadlines, #1726; Color panel: the mode picked last comes back after a restart, #1675; Image Trace: shared edges, memory, thin lines, strokes, corners, and the Shapes, Auto Grouping and Gradients options, measured in `image-trace-quality.md`, score unchanged; 2026-10-13 merges: Polish interface, #1498; compact native saves, #1492; PDF and EPS paste as vector art, #1499; import fixes for `.ai`, PDF, EPS and SVG, #1528, #1530, #1531, #1544, #1551, #1553; guide objects, #1534; Join after Average, #1533; Keyboard Shortcuts lists commands outside the menus, #1539; correction: Average and Join with a corner or smooth choice is missing; scores unchanged; late 2026-10-12 merges: type that does not fit its frame is reported, #1471; Tabs panel drags, #1458; template layers in Outline view, #1486; dialog slider rails, #1483; Direct Selection anchor precedence, #1508; print-size images, #1517; 3D on outlined type, #1481; French catalog, #1511; scores unchanged; Split Into Grid options, #1462; Transform Objects and Reflect across an angle, #1448 and #1460; Pathfinder panel on a group, #1450; unknown parameter keys refused, #1442; grayscale TIFFs with alpha, #1466 in part; Localization: Vietnamese catalog added, 63% → 71%, hours 60–100 → 55–90, full readiness unchanged at ~62%; scores and hours unchanged; Image Trace places edges to a fraction of a pixel in every mode, measured in `image-trace-quality.md`, score unchanged; 3D and Materials: Extrude & Bevel, Inflate and Rotate added, 3D ~8% → ~25% (estimated), menu stubs 25 → 22; Affinity text frames too short for their first line show it, #1423; Transform dialogs preview, #1412, and the transform tools and commands act on direct-selected anchors, #1408; `.ai` compound path paint, #1410; strokes wider than their shape, #1396; corner drags hide the bounding box, #1229; scores and hours unchanged; PDF and `.ai` import keep overprint, #1388, scores unchanged; `.ai` editing-data follow-ups: gradient stops, type of objects with an appearance, short area-type frames (#1390, #1391, #1392); dialog keyboard focus on every open (#1382, #1395); art flush with an artboard (#1375); font rescan (#1376); symbol instance redraw cache (#1386); scores and hours unchanged; grid tool options, #1377 in part, scores unchanged; `.ai` placed (linked) files read from the editing data, #1264, scores unchanged; gradient shapes import as paths, #1304; white constant alpha masks, #1286 in part; Live Corners widget click selects its corner, #1239; scores and hours unchanged; custom ruler origin, #1212; Artboard click-to-fit verified for objects, groups, visible bounds, undo and cancellation (#1227); scores and hours unchanged; Pathfinder single-result source names and SVG IDs retained, #1293; Localization: Korean catalog added, 54% → 63%, full readiness unchanged at ~62%; desktop print transport adopts craft-print, Windows 7 fallback retained, scores unchanged; Image Trace: an image over 64 megapixels traces scaled down instead of being refused, scores unchanged; Czech render-site localization follow-up; scores and estimates unchanged; Document Setup: Edit Artboards closes the modal after applying valid settings; pointer-click regressions; scores and hours unchanged; Artboards: Escape exits editing; an active drag cancels first; shortcut-routing regression; scores and hours unchanged; Path operations: Simplify preview/counts and component selection (#1272); scores unchanged; G2: Film Grain added; Photoshop effects 29/57; 28 filters remain; Platforms: RPM runtime capabilities and glibc floor (#1275); scores unchanged; Raster effects: squared-distance texture redraws (#1257); pixels unchanged; scores and hours unchanged; Drawing: Curvature point display improved (#1236, in part); scores unchanged; Type core: full-name font matching (#1258), scores and hours unchanged; Selection: no-op anchor Align preserves history and saved state (#1180 follow-up); scores unchanged; UI chrome: Eyedropper cursor and precise-setting regressions (#1269); scores unchanged; Colour: Eyedropper reads visible locked and outside-isolation sources (#1251); scores and hours unchanged; Selection: segment click/Delete preserves neighboring edges (#1278); scores unchanged; Colour: unpainted zero-width strokes regain 1 pt when painted (#1253); scores and hours unchanged; graphs: designs and markers, data, Graph Type and label options; UI chrome: native macOS save Format menu, #866, scores unchanged; compound paths inherit the backmost appearance and member fill-rule edits reach their owner, #1197; scores unchanged; Type core: Middle Eastern digit types done, Character panel menu › Digits; PDF export warns when the pixel cap lowers raster-effect resolution; Drawing tools: Live Corners round corners between curved sides, #1144; Type advanced: proportional vertical metrics (`vpal`) done, #966; Shape Builder: #893 fixed, merged regions of crossing lines no longer keep seams; scores unchanged while #937 is open; #1034: document-point character controls after object/group scaling; full readiness recomputed as the standard's additive weighted sum, ~62%; per-audience hours; essentials-user score ~75% added; ready-for-real-work re-examined: 50% → 55%, mainstream 65% added; earlier the same day: full re-measure against Illustrator 2026 30.x; merged the ROADMAP's parity estimate, honest assessment and "Shipped so far" into this file; SVG knockout groups of opaque art export without masks; Image Trace: colour presets no longer shatter noisy flat art and photos trace into smooth tones, measured in `image-trace-quality.md`, score unchanged; Split Into Grid options, #1462; Transform Objects and Reflect across an angle, #1448 and #1460; Pathfinder panel on a group, #1450; unknown parameter keys refused, #1442; grayscale TIFFs with alpha, #1466 in part; scores and hours unchanged; Image Trace places edges to a fraction of a pixel in every mode, measured in `image-trace-quality.md`, score unchanged; 3D and Materials: Extrude & Bevel, Inflate and Rotate added, 3D ~8% → ~25% (estimated), menu stubs 25 → 22; Affinity text frames too short for their first line show it, #1423; Transform dialogs preview, #1412, and the transform tools and commands act on direct-selected anchors, #1408; `.ai` compound path paint, #1410; strokes wider than their shape, #1396; corner drags hide the bounding box, #1229; scores and hours unchanged; PDF and `.ai` import keep overprint, #1388, scores unchanged; `.ai` editing-data follow-ups: gradient stops, type of objects with an appearance, short area-type frames (#1390, #1391, #1392); dialog keyboard focus on every open (#1382, #1395); art flush with an artboard (#1375); font rescan (#1376); symbol instance redraw cache (#1386); scores and hours unchanged; grid tool options, #1377 in part, scores unchanged; `.ai` placed (linked) files read from the editing data, #1264, scores unchanged; gradient shapes import as paths, #1304; white constant alpha masks, #1286 in part; Live Corners widget click selects its corner, #1239; scores and hours unchanged; custom ruler origin, #1212; Artboard click-to-fit verified for objects, groups, visible bounds, undo and cancellation (#1227); scores and hours unchanged; Pathfinder single-result source names and SVG IDs retained, #1293; Localization: Korean catalog added, 54% → 63%, full readiness unchanged at ~62%; desktop print transport adopts craft-print, Windows 7 fallback retained, scores unchanged; Image Trace: an image over 64 megapixels traces scaled down instead of being refused, scores unchanged; Czech render-site localization follow-up; scores and estimates unchanged; Document Setup: Edit Artboards closes the modal after applying valid settings; pointer-click regressions; scores and hours unchanged; Artboards: Escape exits editing; an active drag cancels first; shortcut-routing regression; scores and hours unchanged; Path operations: Simplify preview/counts and component selection (#1272); scores unchanged; G2: Film Grain added; Photoshop effects 29/57; 28 filters remain; Platforms: RPM runtime capabilities and glibc floor (#1275); scores unchanged; Raster effects: squared-distance texture redraws (#1257); pixels unchanged; scores and hours unchanged; Drawing: Curvature point display improved (#1236, in part); scores unchanged; Type core: full-name font matching (#1258), scores and hours unchanged; Selection: no-op anchor Align preserves history and saved state (#1180 follow-up); scores unchanged; UI chrome: Eyedropper cursor and precise-setting regressions (#1269); scores unchanged; Colour: Eyedropper reads visible locked and outside-isolation sources (#1251); scores and hours unchanged; Selection: segment click/Delete preserves neighboring edges (#1278); scores unchanged; Colour: unpainted zero-width strokes regain 1 pt when painted (#1253); scores and hours unchanged; graphs: designs and markers, data, Graph Type and label options; UI chrome: native macOS save Format menu, #866, scores unchanged; compound paths inherit the backmost appearance and member fill-rule edits reach their owner, #1197; scores unchanged; Type core: Middle Eastern digit types done, Character panel menu › Digits; PDF export warns when the pixel cap lowers raster-effect resolution; Drawing tools: Live Corners round corners between curved sides, #1144; Type advanced: proportional vertical metrics (`vpal`) done, #966; Shape Builder: #893 fixed, merged regions of crossing lines no longer keep seams; scores unchanged while #937 is open; #1034: document-point character controls after object/group scaling; full readiness recomputed as the standard's additive weighted sum, ~62%; per-audience hours; essentials-user score ~75% added; ready-for-real-work re-examined: 50% → 55%, mainstream 65% added; earlier the same day: full re-measure against Illustrator 2026 30.x; merged the ROADMAP's parity estimate, honest assessment and "Shipped so far" into this file; SVG knockout groups of opaque art export without masks; MCP `add_text` exposes the existing `vertical` option for point, area and path type; horizontal remains the default; scores and hours unchanged; Vertical fullwidth question and exclamation marks keep their nominal glyph upright when the font has no vertical alternate; scores and hours unchanged.; Curvature curve geometry, #1236 in part; Width-point finite-arithmetic follow-up validated; scores and hours unchanged; Image Trace adjustment discovery; File interop: legacy `.ai` of version 7 saved with type as text, hidden objects kept and an artboard picker, #868, scores unchanged; Revolve: automatic smooth shading and default-on Cap with continuous rims; PDF.R1: shared PDF reader with windowed content scanning and explicit incomplete-content errors; scores and estimates unchanged; PDF.W1: guarded shared PDF writer; output behavior, scores and estimates unchanged; later 2026-10-14 merges: anchor X/Y/W/H, #1824; Snap to Grid over Snap to Pixel, #1816; toolbar and All Tools, #1751; Actions panel selection, #1629 in part; redo during a drag, #1719; preferences written on OK, #1747; type in symbols after reopening, #1738; macOS save sheets, #1855, the Format menu withdrawn; stroke outlines shared, #1667; untrusted files, #1852, #1862–#1873; failed-save dialog, #1685; effects, #1864, Dim Images, #1683; duplicated rows of the 2026-10-05 table noted for the owner; scores unchanged; Image Trace: Shapes rework, stroke caps, enhanced presets, gradients over noise, measured in `image-trace-quality.md`, score unchanged; verified PngSuite downloads, #1729; synthetic control-input budgets, #1709; 2026-10-14 merges: anchor Align and Distribute, #1636; Direct Selection and Delete fixes, #1674, #1666, #1743; Escape while typing, #1686; Pen clicks, #1663; Expand on repeats, #1756; Roughen and Scribble, #1643, #1648; file and input hardening, #1776–#1783, #1786, #1807; MCP limits and envelope, #1727, #1728; Image Trace levelling and Flat Logo on scans, #1647, #1657; scores unchanged; later 2026-10-13 merges: SVG import, #1565, #1596, #1568, #1598, #1601; type on a path from PDF and `.ai`, #1585, #1586; ICC tag alignment, #1584; saves, #1620 in part; Warp Arc, #1578; Zig Zag, #1558; Pathfinder strokes, #1570; OpenType features, #1607; intersect Smart Guides, #1602 in part; a guide's position in the Transform panel, #1597 in part, a convenience with no parity claim; scores unchanged; TIFF is available in Export for Screens and Asset Export with shared format settings; scores and hours unchanged; G1/M11: Artboard deletion and history selection normalization; history regressions and full workspace CI pass; scores and hours unchanged; Character styles retain explicit Auto leading, propagate resets and preserve local leading overrides; scores and hours unchanged; Width Point Edit: Shift-double-click enables adjoining adjustment; plain double-click keeps it off; scores and hours unchanged; Units › Identify Objects By (`identifyObjectsBy`) acts on Layers, Variables and Layer Options, #394, scores unchanged; Appearance of Black › Printing / Exporting (`blackOutput`) acts on RGB raster export and Print as Bitmap, #394, scores unchanged; per-corner radius fields with a link toggle, split from #1594; control transport deadlines, #1726; Color panel: the mode picked last comes back after a restart, #1675; Image Trace: shared edges, memory, thin lines, strokes, corners, and the Shapes, Auto Grouping and Gradients options, measured in `image-trace-quality.md`, score unchanged; 2026-10-13 merges: Polish interface, #1498; compact native saves, #1492; PDF and EPS paste as vector art, #1499; import fixes for `.ai`, PDF, EPS and SVG, #1528, #1530, #1531, #1544, #1551, #1553; guide objects, #1534; Join after Average, #1533; Keyboard Shortcuts lists commands outside the menus, #1539; correction: Average and Join with a corner or smooth choice is missing; scores unchanged; late 2026-10-12 merges: type that does not fit its frame is reported, #1471; Tabs panel drags, #1458; template layers in Outline view, #1486; dialog slider rails, #1483; Direct Selection anchor precedence, #1508; print-size images, #1517; 3D on outlined type, #1481; French catalog, #1511; scores unchanged; Split Into Grid options, #1462; Transform Objects and Reflect across an angle, #1448 and #1460; Pathfinder panel on a group, #1450; unknown parameter keys refused, #1442; grayscale TIFFs with alpha, #1466 in part; Localization: Vietnamese catalog added, 63% → 71%, hours 60–100 → 55–90, full readiness unchanged at ~62%; scores and hours unchanged; Image Trace places edges to a fraction of a pixel in every mode, measured in `image-trace-quality.md`, score unchanged; 3D and Materials: Extrude & Bevel, Inflate and Rotate added, 3D ~8% → ~25% (estimated), menu stubs 25 → 22; Affinity text frames too short for their first line show it, #1423; Transform dialogs preview, #1412, and the transform tools and commands act on direct-selected anchors, #1408; `.ai` compound path paint, #1410; strokes wider than their shape, #1396; corner drags hide the bounding box, #1229; scores and hours unchanged; PDF and `.ai` import keep overprint, #1388, scores unchanged; `.ai` editing-data follow-ups: gradient stops, type of objects with an appearance, short area-type frames (#1390, #1391, #1392); dialog keyboard focus on every open (#1382, #1395); art flush with an artboard (#1375); font rescan (#1376); symbol instance redraw cache (#1386); scores and hours unchanged; grid tool options, #1377 in part, scores unchanged; `.ai` placed (linked) files read from the editing data, #1264, scores unchanged; gradient shapes import as paths, #1304; white constant alpha masks, #1286 in part; Live Corners widget click selects its corner, #1239; scores and hours unchanged; custom ruler origin, #1212; Artboard click-to-fit verified for objects, groups, visible bounds, undo and cancellation (#1227); scores and hours unchanged; Pathfinder single-result source names and SVG IDs retained, #1293; Localization: Korean catalog added, 54% → 63%, full readiness unchanged at ~62%; desktop print transport adopts craft-print, Windows 7 fallback retained, scores unchanged; Image Trace: an image over 64 megapixels traces scaled down instead of being refused, scores unchanged; Czech render-site localization follow-up; scores and estimates unchanged; Document Setup: Edit Artboards closes the modal after applying valid settings; pointer-click regressions; scores and hours unchanged; Artboards: Escape exits editing; an active drag cancels first; shortcut-routing regression; scores and hours unchanged; Path operations: Simplify preview/counts and component selection (#1272); scores unchanged; G2: Film Grain added; Photoshop effects 29/57; 28 filters remain; Platforms: RPM runtime capabilities and glibc floor (#1275); scores unchanged; Raster effects: squared-distance texture redraws (#1257); pixels unchanged; scores and hours unchanged; Drawing: Curvature point display improved (#1236, in part); scores unchanged; Type core: full-name font matching (#1258), scores and hours unchanged; Selection: no-op anchor Align preserves history and saved state (#1180 follow-up); scores unchanged; UI chrome: Eyedropper cursor and precise-setting regressions (#1269); scores unchanged; Colour: Eyedropper reads visible locked and outside-isolation sources (#1251); scores and hours unchanged; Selection: segment click/Delete preserves neighboring edges (#1278); scores unchanged; Colour: unpainted zero-width strokes regain 1 pt when painted (#1253); scores and hours unchanged; graphs: designs and markers, data, Graph Type and label options; UI chrome: native macOS save Format menu, #866, scores unchanged; compound paths inherit the backmost appearance and member fill-rule edits reach their owner, #1197; scores unchanged; Type core: Middle Eastern digit types done, Character panel menu › Digits; PDF export warns when the pixel cap lowers raster-effect resolution; Drawing tools: Live Corners round corners between curved sides, #1144; Type advanced: proportional vertical metrics (`vpal`) done, #966; Shape Builder: #893 fixed, merged regions of crossing lines no longer keep seams; scores unchanged while #937 is open; #1034: document-point character controls after object/group scaling; full readiness recomputed as the standard's additive weighted sum, ~62%; per-audience hours; essentials-user score ~75% added; ready-for-real-work re-examined: 50% → 55%, mainstream 65% added; earlier the same day: full re-measure against Illustrator 2026 30.x; merged the ROADMAP's parity estimate, honest assessment and "Shipped so far" into this file; SVG knockout groups of opaque art export without masks; Image Trace: colour presets no longer shatter noisy flat art and photos trace into smooth tones, measured in `image-trace-quality.md`, score unchanged; Split Into Grid options, #1462; Transform Objects and Reflect across an angle, #1448 and #1460; Pathfinder panel on a group, #1450; unknown parameter keys refused, #1442; grayscale TIFFs with alpha, #1466 in part; scores and hours unchanged; Image Trace places edges to a fraction of a pixel in every mode, measured in `image-trace-quality.md`, score unchanged; 3D and Materials: Extrude & Bevel, Inflate and Rotate added, 3D ~8% → ~25% (estimated), menu stubs 25 → 22; Affinity text frames too short for their first line show it, #1423; Transform dialogs preview, #1412, and the transform tools and commands act on direct-selected anchors, #1408; `.ai` compound path paint, #1410; strokes wider than their shape, #1396; corner drags hide the bounding box, #1229; scores and hours unchanged; PDF and `.ai` import keep overprint, #1388, scores unchanged; `.ai` editing-data follow-ups: gradient stops, type of objects with an appearance, short area-type frames (#1390, #1391, #1392); dialog keyboard focus on every open (#1382, #1395); art flush with an artboard (#1375); font rescan (#1376); symbol instance redraw cache (#1386); scores and hours unchanged; grid tool options, #1377 in part, scores unchanged; `.ai` placed (linked) files read from the editing data, #1264, scores unchanged; gradient shapes import as paths, #1304; white constant alpha masks, #1286 in part; Live Corners widget click selects its corner, #1239; scores and hours unchanged; custom ruler origin, #1212; Artboard click-to-fit verified for objects, groups, visible bounds, undo and cancellation (#1227); scores and hours unchanged; Pathfinder single-result source names and SVG IDs retained, #1293; Localization: Korean catalog added, 54% → 63%, full readiness unchanged at ~62%; desktop print transport adopts craft-print, Windows 7 fallback retained, scores unchanged; Image Trace: an image over 64 megapixels traces scaled down instead of being refused, scores unchanged; Czech render-site localization follow-up; scores and estimates unchanged; Document Setup: Edit Artboards closes the modal after applying valid settings; pointer-click regressions; scores and hours unchanged; Artboards: Escape exits editing; an active drag cancels first; shortcut-routing regression; scores and hours unchanged; Path operations: Simplify preview/counts and component selection (#1272); scores unchanged; G2: Film Grain added; Photoshop effects 29/57; 28 filters remain; Platforms: RPM runtime capabilities and glibc floor (#1275); scores unchanged; Raster effects: squared-distance texture redraws (#1257); pixels unchanged; scores and hours unchanged; Drawing: Curvature point display improved (#1236, in part); scores unchanged; Type core: full-name font matching (#1258), scores and hours unchanged; Selection: no-op anchor Align preserves history and saved state (#1180 follow-up); scores unchanged; UI chrome: Eyedropper cursor and precise-setting regressions (#1269); scores unchanged; Colour: Eyedropper reads visible locked and outside-isolation sources (#1251); scores and hours unchanged; Selection: segment click/Delete preserves neighboring edges (#1278); scores unchanged; Colour: unpainted zero-width strokes regain 1 pt when painted (#1253); scores and hours unchanged; graphs: designs and markers, data, Graph Type and label options; UI chrome: native macOS save Format menu, #866, scores unchanged; compound paths inherit the backmost appearance and member fill-rule edits reach their owner, #1197; scores unchanged; Type core: Middle Eastern digit types done, Character panel menu › Digits; PDF export warns when the pixel cap lowers raster-effect resolution; Drawing tools: Live Corners round corners between curved sides, #1144; Type advanced: proportional vertical metrics (`vpal`) done, #966; Shape Builder: #893 fixed, merged regions of crossing lines no longer keep seams; scores unchanged while #937 is open; #1034: document-point character controls after object/group scaling; full readiness recomputed as the standard's additive weighted sum, ~62%; per-audience hours; essentials-user score ~75% added; ready-for-real-work re-examined: 50% → 55%, mainstream 65% added; earlier the same day: full re-measure against Illustrator 2026 30.x; merged the ROADMAP's parity estimate, honest assessment and "Shipped so far" into this file; SVG knockout groups of opaque art export without masks) · **Target:** Adobe Illustrator 2026 (30.x; public release notes through 30.7, August 2026) The authoritative parity assessment. [`ROADMAP.md`](../ROADMAP.md) summarizes it; [`gaps.md`](gaps.md) is the work list made from it. Deep areas have their own checklists: [UI and interaction](ui-parity.md), @@ -560,6 +560,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur Choosing the Artboard tool (Shift+O, its toolbar button, or Edit Artboards in Properties or Document Setup) starts it on the active artboard: the canvas outlines that artboard, and Delete, Cut, Copy, the Transform panel and Artboard Options act on it. With the Artboard tool in use, a Shift-click on a row of the Artboards panel selects the artboards from the last row clicked without Shift to the clicked row, and the clicked row's artboard becomes the active one. When the artboard of the last row clicked without Shift is no longer selected, the range starts from the active artboard, and later Shift-clicks start from there too. A Ctrl/Cmd-click still adds or removes one artboard. A Shift-click used to add or remove one artboard as well. The public [Select artboards](https://helpx.adobe.com/illustrator/desktop/create-manage-artboards/add-edit-artboards/select-artboards.html) page lists Shift-click in the Artboards panel for selecting several artboards. In the Artboards panel, a click on the active artboard's options icon, or a double-click on another row's icon, opens Artboard Options for that row's artboard, and the panel menu's Artboard Options… opens it for the active artboard (part of #1876). Both used to choose the Artboard tool instead. Opened while another tool is in use, the dialog moves the art with a new X or Y when the Artboard tool's Move Artwork with Artboard option is on. + Artboard Options has X and Y fields beside a reference point locator (#1876), so an artboard's position can be typed as well as its size. X and Y are where the reference point lies, counted from the ruler origin (#1212), as the Transform panel and the Control bar show an artboard's position, and the locator is the one they and Properties share. A typed X or Y moves the artboard so that its reference point lands there, and a new Width or Height keeps the reference point in place; OK applies everything in one undo step. The shape dialogs still keep their X and Y to themselves (the click position). Pointer and key tests in `dialogs/tests.rs` cover both. Public references: [Resize artboards](https://helpx.adobe.com/illustrator/desktop/create-manage-artboards/add-edit-artboards/resize-artboards.html) and [Create and add new artboards](https://helpx.adobe.com/illustrator/desktop/create-manage-artboards/add-edit-artboards/add-new-artboards.html) (a reference point in a nine-point grid, then X and Y). Alt-clicking New Artboard in the Artboards panel opens Artboard Options for the new artboard, and OK adds it and makes it the active artboard (`ui.newArtboard`; behavior reference: [Default keyboard shortcuts](https://helpx.adobe.com/illustrator/using/default-keyboard-shortcuts.html), Use panels). A plain click still adds the artboard at once. With Align to Artboard chosen, the Align panel's Distribute Objects and Distribute Spacing buttons use the active artboard (`object.distribute` and `object.distributeSpacing` with `to: "artboard"` and `artboard`). The first object's left or top edge goes to the artboard's left or top edge, and the last object's right or bottom edge goes to the artboard's right or bottom edge. Distribute Objects spaces the other objects evenly by its button's line, and two objects are enough. Distribute Spacing makes the gaps between the objects equal. With anchor points selected, the buttons space the points among themselves and do not use the artboard. When an action plays, its Distribute Objects and Distribute Spacing steps with Align to Artboard use the artboard that is active then. With a key object, the Align panel's Distribute Objects buttons use the Distribute Spacing value (`object.distribute {spacing}`): the key object, or the compound path or selected group that contains it, stays in place, and the objects' left edges, centers or right edges (top edges, centers or bottom edges) end up that far apart, outward from the key object's, in their order. With the field's default value of 0, a click puts every object on the key object's line (behavior reference: [Ask Mordy: Distributing Objects](http://rwillustrator.blogspot.com/2008/01/ask-mordy-distribute.html)). @@ -770,6 +771,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur | Date | Change | Summary | |---|---|---| +| 2026-10-17 | minor | Evidence: Artboard Options has X and Y beside a reference point locator, counted from the ruler origin (#1876); scores unchanged | | 2026-10-17 | minor | Image Trace: Auto Color keeps rare but distinct colours drawn as regions of their own (stems, highlights, near-white on pale backgrounds), at most six, protected from mixed-colour merging and Noise: every key colour on 66 of 66 flat test logos (was 39); scans unchanged. Scores and hours unchanged. | | 2026-10-17 | minor | Image Trace: images over 1500 px on a side trace normally with a warning that they are slower (as the public documentation describes), images over 64 MP say they were scaled down, and the memory guard is 8,000,000 anchors (2,000,000 on the web) instead of 2,000,000, measured at about 90 bytes an anchor. Scores and hours unchanged. | | 2026-10-17 | minor | Image Trace: `Raster::new` returns an error for RGBA bytes of the wrong length instead of failing an assertion, and `Raster::pixel` reads nothing past the raster; no behaviour change for valid images. Scores and hours unchanged. | diff --git a/docs/ui-parity.md b/docs/ui-parity.md index d973823887..60a9b1dc04 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-10-17 · **Change:** minor (library panels: one per library, dockable and tabbable, with Persistent, #2603; the Selection tool threads text from the out port, #2572 in part; scores unchanged; Group Selection picks and moves one path of a compound path, #2441 in part; the Move dialog opens on the last move and its last checkboxes; scores unchanged; transparency grid visibility saved in native documents, #1968; Live Corners radius up to the neighbouring cuts, #2332; Image Trace quick presets: wording corrected to the shipped behaviour, the Image Trace button opens the controls; batch exporting, #1935; document window scroll bars, #2322; Anchor Point tool: a click on a handle end retracts that handle only, #2267; scores unchanged; Smart Guides: the dragged end of a straight segment keeps to its extension at any angle, #2120; Warp Options controls verified by focused checks and original-image review; estimates unchanged; existing-guide Escape cancellation validated 2026-10-14; scores and hours unchanged; open-path anchor Delete keeps surviving runs separate; estimates unchanged; Artboard tab-switch follow-up historically validated on `a0671777`; scores and hours unchanged; Artboard clean active-tab close/Delete follow-up validated 2026-10-15; Curvature curve geometry, #1236 in part; Width-point finite-arithmetic follow-up validated; scores and hours unchanged; Image Trace adjustment discovery; later 2026-10-14 merges: macOS save sheet Format menu back to missing, #1855, #866 reopened; anchor X/Y/W/H in the Transform panel, Properties and Control bar, #1824; Snap to Grid over Snap to Pixel, #1816; toolbar labels, columns and the All Tools drawer, #1751; Actions panel selection, #1629 in part; scores unchanged; 2026-10-14 merges: anchor Align and Distribute, #1636; Delete on closed paths and whole objects, #1674; selection inside isolation, #1666; Escape in a Direct Selection drag and while typing, #1743, #1686; Pen clicks under 3 px, #1663; [ and ] on more tools, #1661 in part; fields commit on click away, #1787; command search keys, #1757; a guide's position in the Transform panel is a convenience with no parity claim, #1659; scores unchanged; intersect Smart Guides for drawn points and dragged anchors, #1602 in part; a ruler guide's position in the Transform panel, #1597 in part; Symbol Options before New Symbol, #1560; tool flyout widths, #1616; Pathfinder Trim, Merge and Crop strokes, #1570; scores unchanged; G1/M11: Artboard deletion and history selection normalization; history regressions and full workspace CI pass; scores and hours unchanged; Width Point Edit: Shift-double-click enables adjoining adjustment; plain double-click keeps it off; scores and hours unchanged; per-corner radius fields with a link toggle, split from #1594; Join merges anchors lying on one another, #1533; correction: Average and Join with a corner or smooth choice is missing, not done; guide objects take the guide colour and style and Lock Guides, #1534; Keyboard Shortcuts lists commands outside the menus, #1539; round corners next to curves and the Smooth tool's reach, #1512; Make Compound Path on a group, #1537; dialog slider rails, #1483; template layers stay in Preview in Outline view, #1486; Direct Selection takes the selected object's anchor where anchors coincide, #1508; Tabs panel stop drags, #1458; Split Into Grid dialog, #1462; Transform Objects and Reflect's angle, #1448 and #1460; Pathfinder panel on a group, #1450; value fields: readable selection, #1465 in part, and a focused field follows its value, #1457; scores unchanged; Transform dialogs have a live Preview and step with the arrow keys, #1412; transform tools, dialogs and Move act on direct-selected anchors, #1408; the bounding box hides during a corner drag, #1229; scores unchanged; dialogs focus their first field on every open, #1367, and a first field that starts greyed out once it is enabled, #1395; scores unchanged; Rectangular Grid and Polar Grid click dialogs take the skew, frame, compound path and Fill Grid options, #1377 in part, score unchanged; Live Corners: a Direct Selection click on a widget selects its corner, #1239; custom ruler origin, #1212; Artboard tool clicks fit the topmost editable object in one undo step (#1227); scores unchanged; Pathfinder single-result source names and SVG IDs retained, #1293; DXF control-point SPLINE closure read, #1299 follow-up; Document Setup: Edit Artboards closes the modal after applying valid settings; pointer-click regressions; scores and hours unchanged; Artboards: Escape exits editing; an active drag cancels first; shortcut-routing regression; scores and hours unchanged; Simplify preview/counts and valid rewritten-path selection (#1272); parity remains partial; Texture-effect drag redraws optimized (#1257); idle Windows interaction still unverified; scores unchanged; Curvature point display improved (#1236, in part); scores unchanged; Direct Selection: no-op anchor Align preserves Undo, Redo and saved state (#1180 follow-up); Eyedropper cursor distinguished from precise crosshair (#1269); scores unchanged; Eyedropper can read visible locked and outside-isolation sources (#1251); scores unchanged; Direct Selection: independent segment picks and Delete (#1278); scores unchanged; Adding paint to an unpainted zero-width stroke restores the 1 pt default (#1253); scores unchanged; macOS save sheets offer a Format menu, #866; Attributes fill-rule controls edit the compound when a member is selected, #1197; a marquee needs to touch a path, not just lie inside its fill, #1103; earlier: Live Corners round corners between curved sides, #1144) · **Target:** Adobe Illustrator 2026 (30.x) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-17 · **Change:** minor (Artboard Options' X and Y with a reference point, #1876; scores unchanged; library panels: one per library, dockable and tabbable, with Persistent, #2603; the Selection tool threads text from the out port, #2572 in part; scores unchanged; Group Selection picks and moves one path of a compound path, #2441 in part; the Move dialog opens on the last move and its last checkboxes; scores unchanged; transparency grid visibility saved in native documents, #1968; Live Corners radius up to the neighbouring cuts, #2332; Image Trace quick presets: wording corrected to the shipped behaviour, the Image Trace button opens the controls; batch exporting, #1935; document window scroll bars, #2322; Anchor Point tool: a click on a handle end retracts that handle only, #2267; scores unchanged; Smart Guides: the dragged end of a straight segment keeps to its extension at any angle, #2120; Warp Options controls verified by focused checks and original-image review; estimates unchanged; existing-guide Escape cancellation validated 2026-10-14; scores and hours unchanged; open-path anchor Delete keeps surviving runs separate; estimates unchanged; Artboard tab-switch follow-up historically validated on `a0671777`; scores and hours unchanged; Artboard clean active-tab close/Delete follow-up validated 2026-10-15; Curvature curve geometry, #1236 in part; Width-point finite-arithmetic follow-up validated; scores and hours unchanged; Image Trace adjustment discovery; later 2026-10-14 merges: macOS save sheet Format menu back to missing, #1855, #866 reopened; anchor X/Y/W/H in the Transform panel, Properties and Control bar, #1824; Snap to Grid over Snap to Pixel, #1816; toolbar labels, columns and the All Tools drawer, #1751; Actions panel selection, #1629 in part; scores unchanged; 2026-10-14 merges: anchor Align and Distribute, #1636; Delete on closed paths and whole objects, #1674; selection inside isolation, #1666; Escape in a Direct Selection drag and while typing, #1743, #1686; Pen clicks under 3 px, #1663; [ and ] on more tools, #1661 in part; fields commit on click away, #1787; command search keys, #1757; a guide's position in the Transform panel is a convenience with no parity claim, #1659; scores unchanged; intersect Smart Guides for drawn points and dragged anchors, #1602 in part; a ruler guide's position in the Transform panel, #1597 in part; Symbol Options before New Symbol, #1560; tool flyout widths, #1616; Pathfinder Trim, Merge and Crop strokes, #1570; scores unchanged; G1/M11: Artboard deletion and history selection normalization; history regressions and full workspace CI pass; scores and hours unchanged; Width Point Edit: Shift-double-click enables adjoining adjustment; plain double-click keeps it off; scores and hours unchanged; per-corner radius fields with a link toggle, split from #1594; Join merges anchors lying on one another, #1533; correction: Average and Join with a corner or smooth choice is missing, not done; guide objects take the guide colour and style and Lock Guides, #1534; Keyboard Shortcuts lists commands outside the menus, #1539; round corners next to curves and the Smooth tool's reach, #1512; Make Compound Path on a group, #1537; dialog slider rails, #1483; template layers stay in Preview in Outline view, #1486; Direct Selection takes the selected object's anchor where anchors coincide, #1508; Tabs panel stop drags, #1458; Split Into Grid dialog, #1462; Transform Objects and Reflect's angle, #1448 and #1460; Pathfinder panel on a group, #1450; value fields: readable selection, #1465 in part, and a focused field follows its value, #1457; scores unchanged; Transform dialogs have a live Preview and step with the arrow keys, #1412; transform tools, dialogs and Move act on direct-selected anchors, #1408; the bounding box hides during a corner drag, #1229; scores unchanged; dialogs focus their first field on every open, #1367, and a first field that starts greyed out once it is enabled, #1395; scores unchanged; Rectangular Grid and Polar Grid click dialogs take the skew, frame, compound path and Fill Grid options, #1377 in part, score unchanged; Live Corners: a Direct Selection click on a widget selects its corner, #1239; custom ruler origin, #1212; Artboard tool clicks fit the topmost editable object in one undo step (#1227); scores unchanged; Pathfinder single-result source names and SVG IDs retained, #1293; DXF control-point SPLINE closure read, #1299 follow-up; Document Setup: Edit Artboards closes the modal after applying valid settings; pointer-click regressions; scores and hours unchanged; Artboards: Escape exits editing; an active drag cancels first; shortcut-routing regression; scores and hours unchanged; Simplify preview/counts and valid rewritten-path selection (#1272); parity remains partial; Texture-effect drag redraws optimized (#1257); idle Windows interaction still unverified; scores unchanged; Curvature point display improved (#1236, in part); scores unchanged; Direct Selection: no-op anchor Align preserves Undo, Redo and saved state (#1180 follow-up); Eyedropper cursor distinguished from precise crosshair (#1269); scores unchanged; Eyedropper can read visible locked and outside-isolation sources (#1251); scores unchanged; Direct Selection: independent segment picks and Delete (#1278); scores unchanged; Adding paint to an unpainted zero-width stroke restores the 1 pt default (#1253); scores unchanged; macOS save sheets offer a Format menu, #866; Attributes fill-rule controls edit the compound when a member is selected, #1197; a marquee needs to touch a path, not just lie inside its fill, #1103; earlier: Live Corners round corners between curved sides, #1144) · **Target:** Adobe Illustrator 2026 (30.x) How VectorCraft's tools, handles, snapping and panels behave next to Illustrator's. A vector illustrator's trust is in the details: where a handle lands, what Shift and Alt do mid-drag, what a smart guide snaps to, @@ -175,6 +175,7 @@ tools, never checked side by side) isn't captured row by row. | Artboard navigator synchronizes the active tool selection before deletion | done | Actual status-bar Next → Delete/Backspace and Next → Properties Delete regressions in `chrome.rs` cover surviving board records, preserved artwork and Undo/Redo; other tools keep object selection and history. **Tab-switch follow-up:** document-tab changes align the Artboard tool with the displayed board. Actual A → B → A tab clicks followed by Properties Delete and controls for same-tab multiselection, Move/Scale Artwork options and other tools passed, along with historical full CI on `a0671777`. [Validation evidence](target-app-parity.md#evidence-what-ships-today-by-area). **Clean-tab close:** with the Artboard tool active, closing a clean active tab restores the surviving document's displayed board before Properties Delete. | | Artboard history prunes removed indices while preserving valid multiselection and tool options | tested | Headless pointer/key tests in `panels/properties.rs` cover panel New → Undo → Delete/Backspace/Properties, Duplicate → Undo → Delete, partial pruning and valid multiselection. They check surviving board records, artwork, object selection, Move/Scale Artwork options, saved state and Undo/Redo. Full workspace CI passes. | | Click an object with the Artboard tool to create an artboard fitted to its visible bounds | done | Topmost editable object or group; drag and modified clicks retain their meaning; one undo step (`artboard_click.rs`, #1227) | +| Artboard Options: X and Y beside a reference point locator, counted from the ruler origin; a typed X or Y moves the artboard's reference point there, a new Width or Height keeps it in place | done | #1876; as the Transform panel's and the Control bar's artboard X and Y, with the locator they and Properties share; the shape dialogs' X and Y (the click position) stay hidden. Pointer and key tests in `dialogs/tests.rs` | | Shape tools: Shift constrains, Alt from centre, Space moves while dragging, arrows change sides/points/rows | done | | | Tool double-click opens its options | done | | | Per-platform mapping (Cmd ↔ Ctrl, Option ↔ Alt) | done | | @@ -243,6 +244,7 @@ re-measure of the panels added since. Slider rails show on Medium Dark (#1808, # | Date | Change | Summary | |---|---|---| +| 2026-10-17 | minor | Artboard Options has X and Y beside a reference point locator, counted from the ruler origin as the Transform panel's are; a typed X or Y moves the artboard's reference point there and a new Width or Height keeps it in place (#1876); scores unchanged (estimated) | | 2026-10-17 | minor | Library panels (#2603): each swatch or graphic style library opens in its own dockable, tabbable panel, several at once; the panel menu's Persistent reopens a panel at startup with its view and find field, a library loaded from a file read again from its path; scores unchanged (estimated) | | 2026-10-17 | minor | Selection tool: clicking the red out port of overflowing area type, then a closed path, empty canvas or a dragged rectangle threads the text there (#2572 in part); Escape cancels. Scores and hours unchanged. | | 2026-10-17 | minor | Group Selection picks one path of a compound path (the outer shape or a hole) and moves it on its own; a second click adds the compound path (#2441, in part) | From b55d277b491f2b8ebd3d0a511491b3ecb993e249 Mon Sep 17 00:00:00 2001 From: vangel76 Date: Fri, 16 Oct 2026 21:22:11 +0200 Subject: [PATCH 009/545] Fonts: a variable font's default face is named and weighed by its default instance (#2521) Co-Authored-By: Claude Opus 5.5 Co-Authored-By: Claude Sonnet 5.5 --- crates/text/src/fontdb.rs | 46 +++++++++++++++++++++++++++---- crates/text/src/tests_variable.rs | 40 +++++++++++++++++++++++++++ docs/type-parity.md | 1 + 3 files changed, 81 insertions(+), 6 deletions(-) diff --git a/crates/text/src/fontdb.rs b/crates/text/src/fontdb.rs index a119fd3231..f75f3175f1 100644 --- a/crates/text/src/fontdb.rs +++ b/crates/text/src/fontdb.rs @@ -892,11 +892,22 @@ pub(crate) fn face_styles(f: &skrifa::FontRef<'_>) -> Vec { let native_family = native_family_name(f, &family); let mut keys = FaceKeys::of(f, &family, &style); let traits = FontTraits::of(f, &keys); - let mut instances = named_instances(f, &family, &style, &mut keys, native_family.clone()); + let (mut instances, renamed) = named_instances(f, &family, &style, &mut keys, native_family.clone()); for i in &mut instances { i.traits = traits; } - let face = FaceStyle { family, native_family, style, keys, variations: vec![], weight: None, italic: false, traits }; + // A variable font's default face renders at its `wght` default, whatever its name table and + // OS/2 table say (Noto Sans Hebrew: named `Light`, weight class 300, default instance Regular + // at 400): weigh it so, and name it by its default instance when that is another weight. + let weight = f + .axes() + .iter() + .find(|a| a.tag().to_be_bytes() == *b"wght") + .map(|a| a.default_value()) + .filter(|w| w.is_finite()) + .map(|w| w.clamp(1.0, 1000.0)); + let style = renamed.unwrap_or(style); + let face = FaceStyle { family, native_family, style, keys, variations: vec![], weight, italic: false, traits }; std::iter::once(face).chain(instances).collect() } @@ -905,17 +916,40 @@ pub(crate) fn face_styles(f: &skrifa::FontRef<'_>) -> Vec { /// names already taken. The default instance's name, when it isn't the face's style name (a face /// `Regular` whose default instance is `Book`), names the face too (`keys`). Damaged tables give /// fewer instances or none; the counts read are capped. -fn named_instances(f: &skrifa::FontRef<'_>, family: &str, style: &str, keys: &mut FaceKeys, native_family: Option) -> Vec { +fn named_instances( + f: &skrifa::FontRef<'_>, + family: &str, + style: &str, + keys: &mut FaceKeys, + native_family: Option, +) -> (Vec, Option) { let axes = f.axes(); if axes.is_empty() || axes.len() > MAX_AXES { - return vec![]; + return (vec![], None); } let tags: Vec = axes.iter().map(|a| a.tag()).collect(); let defaults: Vec = axes.iter().map(|a| a.default_value()).collect(); + let is_default = |coords: &[f32]| coords.len() == defaults.len() && coords.iter().zip(&defaults).all(|(c, d)| (c - d).abs() < 1e-3); + // The face renders as its default instance. When that instance is another weight than the + // name table says (`Light` face, Regular default instance), the instance names the face. + let renamed = tags.iter().any(|t| t.to_be_bytes() == *b"wght").then(|| { + f.named_instances() + .iter() + .take(MAX_INSTANCES) + .filter(|inst| is_default(&inst.user_coords().take(MAX_AXES).collect::>())) + .find_map(|inst| name(f, &[inst.subfamily_name_id()])) + .filter(|d| style_weight(d) != style_weight(style)) + }); + let renamed = renamed.flatten(); // Instances without a PostScript name of their own are named `-