Skip to content

VectorCraft: An open-source, vector art tool written by scratch in pure Rust

Part of #868: legacy .ai runs as a PostScript program, with a prolog of its own

Dan Green7844f46c65a9
diff --git a/crates/engine/src/tests_legacy_ai.rs b/crates/engine/src/tests_legacy_ai.rs
index fef2b44cf..e38e0f2fa 100644
--- a/crates/engine/src/tests_legacy_ai.rs
+++ b/crates/engine/src/tests_legacy_ai.rs
@@ -250,6 +250,16 @@ fn a_transparent_image_is_flattened_with_the_art_under_it_which_stays() {
}
assert_eq!(colour_at(d, 20.0, 30.0), [255, 0, 0], "the square outside the image");
assert_eq!(colour_at(d, 80.0, 30.0), [255, 255, 255], "nothing beyond the image");
+ // Run as a PostScript program (the file's prolog draws it), it prints the same: two images
+ // and the square, on a page that is the art's box (10 pt in from the artboard's top left).
+ s.execute("document.open", &json!({"name": "t.ai", "dataBase64": r["dataBase64"], "editingData": false})).unwrap();
+ let page = &s.doc().unwrap().doc;
+ assert_eq!(images(page).0, 2);
+ let printed = [colour_at(page, 30.0, 20.0), colour_at(page, 50.0, 20.0)];
+ for (a, b) in before.iter().zip(&printed) {
+ assert!(a.iter().zip(b).all(|(a, b)| a.abs_diff(*b) <= 3), "{before:?} {printed:?}");
+ }
+ assert_eq!(colour_at(page, 10.0, 20.0), [255, 0, 0], "the square outside the image");
}
#[test]
diff --git a/crates/eps/src/import/mod.rs b/crates/eps/src/import/mod.rs
index 276cc9816..b59d2dda7 100644
--- a/crates/eps/src/import/mod.rs
+++ b/crates/eps/src/import/mod.rs
@@ -18,7 +18,9 @@
//! `%%Creator`) and these operators: Adobe Illustrator File Format Specification, version 7.0
//! (1998), listed by PRONOM at https://www.nationalarchives.gov.uk/PRONOM/fmt/423. A file in that
//! format whose program has its layers (`%AI5_BeginLayer`) comes in through them, as `native` reads
-//! an Illustrator EPS's editing copy (#1027).
+//! an Illustrator EPS's editing copy (#1027). One VectorCraft wrote (its prolog the procedure set
+//! [`crate::legacy_ai::PROCSET`], which prints its gradients flat and leaves its type out) comes in
+//! from those layers alone, without its page.
//!
//! The page is the file's `%%BoundingBox` (`%%HiResBoundingBox` when it has one), the first page
//! of a PostScript file without one. A file whose program can't be read (an operator the
@@ -92,6 +94,9 @@ struct Dsc {
/// In the legacy Illustrator format: its header has `%AI…` comments or names the app as the
/// creator (see the module docs for the specification).
illustrator: bool,
+ /// Its prolog is the one VectorCraft's legacy `.ai` writer includes
+ /// ([`crate::legacy_ai::PROCSET`] in `%%DocumentSuppliedResources`).
+ own_legacy: bool,
}
/// The four numbers of a bounding box comment's value, when it has them and they make a box.
@@ -126,6 +131,9 @@ impl Dsc {
if header && (line.starts_with("%AI") || line.starts_with("%%AI") || creator) {
d.illustrator = true;
}
+ if header && value("%%DocumentSuppliedResources:").is_some_and(|v| v.strip_prefix("procset ") == Some(crate::legacy_ai::PROCSET)) {
+ d.own_legacy = true;
+ }
if let Some(v) = value("%%HiResBoundingBox:") {
if header || atend {
hires = box_of(v).or(hires);
@@ -185,6 +193,15 @@ pub fn import_with(bytes: &[u8], editing_data: bool) -> Result<Imported, String>
return Err("this is not a PostScript file".into());
}
let dsc = Dsc::read(ps);
+ // A legacy `.ai` VectorCraft wrote: its prolog prints the art plainly (gradients flat, no
+ // type), and its program has all of it, which is read as the format (as before the file
+ // printed).
+ if editing_data
+ && dsc.own_legacy
+ && let Some(Ok((document, warnings))) = native::program_alone(ps)
+ {
+ return Ok(Imported { document, warnings, preview: false });
+ }
let [llx, lly, urx, ury] = dsc.bbox.unwrap_or(LETTER);
let frame = Rect::new(0.0, 0.0, urx - llx, ury - lly);
let mut doc = Document::new(frame.width(), frame.height());
diff --git a/crates/eps/src/legacy_ai.rs b/crates/eps/src/legacy_ai.rs
index 4b774c2f7..96a9ff259 100644
--- a/crates/eps/src/legacy_ai.rs
+++ b/crates/eps/src/legacy_ai.rs
@@ -51,10 +51,9 @@
//! Windows-1252, vertical type, inline graphics, gradient or pattern fills) is written as its
//! outlines, and all type with [`LegacyAiOptions::outline_text`].
//!
-//! The prolog defines the one procedure the script calls that isn't an operator of the format,
-//! the page trailer's `annotatepage` ([`PROLOG`]); the format's operators are left to the app that
-//! reads the file, so PostScript printers can't print it, as the `.ai` files other apps write in
-//! this format.
+//! The prolog is a procedure set of the writer's own ([`PROLOG`]) that gives the operators their
+//! meaning in PostScript, so the file also prints and previews as a PostScript program (its
+//! gradients flat, without its type, which apps that read the format draw).
use std::fmt::Write;
use std::sync::Arc;
@@ -198,7 +197,7 @@ pub fn export_legacy_ai(doc: &Document, o: &LegacyAiOptions) -> Result<LegacyAiO
let _ = writeln!(s, "%AI5_ArtSize: {} {}", ps::num(width), ps::num(height));
s.push_str("%AI5_RulerUnits: 2\n");
let _ = writeln!(s, "%AI5_NumLayers: {layers}");
- s.push_str("%%DocumentSuppliedResources: procset VectorCraft_Legacy 1 0\n");
+ let _ = writeln!(s, "%%DocumentSuppliedResources: procset {PROCSET}");
s.push_str("%%EndComments\n%%BeginProlog\n");
s.push_str(PROLOG);
s.push_str("%%EndProlog\n%%BeginSetup\n");
@@ -242,15 +241,89 @@ fn fonts(s: &mut String, fonts: &[(String, bool)]) {
}
}
+/// The prolog's procedure set, as `%%DocumentSuppliedResources` names it: a file that has it is
+/// read from its program when its layers are asked for ([`crate::import_with`]).
+pub(crate) const PROCSET: &str = "VectorCraft_Legacy 1 0";
+
/// The prolog: a procedure set of this writer's own (`VectorCraft_Legacy 1 0`), in a dictionary
/// (`VCLegacy`) the setup begins and the trailer ends (§1.2: the prolog holds definitions only,
-/// the setup activates them, the trailer deactivates them). The page trailer of the
-/// specification's script (§3, Script Setup: `gsave annotatepage grestore showpage`) calls
-/// `annotatepage`, which marks nothing here.
+/// the setup activates them, the trailer deactivates them). It gives each operator the script
+/// uses its meaning in PostScript, so that the file prints and previews as a PostScript program,
+/// written from the PostScript Language Reference and this format's specification (no other
+/// application's procedure set): paths and their painting with the fill and stroke colours,
+/// compound paths painted as one path, clipping groups, guides that don't print, layers that are
+/// hidden or don't print marking nothing, and images drawn from the samples on the comment lines
+/// that follow `XI`. Gradients fill with the colour set before them (the writer sets the first
+/// stop's), and type marks nothing: apps that read the format draw both. The page trailer's
+/// `annotatepage` (§3, Script Setup: `gsave annotatepage grestore showpage`) marks nothing.
const PROLOG: &str = "%%BeginResource: procset VectorCraft_Legacy 1 0
-/VCLegacy 8 dict def
+/VCLegacy 96 dict def
VCLegacy begin
-/annotatepage {} bind def
+/bd {bind def} bind def
+% State: the fill and stroke colours (procedures that set them), their overprints, the fill rule,
+% a clip to make at the next painting operator, a compound path being built, a guide being
+% drawn, whether the layer prints, and what the compound path is painted with.
+/_fc {0 setgray} def /_sc {0 setgray} def
+/_fo false def /_so false def /_eo false def /_w false def /_cp false def /_g false def
+/_on true def /_rf false def /_rs false def
+% Painting: a fill and a stroke that keep the path; the path painted as _rf and _rs say (after
+% the clip W asked for), then ended.
+/_fill {gsave _fc _fo setoverprint _eo {eofill} {fill} ifelse grestore} bd
+/_stroke {gsave _sc _so setoverprint stroke grestore} bd
+/_draw {_w {_eo {eoclip} {clip} ifelse /_w false def} if
+ _on _g not and {_rf {_fill} if _rs {_stroke} if} if newpath} bd
+% close? fill? stroke? _r: paints now, or at the end of the compound path being built.
+/_r {/_rs exch def /_rf exch def {closepath} if _cp not {_draw} if} bd
+% Path construction (section 5.3.2) and painting (5.3.3).
+/m {moveto} bd /l {lineto} bd /L {lineto} bd /c {curveto} bd /C {curveto} bd
+/N {false false false _r} bd /n {true false false _r} bd
+/F {false true false _r} bd /f {true true false _r} bd
+/S {false false true _r} bd /s {true false true _r} bd
+/B {false true true _r} bd /b {true true true _r} bd
+/XR {1 eq /_eo exch def} bd
+% Compound paths (5.3.5): one path, painted at its end.
+/*u {/_cp true def} bd /*U {/_cp false def _draw} bd
+% Groups, clipping groups and masks (5.6), locking (5.1), guides (6.1).
+/u {} bd /U {} bd /q {gsave} bd /Q {grestore} bd
+/H {} bd /h {closepath} bd /W {/_w true def} bd
+/A {pop} bd
+/* {pop _g {newpath /_g false def} {/_g true def} ifelse} bd
+% Colours (5.4): fill and stroke colours, overprints; a custom colour as its CMYK equivalent at
+% its tint (tint 0 is the full colour).
+/g {/setgray load 2 array astore cvx /_fc exch def} bd
+/G {/setgray load 2 array astore cvx /_sc exch def} bd
+/k {/setcmykcolor load 5 array astore cvx /_fc exch def} bd
+/K {/setcmykcolor load 5 array astore cvx /_sc exch def} bd
+/Xa {/setrgbcolor load 4 array astore cvx /_fc exch def} bd
+/XA {/setrgbcolor load 4 array astore cvx /_sc exch def} bd
+/_tint {1 exch sub /_t exch def pop 4 {_t mul 4 1 roll} repeat} bd
+/x {_tint k} bd /X {_tint K} bd
+/O {1 eq /_fo exch def} bd /R {1 eq /_so exch def} bd
+/w {setlinewidth} bd /J {setlinecap} bd /j {setlinejoin} bd /M {setmiterlimit} bd /d {setdash} bd
+% Gradients (3.5): definitions are skipped; an instance fills with the colour set before it
+% (the writer sets its first stop's), and BB strokes the path as its flag says.
+/Bn {pop} bd /Bd {pop pop pop} bd /BD {cleartomark} bd
+/Bb {gsave} bd /Bg {12 {pop} repeat} bd /Bh {pop pop pop pop} bd
+/BB {grestore _cp {0 gt {/_rs true def} if}
+ {dup 2 eq {closepath} if 0 gt _on and {_stroke} if newpath} ifelse} bd
+% Layers (9): a layer that is hidden or doesn't print marks nothing.
+/Lb {6 {pop} repeat exch pop exch pop 1 eq exch 1 eq and /_on exch def} bd
+/Ln {pop} bd /LB {/_on true def} bd
+% Images (8): the samples, in hex on the comment lines that follow XI, read a line at a time.
+/_l 256 string def /_s 128 string def
+/_row {{currentfile _l readline not {exit} if dup length 1 gt {exit} if pop} loop
+ dup length 1 gt {dup length 1 sub 1 exch getinterval /ASCIIHexDecode filter _s readstring pop} {pop ()} ifelse} bd
+/XI {pop pop pop pop /_ic exch def /_ib exch def /_ih exch def /_iw exch def pop pop pop pop
+ aload pop neg 6 array astore [1 0 0 -1 0 0] matrix concatmatrix
+ _on {gsave concat _iw _ih _ib [1 0 0 1 0 0] /_row load false _ic 1 eq {1} {_ic} ifelse colorimage grestore} {pop} ifelse} bd
+% Type (15) is set by the app that reads the file: its operators take their operands and mark
+% nothing; encodings (3.3) are skipped.
+/TE {cleartomark} bd /TZ {cleartomark} bd
+/To {pop} bd /Tp {7 {pop} repeat} bd /TP {} bd /TO {} bd
+/Tr {pop} bd /Tf {pop pop pop pop} bd /Ts {pop} bd /Tz {pop pop} bd /Tt {pop} bd /TA {pop} bd
+/Tl {pop pop} bd /Ta {pop} bd /Ti {pop pop pop} bd /Tx {pop} bd
+% The page trailer (3): annotatepage marks nothing.
+/annotatepage {} bd
end
%%EndResource
";
diff --git a/crates/eps/src/tests_legacy_ai.rs b/crates/eps/src/tests_legacy_ai.rs
index 94f9eaa2f..98479fa60 100644
--- a/crates/eps/src/tests_legacy_ai.rs
+++ b/crates/eps/src/tests_legacy_ai.rs
@@ -76,8 +76,104 @@ fn write(doc: &Document) -> LegacyAiOutput {
write_with(doc, LegacyAiOptions::default())
}
+/// `doc` written with options `o`. Every file the tests write is also run as a PostScript program
+/// ([`prints_as`]) and must draw what `doc` draws.
fn write_with(doc: &Document, o: LegacyAiOptions) -> LegacyAiOutput {
- export_legacy_ai(doc, &LegacyAiOptions { title: "Sample".into(), created: Some(0), ..o }).unwrap()
+ let o = LegacyAiOptions { title: "Sample".into(), created: Some(0), ..o };
+ let out = export_legacy_ai(doc, &o).unwrap();
+ prints_as(&out.bytes, doc, &o);
+ out
+}
+
+/// `doc` as the prolog prints the file written from it with options `o`: without its layers that
+/// don't print, its type as its glyphs' outlines where the writer writes them (all type with
+/// [`LegacyAiOptions::outline_text`], else the type 8-bit text can't hold) and left out where it
+/// writes text objects, its
+/// hidden objects shown when `o` writes them visible, and its gradients filled with their first
+/// stop's colour.
+fn as_printed(doc: &Document, o: &LegacyAiOptions) -> Document {
+ // A run's glyphs, laid out, as one path with the run's fill (the renderer draws no type).
+ fn outlined(t: &vectorcraft_doc::TextObject) -> Node {
+ let layout = vectorcraft_text::layout(vectorcraft_text::FontDb::global(), t);
+ let runs = t.runs.iter().enumerate().map(|(i, run)| {
+ let mut bp = kurbo::BezPath::new();
+ for g in layout.glyphs.iter().filter(|g| g.run == i) {
+ bp.extend(g.outline.iter());
+ }
+ let path = PathData::from_bezpath(&bp).transformed(t.xf);
+ Arc::new(Node::path(vectorcraft_doc::NodeId(0), path, Appearance::basic(run.style.fill.clone(), Paint::None, 0.0)))
+ });
+ Node::group(vectorcraft_doc::NodeId(0), runs.collect())
+ }
+ fn plain(nodes: &mut Vec<Arc<Node>>, o: &LegacyAiOptions) {
+ nodes.retain(|n| match &n.kind {
+ NodeKind::Text(t) => o.outline_text || !writable(t),
+ NodeKind::Layer { printable, .. } => *printable,
+ _ => true,
+ });
+ for n in nodes {
+ if let NodeKind::Text(t) = &n.kind {
+ *n = Arc::new(outlined(t));
+ }
+ let n = Arc::make_mut(n);
+ if o.hidden == HiddenObjects::Visible && !matches!(n.kind, NodeKind::Layer { .. }) {
+ n.visible = true;
+ }
+ for item in &mut n.appearance.items {
+ if let AppearanceItem::Fill(f) = item
+ && let Paint::Gradient(g) = &f.paint
+ {
+ f.paint = g.gradient.stops.first().map_or(Paint::None, |s| Paint::solid(s.color));
+ }
+ }
+ if let Some(c) = n.children_mut() {
+ plain(c, o);
+ }
+ }
+ }
+ let mut d = doc.clone();
+ plain(&mut d.layers, o);
+ d
+}
+
+/// The legacy `.ai` `bytes` run as a PostScript program (VectorCraft's PostScript reader, with the
+/// file's prolog) draws as `doc`, written with options `o` (its first artboard the file's), prints
+/// ([`as_printed`]): the same art in the same places, in the same colours.
+fn prints_as(bytes: &[u8], doc: &Document, o: &LegacyAiOptions) {
+ let text = String::from_utf8_lossy(bytes);
+ let nums = |key: &str| -> Vec<f64> {
+ let line = text.lines().find_map(|l| l.strip_prefix(key)).unwrap_or_else(|| panic!("no {key}"));
+ line.split_whitespace().map(|v| v.parse().unwrap()).collect()
+ };
+ // The art's box (the page the program draws on) and the artboard's top, in art space (y up).
+ let [llx, lly, urx, ury] = nums("%%HiResBoundingBox:")[..] else { panic!() };
+ let top = nums("%AI3_TileBox:")[3];
+ let board = doc.artboards[0].rect;
+ let there = Rect::new(board.x0 + llx, board.y0 + top - ury, board.x0 + urx, board.y0 + top - lly);
+ let scale = 300.0 / (urx - llx).max(ury - lly).max(1.0);
+ let want = vectorcraft_render::Renderer::new().render_region(&as_printed(doc, o), there, scale, true);
+ let drew = match crate::import_with(bytes, false) {
+ Ok(page) => {
+ assert!(!page.preview, "read as its program");
+ vectorcraft_render::Renderer::new().render_region(&page.document, Rect::new(0.0, 0.0, urx - llx, ury - lly), scale, true)
+ }
+ // A page that marks nothing (type alone): blank.
+ Err(e) if e.contains("draws nothing") => {
+ vectorcraft_render::Renderer::new().render_region(&Document::new(1.0, 1.0), Rect::new(0.0, 0.0, urx - llx, ury - lly), scale, true)
+ }
+ Err(e) => panic!("the file doesn't run as PostScript: {e}"),
+ };
+ assert_eq!((drew.width, drew.height), (want.width, want.height));
+ let differ = drew
+ .pixels
+ .as_chunks::<4>()
+ .0
+ .iter()
+ .zip(want.pixels.as_chunks::<4>().0)
+ .filter(|(a, b)| a.iter().zip(*b).any(|(x, y)| x.abs_diff(*y) > 48))
+ .count();
+ let share = differ as f64 / f64::from(want.width * want.height).max(1.0);
+ assert!(share < 0.002, "the program draws {:.2}% of the page differently", share * 100.0);
}
fn children(n: &Node) -> &[Arc<Node>] {
@@ -107,10 +203,12 @@ fn writes_the_documented_operators() {
] {
assert!(text.contains(needle), "missing {needle:?} in\n{text}");
}
- // The prolog defines the page trailer's `annotatepage` (§3), in the dictionary the setup begins.
+ // The prolog is the writer's own procedure set, named in the header, in the dictionary the
+ // setup begins; it defines the page trailer's `annotatepage` (§3).
let prolog = text.split("%%BeginProlog\n").nth(1).and_then(|t| t.split("%%EndProlog\n").next()).unwrap();
- assert!(prolog.contains("/VCLegacy 8 dict def\nVCLegacy begin\n/annotatepage {} bind def\nend\n"), "{prolog}");
- assert!(text.contains("%%DocumentSuppliedResources: procset VectorCraft_Legacy 1 0\n"), "{text}");
+ assert!(prolog.starts_with(&format!("%%BeginResource: procset {PROCSET}\n/VCLegacy ")), "{prolog}");
+ assert!(prolog.ends_with("end\n%%EndResource\n") && prolog.contains("\n/annotatepage {} bd\n"), "{prolog}");
+ assert!(text.contains(&format!("%%DocumentSuppliedResources: procset {PROCSET}\n")), "{text}");
// The hidden layer is written hidden: visible 0.
assert!(text.contains("%AI5_BeginLayer\n0 1 1 1 0 0 1 "), "{text}");
// Art space is y up from the artboard's bottom-left: the red square (10..40 down from the top)
@@ -287,6 +385,26 @@ fn art_stays_put_on_an_artboard_a_fraction_of_a_point_tall() {
assert!((b.x0 - 10.0).abs() < 1e-3 && (b.y0 - 20.0).abs() < 1e-3 && (b.y1 - 40.0).abs() < 1e-3, "{b:?}");
}
+/// The file prints as the document with every layer shown: run as a PostScript program
+/// ([`write_with`] checks it), its paths, fills, strokes, compound path, clipping group and image
+/// draw where and as the document has them (its gradient filled with its first stop's colour, as
+/// the prolog fills gradients). Read for its layers, it is read from its program, which has the
+/// gradient.
+#[test]
+fn prints_as_the_document() {
+ let mut doc = sample();
+ if let Some(l) = doc.layers.get_mut(1) {
+ Arc::make_mut(l).visible = true;
+ }
+ let out = write(&doc);
+ let read = crate::import(&out.bytes).unwrap().document;
+ let mut gradients = 0;
+ read.walk(|n| {
+ gradients += n.appearance.items.iter().filter(|i| matches!(i, AppearanceItem::Fill(f) if matches!(f.paint, Paint::Gradient(_)))).count()
+ });
+ assert_eq!((read.layers.len(), gradients), (2, 1));
+}
+
#[test]
fn needs_an_artboard() {
let mut doc = Document::new(100.0, 100.0);
diff --git a/docs/file-format-parity.md b/docs/file-format-parity.md
index 77c988ce3..9fd509f75 100644
--- a/docs/file-format-parity.md
+++ b/docs/file-format-parity.md
@@ -1,6 +1,6 @@
# File format parity
-> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-14 · **Change:** minor (legacy `.ai` of version 7 saved, with type as text, hidden objects and an artboard picker, and its type read, #868; 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: SVG `:not()` selectors, #1557, stacked selectors, #1703, linked files, #1870; DXF VPORT, #1789; nesting caps, #1852; hostile PDF, `.ai`, EPS, Affinity and native data, #1862, #1863, #1871–#1873; failed saves, #1685, #1693, #1694; type in symbols after reopening, #1738; scores unchanged; verified PngSuite downloads, #1729; EPS stitched shadings, #1653; oversized images in WMF/EMF refused from the header, #1776; PDF name trees with shared nodes, #1781; native size limits for files read from memory, #1783; private temporary files on Unix, #1778; ruzstd 0.9.1, #1807; scores unchanged; SVG import: CSS transforms and the `font` shorthand, #1565, percentage lengths in symbols, #1596, Inkscape flowed text and pages, #1568, #1601, filter warnings, #1598; type on a path from PDF and `.ai`, #1585, #1586; ICC tag alignment in JPEG, TIFF and PSD, #1584; saves to folders that refuse the temporary file, #1620 in part; scores unchanged; TIFF is available in Export for Screens and Asset Export with shared format settings; scores and hours unchanged; compact native saves for documents with a lot of path data, #1492; PDF and EPS paste as vector art, #1499; `.ai` gradient stops listed upwards, #1530; SVG text on basic shapes, #1527; PDF soft masks drawn as images, #1551; Type 42 fonts in EPS, #1553; clips that only seem to cover the page, #1542; images too large to decode are reported, #1540; a `.ai` page's art past its artboard no longer lies over the page before it when read as its PDF part; grayscale TIFFs with an alpha channel or extra channels place and open, #1466 in part; a faded or masked fill keeps its stroke apart on PDF and `.ai` import, #1434; SVG knockout groups without masks, #1435; Affinity import: a text frame too short for its first line is made taller, #1423; `.ai` editing data: a compound path takes its last path's paint and keeps paths grouped inside it, #1410; a `.ai` whose PDF part is only text opens from it, #1387; PDF and `.ai` import keep overprint, #1388; `.ai` editing data: gradients with middle stops, #1390; type of objects with an appearance, hidden layers and later artboards, #1391; area type in a frame too short for the fallback font, #1392; `.ai` editing data: placed (linked) files read, #1264; gradient-filled shapes import as paths, #1304; white constant alpha soft masks, #1286 in part; DXF control-point SPLINE closure read, #1299 follow-up; `.ai` and PDF trim and bleed boxes as artboard and bleed, #1266; `.ai` gradient matrices, meshes and artboard names from the editing data; `.ai` art styles, clipping fills and compound looks from the editing data; `editingData: "always"` opens a `.ai` from its editing data; a `.ai` whose PDF part is only text opens from it, #1387; PDF and `.ai` import keep overprint, #1388; `.ai` editing data: gradients with middle stops, #1390; type of objects with an appearance, hidden layers and later artboards, #1391; area type in a frame too short for the fallback font, #1392; `.ai` editing data: placed (linked) files read, #1264; gradient-filled shapes import as paths, #1304; white constant alpha soft masks, #1286 in part; DXF control-point SPLINE closure read, #1299 follow-up; `.ai` and PDF trim and bleed boxes as artboard and bleed, #1266; `.ai` gradient matrices, meshes and artboard names from the editing data; `.ai` art styles, clipping fills and compound looks from the editing data; a `.ai` whose PDF part is only text opens from it, #1387; PDF and `.ai` import keep overprint, #1388; `.ai` editing data: gradients with middle stops, #1390; type of objects with an appearance, hidden layers and later artboards, #1391; area type in a frame too short for the fallback font, #1392; `.ai` editing data: placed (linked) files read, #1264; gradient-filled shapes import as paths, #1304; white constant alpha soft masks, #1286 in part; DXF control-point SPLINE closure read, #1299 follow-up; `.ai` and PDF trim and bleed boxes as artboard and bleed, #1266; `.ai` gradient matrices, meshes and artboard names from the editing data; a `.ai` whose PDF part is only text opens from it, #1387; PDF and `.ai` import keep overprint, #1388; `.ai` editing data: gradients with middle stops, #1390; type of objects with an appearance, hidden layers and later artboards, #1391; area type in a frame too short for the fallback font, #1392; `.ai` editing data: placed (linked) files read, #1264; gradient-filled shapes import as paths, #1304; white constant alpha soft masks, #1286 in part; DXF control-point SPLINE closure read, #1299 follow-up; `.ai` and PDF trim and bleed boxes as artboard and bleed, #1266; SVG knockout groups of opaque art without masks; a `.ai` whose PDF part is only text opens from it, #1387; PDF and `.ai` import keep overprint, #1388; `.ai` editing data: gradients with middle stops, #1390; type of objects with an appearance, hidden layers and later artboards, #1391; area type in a frame too short for the fallback font, #1392; `.ai` editing data: placed (linked) files read, #1264; gradient-filled shapes import as paths, #1304; white constant alpha soft masks, #1286 in part; DXF control-point SPLINE closure read, #1299 follow-up; `.ai` and PDF trim and bleed boxes as artboard and bleed, #1266; `.ai` keeps its RGB numbers; PDF import keeps a stroke apart from a fill masked or faded by its group) · **Target:** Adobe Illustrator 2026 (30.x)
+> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-14 · **Change:** minor (legacy `.ai` runs as PostScript with a prolog of its own, #868; legacy `.ai` of version 7 saved, with type as text, hidden objects and an artboard picker, and its type read, #868; 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: SVG `:not()` selectors, #1557, stacked selectors, #1703, linked files, #1870; DXF VPORT, #1789; nesting caps, #1852; hostile PDF, `.ai`, EPS, Affinity and native data, #1862, #1863, #1871–#1873; failed saves, #1685, #1693, #1694; type in symbols after reopening, #1738; scores unchanged; verified PngSuite downloads, #1729; EPS stitched shadings, #1653; oversized images in WMF/EMF refused from the header, #1776; PDF name trees with shared nodes, #1781; native size limits for files read from memory, #1783; private temporary files on Unix, #1778; ruzstd 0.9.1, #1807; scores unchanged; SVG import: CSS transforms and the `font` shorthand, #1565, percentage lengths in symbols, #1596, Inkscape flowed text and pages, #1568, #1601, filter warnings, #1598; type on a path from PDF and `.ai`, #1585, #1586; ICC tag alignment in JPEG, TIFF and PSD, #1584; saves to folders that refuse the temporary file, #1620 in part; scores unchanged; TIFF is available in Export for Screens and Asset Export with shared format settings; scores and hours unchanged; compact native saves for documents with a lot of path data, #1492; PDF and EPS paste as vector art, #1499; `.ai` gradient stops listed upwards, #1530; SVG text on basic shapes, #1527; PDF soft masks drawn as images, #1551; Type 42 fonts in EPS, #1553; clips that only seem to cover the page, #1542; images too large to decode are reported, #1540; a `.ai` page's art past its artboard no longer lies over the page before it when read as its PDF part; grayscale TIFFs with an alpha channel or extra channels place and open, #1466 in part; a faded or masked fill keeps its stroke apart on PDF and `.ai` import, #1434; SVG knockout groups without masks, #1435; Affinity import: a text frame too short for its first line is made taller, #1423; `.ai` editing data: a compound path takes its last path's paint and keeps paths grouped inside it, #1410; a `.ai` whose PDF part is only text opens from it, #1387; PDF and `.ai` import keep overprint, #1388; `.ai` editing data: gradients with middle stops, #1390; type of objects with an appearance, hidden layers and later artboards, #1391; area type in a frame too short for the fallback font, #1392; `.ai` editing data: placed (linked) files read, #1264; gradient-filled shapes import as paths, #1304; white constant alpha soft masks, #1286 in part; DXF control-point SPLINE closure read, #1299 follow-up; `.ai` and PDF trim and bleed boxes as artboard and bleed, #1266; `.ai` gradient matrices, meshes and artboard names from the editing data; `.ai` art styles, clipping fills and compound looks from the editing data; `editingData: "always"` opens a `.ai` from its editing data; a `.ai` whose PDF part is only text opens from it, #1387; PDF and `.ai` import keep overprint, #1388; `.ai` editing data: gradients with middle stops, #1390; type of objects with an appearance, hidden layers and later artboards, #1391; area type in a frame too short for the fallback font, #1392; `.ai` editing data: placed (linked) files read, #1264; gradient-filled shapes import as paths, #1304; white constant alpha soft masks, #1286 in part; DXF control-point SPLINE closure read, #1299 follow-up; `.ai` and PDF trim and bleed boxes as artboard and bleed, #1266; `.ai` gradient matrices, meshes and artboard names from the editing data; `.ai` art styles, clipping fills and compound looks from the editing data; a `.ai` whose PDF part is only text opens from it, #1387; PDF and `.ai` import keep overprint, #1388; `.ai` editing data: gradients with middle stops, #1390; type of objects with an appearance, hidden layers and later artboards, #1391; area type in a frame too short for the fallback font, #1392; `.ai` editing data: placed (linked) files read, #1264; gradient-filled shapes import as paths, #1304; white constant alpha soft masks, #1286 in part; DXF control-point SPLINE closure read, #1299 follow-up; `.ai` and PDF trim and bleed boxes as artboard and bleed, #1266; `.ai` gradient matrices, meshes and artboard names from the editing data; a `.ai` whose PDF part is only text opens from it, #1387; PDF and `.ai` import keep overprint, #1388; `.ai` editing data: gradients with middle stops, #1390; type of objects with an appearance, hidden layers and later artboards, #1391; area type in a frame too short for the fallback font, #1392; `.ai` editing data: placed (linked) files read, #1264; gradient-filled shapes import as paths, #1304; white constant alpha soft masks, #1286 in part; DXF control-point SPLINE closure read, #1299 follow-up; `.ai` and PDF trim and bleed boxes as artboard and bleed, #1266; SVG knockout groups of opaque art without masks; a `.ai` whose PDF part is only text opens from it, #1387; PDF and `.ai` import keep overprint, #1388; `.ai` editing data: gradients with middle stops, #1390; type of objects with an appearance, hidden layers and later artboards, #1391; area type in a frame too short for the fallback font, #1392; `.ai` editing data: placed (linked) files read, #1264; gradient-filled shapes import as paths, #1304; white constant alpha soft masks, #1286 in part; DXF control-point SPLINE closure read, #1299 follow-up; `.ai` and PDF trim and bleed boxes as artboard and bleed, #1266; `.ai` keeps its RGB numbers; PDF import keeps a stroke apart from a fill masked or faded by its group) · **Target:** Adobe Illustrator 2026 (30.x)
Every format Illustrator opens, places, saves or exports, against VectorCraft's format table (`FORMATS`,
`OPEN_EXTS`, `PLACE_EXTS` in `crates/engine/src/cmd/fileio/mod.rs`). Illustrator's list comes from its public
@@ -56,6 +56,10 @@ private editing data. VectorCraft:
all type as outlines. The format can hide only layers: hidden objects go to a hidden layer of their own above
their layer, are omitted, or are made visible (Hidden Objects, `hiddenObjects: "layer"|"omit"|"visible"`).
Sublayers become groups; appearances, effects and brushes are expanded; object names are left out.
+ The file is also a PostScript program that runs: its prolog, a procedure set of VectorCraft's own written from
+ the PostScript Language Reference, gives the format's operators their meaning, so it prints and previews
+ (gradients filled with their first stop's colour, type left to the apps that read the format). VectorCraft
+ opens a file with that prolog from its program, as the format.
- **Known failures in users' files:** layer structure flattened or multiplied (#951: 109 layers instead of
14; #868: round trip with Illustrator 2018 loses layers and groups), guides and non-printing construction
lines lost (#779), some files 4× slower to open since the editing data is read whole (#758), live effects,
@@ -107,6 +111,7 @@ the app's own editing copy of a file (an EPS after its `%%EOF`, a `.ai`'s `AIPri
| Date | Change | Summary |
|---|---|---|
+| 2026-10-14 | minor | Legacy `.ai` of version 7 runs as a PostScript program: its prolog is a procedure set of VectorCraft's own that gives each operator the writer uses its meaning (paths, colours, compound paths, clipping groups, layers that don't print, images; gradients flat, type not set), and the page trailer's `annotatepage` (§3 of the specification) marks nothing; every file the writer's tests write is run through VectorCraft's PostScript reader and must draw what the document it was written from draws (#868) |
| 2026-10-14 | minor | SVG import: `:not()` selectors (#1799, #1557), stacked descendant selectors over deep nesting no longer stall (#1834, #1703), linked files within the automation roots again (#1870); DXF export writes the VPORT view direction once (#1789); nesting capped at 32 objects with self-using symbols and patterns opened without the offending instance (#1852); deep and self-referencing PDF and `.ai` data (#1871), decompression bombs (#1873), self-drawing brushes (#1872), hostile EPS, Affinity and native data (#1863) and huge ids (#1862) handled; a failed save is reported in a dialog and the old file is kept (#1865, #1685, #1693, #1694); type inside symbols gets its layout bounds back on opening a native file (#1833, #1738). Scores unchanged (estimated) |
| 2026-10-13 | minor | Pinned PngSuite HTTPS files verified by SHA-256 before publication; bounded downloads replace archive extraction (#1729). Scores and hours unchanged. |
| 2026-10-14 | minor | EPS import: a stitched shading keeps its hard colour changes (#1654, #1653); WMF/EMF import refuses an oversized embedded PNG or JPEG from its header, before any pixels are decoded (#1776); PDF open no longer takes exponential time on a crafted name tree with shared nodes when it looks for the editing data (#1781); The size limits on a native file's embedded data also apply to files read from memory, not only streamed ones (#1783); Saving over a private file on Unix no longer leaves a readable temporary copy beside it while the file is written (#1778); An Export for Screens suffix can no longer place files outside the export folder (#1777); Package refuses a folder where it would overwrite the open document or one of its linked files (#1786); ruzstd 0.9.1 fixes a decompression bomb (RUSTSEC-2026-0344) reachable from EPS/`.ai` and Affinity import (#1807); File Info dates are stamped only after a save succeeds, so a failed save no longer changes them (#1774); Linked files that change during a drag are updated after the drag instead of being missed (#1773); scores unchanged |