mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-07 12:13:19 +00:00
.ai save: objects next to type keep their own transparency
The reader gives an Xy right after a compound path or a text object to that object. The writer now writes XR before the Xy of type, images and guides, so type next to type, a compound path before type, image or guide, and type before an image or guide keep their own opacity, blend mode and knockout shape flag. - Type keeps its Isolate Blending and Knockout Group state in a state block after its text object, as its outlines did on their group. - The reader no longer gives a layer the Xy before its last text object. - The ASCII85 end marker of the text document stays on one line. - The warning and docs/file-format-parity.md also list area type in an open frame, type on an open path whose ends meet, type of only white space and threads of type on a path as written as outlines. - README.md, ROADMAP.md, docs/gaps.md, docs/roadmap.md and docs/target-app-parity.md describe the editing copy a saved .ai holds. - clip_path's doc comment is back on clip_path. - import_fuzz reaches threaded area type and vertical type.
This commit is contained in:
@@ -253,7 +253,7 @@ The scores are self-assessed from our code against public documentation;
|
||||
[target-app-parity.md](docs/target-app-parity.md#how-this-was-measured-2026-10-10) explains how far to trust them.
|
||||
|
||||
**What's missing:**
|
||||
- reliable exchange of .ai files (layer structure in real files; proprietary editing data isn't written);
|
||||
- reliable exchange of .ai files (layer structure in real files; the editing copy a save writes leaves out live effects and writes symbols and live objects as their art);
|
||||
- an interaction-fidelity pass covering every tool's modifiers and small behaviours;
|
||||
- 3D and Materials beyond the initial live Revolve (Extrude & Bevel, Inflate, Rotate, materials);
|
||||
- filter thumbnails and a preview area inside the Effect Gallery (the gallery itself and all 57 Photoshop-style raster filters, approximated, are in);
|
||||
|
||||
+2
-2
@@ -23,8 +23,8 @@ and the work list in [`docs/gaps.md`](docs/gaps.md).
|
||||
|
||||
**Why alpha:** the core workflows exist end to end (drawing and path editing, Pathfinder, paint and appearance,
|
||||
type, SVG/PDF/EPS, print, export) and feature depth is ~75%, but a professional can't yet switch: Illustrator's
|
||||
own `.ai` files open with a wrong layer structure in real cases and can't be saved back with Illustrator's
|
||||
editing data, the interaction details have never been checked side by side, and some machines fail to start the
|
||||
own `.ai` files open with a wrong layer structure in real cases and are saved back with an editing copy that
|
||||
leaves out live effects and writes symbols and live objects as their art, the interaction details have never been checked side by side, and some machines fail to start the
|
||||
app. Beta needs those closed (the beta list in [gaps.md](docs/gaps.md)). It passes the core-workflow
|
||||
gate: all six core workflows (path drawing and editing, paint and style, type, layers/artboards/export, print
|
||||
production, file exchange) work end to end on macOS with save and reopen, and only the last is partial, without
|
||||
|
||||
@@ -3413,9 +3413,9 @@ proptest! {
|
||||
survive("hostile .ai images and placed files", || Some(vectorcraft_eps::layered_ai(&private, Document::new(100.0, 100.0), vec![], false, false, 1.0).0))?;
|
||||
}
|
||||
|
||||
/// A `.ai` whose type (point type turned, area type and type on a path, their stubs with the
|
||||
/// frames' paths, and the text document they name, as the `.ai` writer writes them) is damaged:
|
||||
/// read from its editing data alone and beside a page.
|
||||
/// A `.ai` whose type (point type turned, vertical type, area type, threaded area type and type
|
||||
/// on a path, their stubs with the frames' paths, and the text document they name, as the `.ai`
|
||||
/// writer writes them) is damaged: read from its editing data alone and beside a page.
|
||||
#[test]
|
||||
fn ai_text_documents_never_panic(
|
||||
cut in 0usize..30_000,
|
||||
@@ -3433,12 +3433,29 @@ proptest! {
|
||||
let mut on_path = TextObject::point(Point::ZERO, "On a path", CharStyle::default());
|
||||
on_path.kind = TextKind::OnPath { path: shapes::ellipse(Rect::new(100.0, 20.0, 180.0, 80.0)), start: 0.25, end: None };
|
||||
on_path.xf = Affine::IDENTITY;
|
||||
for t in [point, area, on_path] {
|
||||
let mut down = TextObject::point(Point::new(190.0, 10.0), "Down", CharStyle::default());
|
||||
down.vertical = true;
|
||||
let mut down_area = area.clone();
|
||||
down_area.vertical = true;
|
||||
down_area.kind = TextKind::Area { frame: shapes::rectangle(Rect::new(150.0, 40.0, 180.0, 90.0)) };
|
||||
let mut first = area.clone();
|
||||
first.kind = TextKind::Area { frame: shapes::rectangle(Rect::new(20.0, 5.0, 50.0, 35.0)) };
|
||||
first.runs = vec![vectorcraft_doc::TextRun::new("A story through two frames", CharStyle::default())];
|
||||
let mut second = first.clone();
|
||||
second.kind = TextKind::Area { frame: shapes::rectangle(Rect::new(60.0, 5.0, 90.0, 35.0)) };
|
||||
second.runs = vec![vectorcraft_doc::TextRun::new("", CharStyle::default())];
|
||||
for t in [point, area, on_path, down, down_area] {
|
||||
let n = Node::new(doc.alloc_id(), NodeKind::Text(Box::new(t)));
|
||||
doc.insert(Some(layer), usize::MAX, n).unwrap();
|
||||
}
|
||||
let (first, second) = (Node::new(doc.alloc_id(), NodeKind::Text(Box::new(first))), Node::new(doc.alloc_id(), NodeKind::Text(Box::new(second))));
|
||||
doc.text_threads.push(vec![first.id, second.id]);
|
||||
doc.insert(Some(layer), usize::MAX, first).unwrap();
|
||||
doc.insert(Some(layer), usize::MAX, second).unwrap();
|
||||
let program = vectorcraft_eps::export_ai_editing(&doc, &vectorcraft_eps::AiEditingOptions::default()).unwrap().program;
|
||||
let text = mutate_text(&String::from_utf8_lossy(&program), cut, &edits);
|
||||
let written = String::from_utf8_lossy(&program);
|
||||
prop_assert_eq!(written.matches("/AI11Text :").count(), 7, "every text object is written as text");
|
||||
let text = mutate_text(&written, cut, &edits);
|
||||
let private = [b"%AI24_ZStandard_Data".as_slice(), &zstd(&text)].concat();
|
||||
survive("hostile .ai type", || vectorcraft_eps::ai_alone(&private).ok().map(|r| r.0))?;
|
||||
survive("hostile .ai type beside a page", || Some(vectorcraft_eps::layered_ai(&private, Document::new(200.0, 100.0), vec![], false, false, 1.0).0))?;
|
||||
|
||||
@@ -3725,6 +3725,168 @@ fn the_knockout_shape_of_type_comes_back() {
|
||||
assert_eq!((n.opacity, n.knockout_shape), (0.5, true));
|
||||
}
|
||||
|
||||
/// The kinds of object that write no paint before their `Xy` or no state block after them, and a
|
||||
/// group, which writes a state block.
|
||||
#[derive(Clone, Copy, Debug)]
|
||||
enum Beside {
|
||||
Type,
|
||||
Compound,
|
||||
Image,
|
||||
Guide,
|
||||
Group,
|
||||
}
|
||||
|
||||
/// An object of `kind` at `x`, with opacity, blending mode and knockout shape flag `state`.
|
||||
fn beside(doc: &mut Document, kind: Beside, x: f64, state: (f32, BlendMode, bool)) -> Node {
|
||||
let r = Rect::new(x, 10.0, x + 20.0, 30.0);
|
||||
let mut n = match kind {
|
||||
Beside::Type => {
|
||||
let t = vectorcraft_doc::TextObject::point(vectorcraft_geom::Point::new(x, 40.0), "Hi", style(10.0, Color::BLACK));
|
||||
text_node(doc, t)
|
||||
}
|
||||
Beside::Compound => {
|
||||
let outer = Node::path(doc.alloc_id(), shapes::rectangle(r), Appearance::default());
|
||||
let inner = Node::path(doc.alloc_id(), shapes::rectangle(Rect::new(x + 5.0, 15.0, x + 15.0, 25.0)), Appearance::default());
|
||||
let mut ring =
|
||||
Node::new(doc.alloc_id(), NodeKind::Compound { children: vec![Arc::new(outer), Arc::new(inner)], rule: FillRule::EvenOdd });
|
||||
ring.appearance = Appearance::basic(solid(BRAND), Paint::None, 0.0).into();
|
||||
ring
|
||||
}
|
||||
Beside::Image => {
|
||||
let mut png = vec![];
|
||||
let img = image::RgbaImage::from_raw(1, 1, vec![255, 0, 0, 255]).unwrap();
|
||||
img.write_to(&mut std::io::Cursor::new(&mut png), image::ImageFormat::Png).unwrap();
|
||||
let blob = ImageBlob::new("image/png", png);
|
||||
let key = blob.content_key();
|
||||
doc.images.insert(key.clone(), blob);
|
||||
let xf = Affine::new([10.0, 0.0, 0.0, 10.0, x, 10.0]);
|
||||
let im = ImageObject { key, width: 1, height: 1, xf, link: None, placement: Default::default(), pixels: None };
|
||||
Node::new(doc.alloc_id(), NodeKind::Image(Box::new(im)))
|
||||
}
|
||||
Beside::Guide => Node::new(
|
||||
doc.alloc_id(),
|
||||
NodeKind::Path { path: shapes::rectangle(r), rule: FillRule::NonZero, live: None, clipping: false, guide: true },
|
||||
),
|
||||
Beside::Group => {
|
||||
let member = square(doc, r, BRAND);
|
||||
group(doc, vec![member], false)
|
||||
}
|
||||
};
|
||||
(n.opacity, n.blend, n.knockout_shape) = state;
|
||||
n
|
||||
}
|
||||
|
||||
/// Two objects next to each other come back with their own opacity, blending mode and knockout
|
||||
/// shape flag, whichever is first and whichever is opaque: an `Xy` right after a text object or a
|
||||
/// compound path is theirs when no other operator comes between. The layer's stays its own.
|
||||
#[test]
|
||||
fn objects_next_to_each_other_keep_their_own_transparency() {
|
||||
use Beside::{Compound, Group, Guide, Image, Type};
|
||||
let (clear, screen, plain) = ((0.5, BlendMode::Multiply, true), (0.25, BlendMode::Screen, false), (1.0, BlendMode::Normal, false));
|
||||
let pairs = [
|
||||
(Type, Type),
|
||||
(Compound, Type),
|
||||
(Group, Type),
|
||||
(Type, Group),
|
||||
(Type, Compound),
|
||||
(Type, Image),
|
||||
(Type, Guide),
|
||||
(Compound, Image),
|
||||
(Compound, Guide),
|
||||
];
|
||||
for (a, b) in pairs {
|
||||
for (first, second) in [(clear, plain), (plain, clear), (clear, screen), (clear, clear)] {
|
||||
let mut doc = Document::new(200.0, 100.0);
|
||||
let layer = doc.layers[0].id;
|
||||
let (x, y) = (beside(&mut doc, a, 10.0, first), beside(&mut doc, b, 60.0, second));
|
||||
doc.insert(Some(layer), usize::MAX, x).unwrap();
|
||||
doc.insert(Some(layer), usize::MAX, y).unwrap();
|
||||
let back = read_back(&doc);
|
||||
let at = format!("{a:?} {first:?} then {b:?} {second:?}");
|
||||
let kids = back.layers[0].children().unwrap();
|
||||
assert_eq!(kids.len(), 2, "{at}");
|
||||
for (n, (kind, want)) in kids.iter().zip([(a, first), (b, second)]) {
|
||||
// The reader takes no knockout shape flag for an image.
|
||||
let want = if matches!(kind, Image) { (want.0, want.1, false) } else { want };
|
||||
assert_eq!((n.opacity, n.blend, n.knockout_shape), want, "{at}");
|
||||
}
|
||||
let l = &back.layers[0];
|
||||
assert_eq!((l.opacity, l.blend, l.knockout_shape), plain, "the layer's own: {at}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// A layer whose last object is type keeps its own transparency, and the type keeps its.
|
||||
#[test]
|
||||
fn type_last_in_a_transparent_layer_keeps_its_own_transparency() {
|
||||
let mut doc = Document::new(200.0, 100.0);
|
||||
let layer = doc.layers[0].id;
|
||||
let text = beside(&mut doc, Beside::Type, 10.0, (0.5, BlendMode::Multiply, true));
|
||||
doc.insert(Some(layer), usize::MAX, text).unwrap();
|
||||
let l = Arc::make_mut(&mut doc.layers[0]);
|
||||
(l.opacity, l.blend) = (0.75, BlendMode::Screen);
|
||||
let back = read_back(&doc);
|
||||
let (l, n) = (&back.layers[0], &back.layers[0].children().unwrap()[0]);
|
||||
assert_eq!((l.opacity, l.blend), (0.75, BlendMode::Screen));
|
||||
assert_eq!((n.opacity, n.blend, n.knockout_shape), (0.5, BlendMode::Multiply, true));
|
||||
}
|
||||
|
||||
/// Isolate Blending and the Knockout Group state of type come back, named or not and whatever
|
||||
/// follows it, as outlines kept them on their group, and are written again as the same bytes.
|
||||
#[test]
|
||||
fn the_isolation_and_knockout_of_type_come_back() {
|
||||
for name in [None, Some("Title")] {
|
||||
let cases = [(true, Knockout::On), (false, Knockout::On), (false, Knockout::Off), (true, Knockout::Neutral), (false, Knockout::Neutral)];
|
||||
let mut doc = Document::new(200.0, 100.0);
|
||||
let layer = doc.layers[0].id;
|
||||
for (i, (isolate, knockout)) in cases.into_iter().enumerate() {
|
||||
let mut n = beside(&mut doc, Beside::Type, 10.0 + 30.0 * i as f64, (0.5, BlendMode::Multiply, false));
|
||||
(n.isolate, n.knockout) = (isolate, knockout);
|
||||
n.name = name.map(|s| format!("{s} {i}"));
|
||||
doc.insert(Some(layer), usize::MAX, n).unwrap();
|
||||
}
|
||||
let after = beside(&mut doc, Beside::Compound, 170.0, (1.0, BlendMode::Normal, false));
|
||||
doc.insert(Some(layer), usize::MAX, after).unwrap();
|
||||
let back = read_back(&doc);
|
||||
let kids = back.layers[0].children().unwrap();
|
||||
assert_eq!(kids.len(), cases.len() + 1);
|
||||
for (i, (n, (isolate, knockout))) in kids.iter().zip(cases).enumerate() {
|
||||
assert!(matches!(n.kind, NodeKind::Text(_)));
|
||||
assert_eq!((n.isolate, n.knockout, n.opacity, n.blend), (isolate, knockout, 0.5, BlendMode::Multiply), "{i}");
|
||||
assert_eq!(n.name, name.map(|s| format!("{s} {i}")));
|
||||
}
|
||||
assert_eq!(kids[cases.len()].opacity, 1.0);
|
||||
let art = |d: &Document| program(d).split_once("%%EndSetup").map(|(_, art)| art.to_string()).unwrap();
|
||||
assert_eq!(art(&back), art(&doc));
|
||||
}
|
||||
}
|
||||
|
||||
/// The end marker of the text document stays on one line wherever the ASCII85 ends: the reader
|
||||
/// looks for `~>` in the lines as they are, before it joins them.
|
||||
#[test]
|
||||
fn the_end_marker_of_the_text_document_stays_on_one_line() {
|
||||
let mut at_the_boundary = 0;
|
||||
// A character is two bytes: sizes of more digits reach the lengths that characters don't.
|
||||
for size in [10.0, 10.25, 10.125, 10.0625] {
|
||||
for len in 1..=60 {
|
||||
let mut doc = Document::new(200.0, 100.0);
|
||||
let layer = doc.layers[0].id;
|
||||
let text = "x".repeat(len);
|
||||
let t = vectorcraft_doc::TextObject::point(vectorcraft_geom::Point::new(10.0, 40.0), &text, style(size, Color::BLACK));
|
||||
let t = text_node(&mut doc, t);
|
||||
doc.insert(Some(layer), usize::MAX, t).unwrap();
|
||||
let p = program(&doc);
|
||||
assert!(!p.contains("~\n%>"), "{size} {len}");
|
||||
// A full line (`%` and 100 characters) that the `>` goes past.
|
||||
at_the_boundary += usize::from(p.lines().any(|l| l.len() == 102 && l.ends_with("~>")));
|
||||
let back = read_back(&doc);
|
||||
let NodeKind::Text(read) = &back.layers[0].children().unwrap()[0].kind else { panic!("{size} {len}: not type") };
|
||||
assert_eq!(read.plain_text(), text);
|
||||
}
|
||||
}
|
||||
assert!(at_the_boundary > 0, "no length put the `~` at the end of a line");
|
||||
}
|
||||
|
||||
/// An empty frame after a slice that ends with a paragraph break holds the story's last paragraph,
|
||||
/// and that paragraph comes back with the empty frame's style.
|
||||
#[test]
|
||||
|
||||
@@ -32,7 +32,7 @@ pub(super) use texts::TYPE_ATTRIBUTES;
|
||||
/// [`vectorcraft_doc::MAX_DEPTH`].
|
||||
const MAX_NEST: u32 = 8;
|
||||
|
||||
pub(super) const TYPE: &str = "type in opacity masks, pattern tiles and art cut to a clipping object, mirrored type, area type and type on a path that is turned or unevenly scaled or whose frame or path has several parts, area type that flows around a text wrap, threads whose frames differ in orientation or hold a frame written as outlines, type of sizes past what the reader reads, stories past what the reader reads (1,048,576 bytes a story, 16,777,216 bytes in all, and the size of text document it reads), and type with inline graphics, ruby, gradient or pattern paint, or fills, strokes, effects or an opacity mask of the object's own, is written as its outlines in the editing data for other apps";
|
||||
pub(super) const TYPE: &str = "type in opacity masks, pattern tiles and art cut to a clipping object, mirrored type, area type and type on a path that is turned or unevenly scaled or whose frame or path has several parts, area type in an open frame, type on an open path whose ends meet, area type that flows around a text wrap, type of only white space, threads of type on a path, threads whose frames differ in orientation or hold a frame written as outlines, type of sizes past what the reader reads, stories past what the reader reads (1,048,576 bytes a story, 16,777,216 bytes in all, and the size of text document it reads), and type with inline graphics, ruby, gradient or pattern paint, or fills, strokes, effects or an opacity mask of the object's own, is written as its outlines in the editing data for other apps";
|
||||
pub(super) const PATTERNS: &str = "pattern fills whose tiles aren't a grid or whose art reaches past the tile, pattern fills in another pattern's tile and pattern fills nested more than 8 deep are written as their tiles cut to the shape in the editing data for other apps";
|
||||
pub(super) const PATTERN_TILES: &str = "pattern fills with more tiles than a fill places are written filled gray in the editing data for other apps";
|
||||
pub(super) const CLIPPING: &str = "clipping groups and clipping layers whose clipping object isn't a path, and the clipping groups inside them, are written as their art cut to that object in the editing data for other apps";
|
||||
@@ -338,6 +338,16 @@ impl<'a> Writer<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
/// [`Self::set_xy`] for an object that writes no paint before its transparency (type, an image,
|
||||
/// a guide): `XR` comes first, as in [`Self::paint_state`], because an `Xy` right after a compound
|
||||
/// path or a text object would be theirs.
|
||||
fn set_object_xy(&mut self, xy: Xy) {
|
||||
if self.gs != Some(xy) {
|
||||
self.line("0 XR");
|
||||
self.write_xy(xy);
|
||||
}
|
||||
}
|
||||
|
||||
/// `mode opacity isolate knockout shape Xy`.
|
||||
fn write_xy(&mut self, xy: Xy) {
|
||||
let knockout = match xy.knockout {
|
||||
@@ -356,6 +366,11 @@ impl<'a> Writer<'a> {
|
||||
/// dictionary goes between the two ([`Self::node`]).
|
||||
fn end_group(&mut self, close: &str, xy: Xy) {
|
||||
self.line(close);
|
||||
self.state_block(xy);
|
||||
}
|
||||
|
||||
/// The state block of the group or text object just written ([`Self::end_group`]).
|
||||
fn state_block(&mut self, xy: Xy) {
|
||||
self.block_start = self.body.len();
|
||||
if xy == Xy::PLAIN {
|
||||
self.line("9 () XW");
|
||||
@@ -397,7 +412,7 @@ impl<'a> Writer<'a> {
|
||||
if *guide {
|
||||
// Its own transparency, not the one the object before it set.
|
||||
if path.subpaths.iter().any(|sp| !sp.anchors.is_empty()) {
|
||||
self.set_xy(xy.object());
|
||||
self.set_object_xy(xy.object());
|
||||
}
|
||||
ai_ops::guide(&mut self.body, self.to_art, path, true);
|
||||
} else {
|
||||
@@ -836,7 +851,7 @@ impl<'a> Writer<'a> {
|
||||
|
||||
/// The paint of a path of transparency `xy` filled by `rule`: its fill color and `O`, its stroke
|
||||
/// color and `R`, `Xy`, the line style, `XR`. Without paint, `XR` comes first: an `Xy` right
|
||||
/// after a group or compound path would be theirs.
|
||||
/// after a compound path or a text object would be theirs.
|
||||
fn paint_state(&mut self, fill: Option<&FillLayer>, stroke: Option<&StrokeLayer>, xy: Xy, rule: FillRule) {
|
||||
let rule = if rule == FillRule::EvenOdd { "1 XR" } else { "0 XR" };
|
||||
if let Some(f) = fill {
|
||||
@@ -908,9 +923,13 @@ impl<'a> Writer<'a> {
|
||||
if lost {
|
||||
self.warn(texts::TYPE_ATTRIBUTES);
|
||||
}
|
||||
// The stub takes the transparency set before it, as a path does.
|
||||
self.set_xy(xy.object());
|
||||
// The stub takes the transparency set before it, as a path does. Its isolation and knockout
|
||||
// are read only from a state block after it, as a group's are.
|
||||
self.set_object_xy(xy.object());
|
||||
texts::stub(&mut self.body, story, frame, t, self.to_art);
|
||||
if xy.isolate || xy.knockout != Knockout::Neutral {
|
||||
self.state_block(xy);
|
||||
}
|
||||
}
|
||||
|
||||
/// Type `n` as a group of what Type › Create Outlines makes of it
|
||||
@@ -1183,9 +1202,6 @@ fn compound_path(n: &Node) -> PathData {
|
||||
PathData::new(subpaths)
|
||||
}
|
||||
|
||||
/// The outline and fill rule a clipping path or compound path `n` clips by; `None` for other
|
||||
/// clipping objects and for a path without points (it clips everything away, see
|
||||
/// [`Writer::clip_contents`]).
|
||||
/// Is object `id` of `doc` in (or inside) a clipping group or clipping layer whose clipping object
|
||||
/// isn't a path or compound path (its art is written cut to that object, [`Writer::clip_group`])?
|
||||
/// Type that is a clipping object is one of these: it isn't a path.
|
||||
@@ -1198,6 +1214,9 @@ fn cut_to_clipping_object(doc: &Document, id: NodeId) -> bool {
|
||||
})
|
||||
}
|
||||
|
||||
/// The outline and fill rule a clipping path or compound path `n` clips by; `None` for other
|
||||
/// clipping objects and for a path without points (it clips everything away, see
|
||||
/// [`Writer::clip_contents`]).
|
||||
fn clip_path(n: &Node) -> Option<(PathData, FillRule)> {
|
||||
let (path, rule) = match &n.kind {
|
||||
NodeKind::Path { path, rule, guide: false, .. } => (path.clone(), *rule),
|
||||
|
||||
@@ -115,7 +115,7 @@ impl Writer<'_> {
|
||||
if cut.is_some() {
|
||||
self.line("q");
|
||||
}
|
||||
self.set_xy(xy.object());
|
||||
self.set_object_xy(xy.object());
|
||||
// The object places the image's own pixel grid (its width × height) wherever the file's is.
|
||||
let fit =
|
||||
Affine::scale_non_uniform(f64::from(im.width.max(1)) / f64::from(samples.width), f64::from(im.height.max(1)) / f64::from(samples.height));
|
||||
|
||||
@@ -886,11 +886,12 @@ impl TextDoc {
|
||||
}
|
||||
let packed: String = ps::ascii85(&bytes).chars().filter(|c| !c.is_whitespace()).collect();
|
||||
let mut s = String::from("%AI11_BeginTextDocument\n/AI11TextDocument : /ASCII85Decode ,\n");
|
||||
// Each line starts with `%`, and no line's data starts with `_` (a `%_` line is content).
|
||||
// Each line starts with `%`, no line's data starts with `_` (a `%_` line is content), and the
|
||||
// end marker `~>` stays on one line (the reader looks for it before it joins the lines).
|
||||
let mut col = 0;
|
||||
s.push('%');
|
||||
for ch in packed.chars() {
|
||||
if col >= LINE && ch != '_' {
|
||||
if col >= LINE && ch != '_' && !(ch == '>' && s.ends_with('~')) {
|
||||
s.push_str("\n%");
|
||||
col = 0;
|
||||
}
|
||||
|
||||
@@ -36,6 +36,8 @@ impl<'a> Reader<'a> {
|
||||
n.opacity = gs.opacity;
|
||||
n.blend = gs.blend;
|
||||
n.knockout_shape = gs.knockout_shape;
|
||||
// An `Xy` before the text object was the object's, not its layer's, when the layer's `LB` follows.
|
||||
self.layer_state = None;
|
||||
let hidden = self.obj_hidden;
|
||||
self.add(n, hidden)
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ from the public specifications, and users' own `.ai` files are used locally only
|
||||
| | Illustrator | VectorCraft | Notes |
|
||||
|---|---:|---:|---|
|
||||
| Formats opened or placed | ~30 | 29 | missing: FreeHand, CorelDRAW, DWG, HEIC/HEIF, PICT, PS |
|
||||
| Formats saved (Save As) | 6 (AI, AIT, PDF, EPS, SVG, SVGZ) | 6 + native | `.ai` written PDF-compatible (with an editing copy of the art: layers, groups, paths, colors, gradients, patterns, artboards, transparency, opacity masks, clipping) or as legacy version 7 (layers and groups, one artboard per file) |
|
||||
| Formats saved (Save As) | 6 (AI, AIT, PDF, EPS, SVG, SVGZ) | 6 + native | `.ai` written PDF-compatible (with an editing copy of the art: layers, groups, paths, colors, gradients, patterns, images, type, artboards, transparency, opacity masks, clipping) or as legacy version 7 (layers and groups, one artboard per file) |
|
||||
| Formats exported | ~16 | 17 | missing: DWG, 3D (OBJ/USDA/glTF); extra: GIF/PNG-8 palette export, DXF up to 2018, layered PSD |
|
||||
| **Overall (weighted by use)** | | **~75%** | `.ai` and PDF dominate the weighting |
|
||||
|
||||
@@ -78,8 +78,9 @@ private editing data. VectorCraft:
|
||||
each, naming its story in the text document, with the characters, fonts, sizes, leading, tracking, baseline shift,
|
||||
scales, solid fills and strokes, capitals and paragraph alignment, indents, spacing and direction; other character
|
||||
and paragraph attributes are left out with a warning. Type in opacity masks, pattern tiles and art cut to a
|
||||
clipping object, mirrored type, turned or unevenly scaled area type and type on a path, area type that flows around a text
|
||||
wrap, threads whose frames differ in orientation, type and stories past the sizes VectorCraft's reader reads, and
|
||||
clipping object, mirrored type, turned or unevenly scaled area type and type on a path, area type in an open frame,
|
||||
type on an open path whose ends meet, area type that flows around a text wrap, type of only white space, threads of
|
||||
type on a path, threads whose frames differ in orientation, type and stories past the sizes VectorCraft's reader reads, and
|
||||
type with inline graphics, ruby, gradient or pattern paint or an appearance or opacity mask of its own, other patterns, symbols, other clipping objects and live
|
||||
objects (placed documents included) are written as plain filled and stroked paths, and freeform gradients, gradients along
|
||||
or across a stroke and gradients without stops, with more than 256 stops or without extent as their average
|
||||
|
||||
@@ -199,6 +199,13 @@ from G14 and the budget run of G15: **~170–270 h** one agent, ~50–80 h wall
|
||||
art with strokes, gradients or patterns) and type with an Art brush keep the drawn look.
|
||||
|
||||
- **Missing:** faithful layer and group structure from the editing data in real files (#951: 109 layers instead
|
||||
of 14), open speed on large files (#758), live effects, Scatter, Art, Pattern and Bristle brushes on paths, a
|
||||
path's own Calligraphic brush settings, and symbols as live objects (#637; plain art styles read Drop Shadow, Outer Glow and Feather as live effects; pattern fills and global colours are read since #1025, placed (linked) files since #1264). A PDF-compatible `.ai` carries an editing copy of the art in the form
|
||||
VectorCraft's reader reads (layers, groups, paths, colors, gradients, patterns, images, transparency, opacity masks,
|
||||
clipping and type as text), with live effects left out and symbols and live objects written as their art
|
||||
([file-format-parity.md](file-format-parity.md)). Save As
|
||||
`.ai` › Version: Legacy (version 7) writes the PostScript form from the published version 7 specification,
|
||||
keeping layers (names, order, visibility, lock), groups, compound paths, clipping groups, gradients and
|
||||
of 14), open speed on large files (#758), live effects, Scatter, Pattern and Bristle brushes on paths, the Art
|
||||
brushes listed above as keeping the drawn look, a path's own Calligraphic or Art brush settings, and symbols as live objects (#637; plain art styles read Drop Shadow, Outer Glow and Feather as live effects; pattern fills and global colours are read since #1025, placed (linked) files since #1264). Writing Illustrator's own editing data is out of scope
|
||||
(undocumented): a PDF-compatible `.ai` opens in Illustrator 2018 without its layers and groups (#868). Save As
|
||||
|
||||
+1
-1
@@ -88,7 +88,7 @@ Checked 2026-10-10 from the code, tests and open issues; no workflow fails, so V
|
||||
| Set type: point and area type, Character and Paragraph styles, threading, outlines | yes | type core 80%; styles, threading, Create Outlines and font matching tested ([type-parity.md](type-parity.md)); justification options missing (not blocking) | 0 |
|
||||
| Organise layers and artboards and export assets (Export for Screens, SVG, PNG, PDF per artboard) | yes | Layers panel rework, Artboards panel and tool, Export for Screens and Asset Export done; Art Optimized supersample closes ghost borders (#983 / #1037) | 0 |
|
||||
| Print production: CMYK and spot colour, bleed and marks, PDF/X out, separations preview | yes | PDF/X-1a/3/4, presets, marks and bleed, ICC output intent, Separations Preview, Print with PostScript output | 0 |
|
||||
| Exchange files with Illustrator users: open their `.ai`/EPS/PDF, hand back a file they can open | partial (doesn't block alpha) | `.ai`, EPS and PDF open as editable art, but real files can get the wrong layer structure (#951); Save As `.ai` is PDF-compatible, which Illustrator opens without its own editing data (#868), or legacy version 7, which keeps layers, groups and type as text, one artboard per file, and waits for users' testing. EPS legacy mesh corners, vector opacity masks and raster print-page comparison now preserve editable art under synthetic regressions. This is the beta main-format gap ([gaps.md](gaps.md) G9) | 10–20 (for beta) |
|
||||
| Exchange files with Illustrator users: open their `.ai`/EPS/PDF, hand back a file they can open | partial (doesn't block alpha) | `.ai`, EPS and PDF open as editable art, but real files can get the wrong layer structure (#951); Save As `.ai` is PDF-compatible with an editing copy of the art (layers, groups, paths, colors, gradients, patterns, images, transparency, opacity masks, clipping and type as text, with live effects left out and symbols and live objects written as their art; #868), or legacy version 7, which keeps layers, groups and type as text, one artboard per file, and waits for users' testing. EPS legacy mesh corners, vector opacity masks and raster print-page comparison now preserve editable art under synthetic regressions. This is the beta main-format gap ([gaps.md](gaps.md) G9) | 10–20 (for beta) |
|
||||
|
||||
Hindi interface follow-up (2026-11-06): the catalog and zero/one plural rule are implemented;
|
||||
native wording review, layout checks and a web Devanagari font remain. [Notes](localization-hi.md).
|
||||
|
||||
@@ -199,7 +199,7 @@ dominate; 3D, graphs and automation are specialist). They sum to 105. Feature de
|
||||
| Image Trace, graphs, image tools | 3 | 75% | graph Column designs, Image Trace Create Strokes depth (Create Object Mosaic is done; junction-returning piece survival has source-generated regressions in `image-trace-quality.md`; large images trace with a warning; Auto Color keeps rare distinct colours) | 5–8 | estimated (raised from 72%); quick presets reveal adjustment controls, Properties reopens them |
|
||||
| Layers, artboards, document setup | 5 | 78% | Selected-artboard deletion is consistent across panel actions (all-selected retains artboard 1); history prunes removed indices while preserving valid multiselection; remaining: 30.0's artboard locking and colours and managing artboards from the canvas, Layers panel row context menus and Collect for Export (click-to-fit objects is done, #1227) | 5–8 | estimated (lowered from 82%: target moved); Artboard deletion keys keep artwork and the first of an all-selected set; Artboard Options' Show Center Mark and Show Cross Hairs draw on the canvas only (exports and print leave them out), regression-tested; Artboard Options' Show Video Safe Areas and Video Ruler Pixel Aspect Ratio (per artboard, native format) are done ([video display options](#evidence-what-ships-today-by-area)), score unchanged |
|
||||
| View & navigation | 3 | 70% | multiple windows and the rest of Arrange (Cascade, Float in Window, Float All in Windows) | 9–14 | estimated; Window › Arrange › Tile and Consolidate All Windows done (score/hours unchanged); document-tab artwork hover/copy and lossless transfer tested (2026-10-22; score/hours unchanged); cached canvas reprojection preserves scale during resize, rotation and DPI changes (regression and contributor original-file evidence below; scores/hours unchanged); cached canvas dimensions match the renderer limit before cache-key creation, view construction and worker submission (regression evidence below) |
|
||||
| File formats | 6 | 75% | `.ai` files open with a flattened or wrong layer structure in real cases (#951), no writing of Illustrator's editing data (#868), FreeHand/CorelDRAW/DWG/HEIC import, 3D export; see [file-format-parity.md](file-format-parity.md); EPS legacy mesh/opacity-mask and raster comparison follow-up verified | 10–20 | estimated (lowered from 85%: open issues); DXF control-point SPLINE import closure regression-tested (#1299 follow-up after #1320); PDF writer metadata, reader streaming and immutable backend checks in `crates/pdf/src/tests.rs`, `crates/pdf/src/tests/reader_streaming.rs` and `xtask/src/pdf_deps.rs`; PDF Place and clipboard paste retain live text (synthetic regressions); EPS ordinary Save retains the page frame and editable document (2026-10-26); `.ai`/EPS editing data checked against a user's files (2026-10-30): case setting (`ate::tests`, `tests_native::type_from_the_text_document_keeps_its_case_setting`), placed-file placements (`tests_native::a_small_placed_file_goes_where_it_draws_closer_to_the_page`), pages cropped to the art (`tests_native::type_on_the_copies_of_a_page_cropped_to_the_art_is_read_once`), mesh corner weights and state (`ai::mesh::tests::corners_with_handle_weights_of_zero_are_read`, `ai::tests::a_gradient_mesh_takes_the_transparency_written_after_it`), type on a path spacing (`tests_native::type_round_a_circle_is_spaced_as_the_file_lays_it_out`), blend state (`ai::tests::a_blends_transparency_follows_its_record`); scores and estimates unchanged. |
|
||||
| File formats | 6 | 75% | `.ai` files open with a flattened or wrong layer structure in real cases (#951), a saved `.ai`'s editing copy without live effects and with symbols and live objects as their art (#868), FreeHand/CorelDRAW/DWG/HEIC import, 3D export; see [file-format-parity.md](file-format-parity.md); EPS legacy mesh/opacity-mask and raster comparison follow-up verified | 10–20 | estimated (lowered from 85%: open issues); DXF control-point SPLINE import closure regression-tested (#1299 follow-up after #1320); PDF writer metadata, reader streaming and immutable backend checks in `crates/pdf/src/tests.rs`, `crates/pdf/src/tests/reader_streaming.rs` and `xtask/src/pdf_deps.rs`; PDF Place and clipboard paste retain live text (synthetic regressions); EPS ordinary Save retains the page frame and editable document (2026-10-26); `.ai`/EPS editing data checked against a user's files (2026-10-30): case setting (`ate::tests`, `tests_native::type_from_the_text_document_keeps_its_case_setting`), placed-file placements (`tests_native::a_small_placed_file_goes_where_it_draws_closer_to_the_page`), pages cropped to the art (`tests_native::type_on_the_copies_of_a_page_cropped_to_the_art_is_read_once`), mesh corner weights and state (`ai::mesh::tests::corners_with_handle_weights_of_zero_are_read`, `ai::tests::a_gradient_mesh_takes_the_transparency_written_after_it`), type on a path spacing (`tests_native::type_round_a_circle_is_spaced_as_the_file_lays_it_out`), blend state (`ai::tests::a_blends_transparency_follows_its_record`); scores and estimates unchanged. |
|
||||
| View & navigation | 3 | 70% | multiple windows and the rest of Arrange (Cascade, Float in Window, Float All in Windows) | 9–14 | estimated; Window › Arrange › Tile and Consolidate All Windows done (score/hours unchanged); document-tab artwork hover/copy and lossless transfer tested (2026-10-22; score/hours unchanged); cached canvas reprojection preserves scale during resize, rotation and DPI changes (regression and contributor original-file evidence below; scores/hours unchanged) |
|
||||
| View & navigation | 3 | 70% | multiple windows and the rest of Arrange (Cascade, Float in Window, Float All in Windows) | 9–14 | estimated; Window › Arrange › Tile and Consolidate All Windows done (score/hours unchanged) |
|
||||
| Guides, grids, smart guides, snapping, rulers | 3 | 80% | "intersect" smart guides for a moved selection's anchors (drawn points and dragged anchors snap to intersections, #1658), distance readouts while drawing | 4–7 | estimated (lowered from 85%: target moved); new ruler-guide Alt orientation implemented; video rulers (View › Rulers › Show Video Rulers, #2849) done, score unchanged |
|
||||
@@ -279,8 +279,9 @@ The discounts, with the evidence:
|
||||
about `.ai`/EPS, the most common single format theme. 20 of the 28 are fixed (often the same day). The 8 open
|
||||
ones are about structure, not missing art: layers flattened or multiplied (#951: 109 layers instead of 14;
|
||||
#868), guides lost (#779), slower opening (#758), live effects, brushes and symbols as their drawn look
|
||||
(#637). VectorCraft can't write Illustrator's editing data (undocumented), so its PDF-compatible `.ai` opens
|
||||
in Illustrator as plain art; the legacy `.ai` of version 7 it also writes keeps layers, groups and type as text (one
|
||||
(#637). VectorCraft's PDF-compatible `.ai` carries an editing copy of the art (layers, groups, paths, colors,
|
||||
gradients, patterns, images, transparency, opacity masks, clipping and type as text), with live effects left out
|
||||
and symbols and live objects written as their art; the legacy `.ai` of version 7 it also writes keeps layers, groups and type as text (one
|
||||
artboard per file, no transparency) but hasn't been tested by users yet (#868). That blocks beta (the main-format rule) for people who hand files back to Illustrator users,
|
||||
but it doesn't stop someone opening and reworking their own archive.
|
||||
- **Interaction fidelity (×0.9).** Pen, Direct Selection, smart guides and snapping are deep
|
||||
@@ -1209,7 +1210,8 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur
|
||||
At a precision of 9 decimals or fewer, SVG export writes each number from an integer when the integer rounds it as the decimal formatter does; the formatter still writes values halfway between two written numbers and values too large for the integer. Exporting one path of 200,000 anchors takes a median of 43.4 ms instead of 167.0 ms on Windows 11, and 20,000 rectangles 81.4 ms instead of 141.4 ms, with the same SVG (`crates/svg/src/lib.rs`).
|
||||
SVG import reads each `<circle>` and `<ellipse>` as the ellipse VectorCraft draws: four smooth anchors on the axes, starting at the right, with handles of the standard length, so an ellipse exported as `<ellipse>` comes back with the anchors it was written from and draws the same (`circles_and_ellipses_import_as_the_ellipse_drawn` in `crates/svg/tests/it/basic_shapes.rs`, `filled_ellipse_on_the_artboard_edge_survives_visually` in `prop_svg.rs`).
|
||||
SVG import keeps attributes in other applications' XML namespaces (`plotter:pen="2"`) on the objects and layers they belong to, as it keeps their `data-*` attributes: copies, duplicates and `.vectorcraft` files keep them, and SVG export writes them back with each namespace declared once on the root (the rest of #522; `crates/svg/tests/it/foreign_attributes.rs`, `tests/attributes.rs`).
|
||||
In a `.ai` or EPS opened from its editing data, type has its text object's opacity and blend mode, whether it is made from the file's text document or taken from the page. Where such type has transparency and comes in with other art (the rest of its look, or page type and strokes that go with it), a group of them has it. Where the page draws its type, or the strokes around it, with transparency that is neither its text object's nor its text object's combined with that of the objects around it, the page's type and strokes keep their own instead (`crates/eps/src/import/tests_native.rs`). Where the page draws type of no text object over text objects made from the text document, with their words in any case, that type is theirs as the page draws it and is left out; the page's other type of no text object goes only to text objects whose type the text document can't make, or else is left out with a warning.
|
||||
A PDF-compatible `.ai` saved with Include Editing Data for Other Apps writes point type, area type and type on a path as type in its editing copy, and objects next to it keep their own transparency (`crates/eps/src/ai_editing/tests.rs`, `cmd::fileio::tests_pdfedit::type_comes_back_from_the_editing_copy`; [file-format-parity.md](file-format-parity.md) lists what is written as outlines).
|
||||
In a `.ai` or EPS opened from its editing data, type has its text object's opacity, blend mode and knockout shape flag, whether it is made from the file's text document or taken from the page, and type made from the text document takes its text object's lock. Where such type has transparency and comes in with other art (the rest of its look, or page type and strokes that go with it), a group of them has it. Where the page draws its type, or the strokes around it, with transparency that is neither its text object's nor its text object's combined with that of the objects around it, the page's type and strokes keep their own instead (`crates/eps/src/import/tests_native.rs`). Where the page draws type of no text object over text objects made from the text document, with their words in any case, that type is theirs as the page draws it and is left out; the page's other type of no text object goes only to text objects whose type the text document can't make, or else is left out with a warning.
|
||||
`.ai` editing-data import restores the document's listed graphic styles in panel order and links objects that use a listed style; unsupported appearances keep their drawn look (`crates/eps/src/import/ai/tests.rs`).
|
||||
A `.ai` or EPS graphic style library, whose editing data holds the styles and their list but no layers, opens with those styles in list order. Other Library… loads another document's graphic styles ([Apply graphic styles](https://helpx.adobe.com/illustrator/desktop/special-effects-styles/apply-graphic-styles/apply-graphic-styles.html)) and lists such a library's styles in a library panel. A `.ai` or EPS read as its PDF part or page because its layers can't be used also gets the styles of its list in place of the default ones (`crates/eps/src/import/tests_native.rs`, `cmd::fileio::tests_aiimport::a_graphic_style_library_in_a_ai_file_without_layers_loads_its_styles`).
|
||||
A `.ai` or EPS opened from its editing data whose text document makes the type of every text object that shows takes all its type from the text document: each text object stays in its own group, frame and layer, the page's type isn't matched with them, a file of more than 5,000 text objects still opens with its layers, and type the page draws differently (in another font) keeps the layers, with a warning. A line break inside a paragraph stays a line break in it (`crates/eps/src/import/tests_native.rs`, `crates/eps/src/import/ate.rs`).
|
||||
|
||||
Reference in New Issue
Block a user