Merge pull request #7446 from dotCooCoo/fix/ai-transform-guide-reach

.ai import: guides past an object's art keep the drawn look under Transform and Free Distort
This commit is contained in:
BFlat authored and GitHub committed 2026-11-18 03:20:32 +07:00
commit aa8ef006da
5 files changed
+209 -15

No files matched your search

+68
View File
@@ -9028,6 +9028,74 @@ fn a_link_to_a_twist_style_is_kept_where_the_reader_reads_it() {
}
}
/// A link to a graphic style with Transform or Free Distort is kept where the reader reads the
/// effect. On a compound path of a square and a guide: Transform with the guide inside the square,
/// moving only, or with Transform Objects off (Transform Patterns on or off), and Free Distort. On a
/// group holding such a compound path: Transform with the guide inside. Transform that scales where
/// the guide reaches past the square is written without the link and warns.
#[test]
fn a_link_to_a_transform_or_free_distort_style_with_a_guide_is_kept_where_the_reader_reads_it() {
// A compound path of a filled square and a guide from `a` to `b`, with appearance `ap`.
fn guided(doc: &mut Document, ap: Appearance, a: (f64, f64), b: (f64, f64)) -> Node {
let square = Node::path(doc.alloc_id(), shapes::rectangle(Rect::new(10.0, 10.0, 50.0, 40.0)), Appearance::default());
let path = shapes::rectangle(Rect::new(a.0, a.1, b.0, b.1));
let guide = Node::new(doc.alloc_id(), NodeKind::Path { path, rule: FillRule::NonZero, live: None, clipping: false, guide: true });
let mut n = Node::new(doc.alloc_id(), NodeKind::Compound { children: vec![Arc::new(square), Arc::new(guide)], rule: FillRule::NonZero });
n.appearance = ap.into();
n
}
// A document with that compound path (in a group when `grouped`) with effect `e`, linked to a
// graphic style of that appearance.
let make = |e: vectorcraft_doc::Effect, grouped: bool, a: (f64, f64), b: (f64, f64)| {
let mut doc = Document::new(200.0, 100.0);
let filled = Appearance::basic(black_fill(), Paint::None, 0.0);
let ap = Appearance { effects: vec![e], ..if grouped { Appearance::default() } else { filled.clone() } };
let mut g = vectorcraft_doc::GraphicStyle::new("Moved", ap.clone());
g.id = 9;
doc.graphic_styles.push(g);
let mut n = if grouped {
let member = guided(&mut doc, filled, a, b);
let mut n = Node::group(doc.alloc_id(), vec![Arc::new(member)]);
n.appearance = ap.into();
n
} else {
guided(&mut doc, ap, a, b)
};
n.extras_mut().graphic_style = Some(9);
put(&mut doc, n);
doc
};
let scale = || fx("distort.transform", serde_json::json!({"copies": 0, "scaleH": 50.0, "scaleV": 50.0}));
let moved = || fx("distort.transform", serde_json::json!({"copies": 0, "moveH": 5.0}));
let in_place = || fx("distort.transform", serde_json::json!({"copies": 0, "scaleH": 50.0, "objects": false, "patterns": false}));
let patterns_only = || fx("distort.transform", serde_json::json!({"copies": 0, "scaleH": 50.0, "objects": false, "patterns": true}));
let slant = || fx("distort.freeDistort", serde_json::json!({"corners": [[0.2, 0.0], [1.2, 0.0], [1.0, 1.0], [0.0, 1.0]]}));
let (inside, past) = (((20.0, 20.0), (30.0, 30.0)), ((20.0, 20.0), (90.0, 30.0)));
for (what, doc, id, kept) in [
("a compound path scaled, its guide inside", make(scale(), false, inside.0, inside.1), "distort.transform", true),
("a compound path moved, its guide past", make(moved(), false, past.0, past.1), "distort.transform", true),
("a compound path scaled with Transform Objects off, its guide past", make(in_place(), false, past.0, past.1), "distort.transform", true),
(
"a compound path scaled with Transform Objects off and Transform Patterns on, its guide past",
make(patterns_only(), false, past.0, past.1),
"distort.transform",
true,
),
("a compound path distorted, its guide past", make(slant(), false, past.0, past.1), "distort.freeDistort", true),
("a group scaled, its guide inside", make(scale(), true, inside.0, inside.1), "distort.transform", true),
("a compound path scaled, its guide past", make(scale(), false, past.0, past.1), "distort.transform", false),
("a group scaled, its guide past", make(scale(), true, past.0, past.1), "distort.transform", false),
] {
let out = export_ai_editing(&doc, &opts()).unwrap();
assert_eq!(out.warnings.iter().any(|w| w == writer::STYLE_LINKS), !kept, "{what}: {:?}", out.warnings);
let back = read_back(&doc);
let n = &back.layers[0].children().unwrap()[0];
let style = n.extras().graphic_style.and_then(|id| back.graphic_style_by_id(id)).map(|g| g.name.as_str());
assert_eq!(style, kept.then_some("Moved"), "{what}: {n:?}");
assert_eq!(n.appearance.effects.iter().any(|e| e.id == id), kept, "{what}: {n:?}");
}
}
/// Twist and Transform on an object that isn't linked to a graphic style are not written as a style
/// of its own: the object reads back without live effects.
#[test]
+53 -13
View File
@@ -1126,13 +1126,47 @@ fn no_guides(n: &Node, depth: usize) -> bool {
depth <= MAX_DEPTH && !n.is_guide() && n.children().into_iter().flatten().all(|c| no_guides(c, depth + 1))
}
/// Is `n` a compound path with a guide member whose bounds reach past the bounds of its members that
/// aren't guides, or with guide members only? Any other object counts as no.
/// Is `n` a compound path or group with a guide in it whose bounds reach past the bounds of the rest
/// of its art, or with guides only? Members are looked into to [`MAX_DEPTH`]; deeper counts as yes.
/// Any other object counts as no.
fn guides_reach_past(n: &Node) -> bool {
let NodeKind::Compound { children, .. } = &n.kind else { return false };
let bounds =
|guides: bool| children.iter().filter(|c| c.is_guide() == guides).fold(None, |acc, c| vectorcraft_geom::union_opt(acc, c.geometric_bounds()));
bounds(true).is_some_and(|g| bounds(false).is_none_or(|o| o.union(g) != o))
/// Adds the bounds of the guides in `n`'s members to `guides` and of the rest to `art`; false when
/// it is deeper than [`MAX_DEPTH`].
fn split(n: &Node, depth: usize, guides: &mut Option<Rect>, art: &mut Option<Rect>) -> bool {
depth <= MAX_DEPTH
&& n.children().into_iter().flatten().all(|c| match c.children() {
_ if c.is_guide() => {
*guides = vectorcraft_geom::union_opt(*guides, c.geometric_bounds());
true
}
Some(_) => split(c, depth + 1, guides, art),
None => {
*art = vectorcraft_geom::union_opt(*art, c.geometric_bounds());
true
}
})
}
if !matches!(n.kind, NodeKind::Compound { .. } | NodeKind::Group { .. }) {
return false;
}
let (mut guides, mut art) = (None, None);
!split(n, 0, &mut guides, &mut art) || guides.is_some_and(|g| art.is_none_or(|o| o.union(g) != o))
}
/// Do Transform params `p` scale, turn or reflect, so that where the object's bounds lie changes
/// what they draw? Moving alone doesn't.
fn transform_measures(p: &serde_json::Value) -> bool {
p["scaleH"].as_f64() != Some(100.0)
|| p["scaleV"].as_f64() != Some(100.0)
|| p["rotate"].as_f64() != Some(0.0)
|| p["reflectX"].as_bool() != Some(false)
|| p["reflectY"].as_bool() != Some(false)
}
/// Do Free Distort params `p` move a corner of the box, so that where the object's bounds lie
/// changes what they draw?
fn free_distort_measures(p: &serde_json::Value) -> bool {
p["corners"] != serde_json::json!([[0.0, 0.0], [1.0, 0.0], [1.0, 1.0], [0.0, 1.0]])
}
/// The largest Twist angle, in degrees either way, read as a live effect on an object that isn't a
@@ -1151,7 +1185,11 @@ const MAX_STRAIGHT_TWIST: f64 = 180.0;
/// compound path with straight segments (only at 0° when its guide members reach past its other
/// members, see [`guides_reach_past`]), or up to [`MAX_TWIST`] degrees either way on another object
/// with no guide in it. Transform that scales, turns or reflects is read only when nothing is stroked
/// (its reference point lies on the bounds without strokes).
/// (its reference point lies on the bounds without strokes) and, unless Transform Objects is off,
/// no guide reaches past the rest of the object's art ([`guides_reach_past`]). Free Distort that
/// moves a corner of a group is read only when no guide in the group reaches past the rest of its
/// art. The live effect is measured from bounds that take in the guides, so such an object keeps
/// its drawn look.
fn moves_with(object: &Node, st: &crate::import::ai::style::ArtStyle) -> bool {
use crate::import::ai::style::StyleItem;
let stroked = st.items.iter().any(|i| matches!(i, StyleItem::Stroke { paint, .. } if !paint.is_none()))
@@ -1171,12 +1209,14 @@ fn moves_with(object: &Node, st: &crate::import::ai::style::ArtStyle) -> bool {
}
"distort.transform" => {
let p = &e.params;
!stroked
|| (p["scaleH"].as_f64() == Some(100.0)
&& p["scaleV"].as_f64() == Some(100.0)
&& p["rotate"].as_f64() == Some(0.0)
&& p["reflectX"].as_bool() == Some(false)
&& p["reflectY"].as_bool() == Some(false))
// With Transform Objects off, nothing is placed from the bounds: a style read here and
// the object's members paint with no pattern for Transform Patterns to move (`simple`,
// `moves_alike`).
let placed = p["objects"].as_bool() != Some(false);
!transform_measures(p) || (!stroked && (!placed || !guides_reach_past(object)))
}
"distort.freeDistort" => {
!matches!(object.kind, NodeKind::Group { .. }) || !free_distort_measures(&e.params) || !guides_reach_past(object)
}
_ => true,
})
+86
View File
@@ -7551,6 +7551,92 @@ fn twist_is_read_on_straight_paths_and_compound_paths_up_to_half_a_turn() {
}
}
#[test]
fn transform_and_free_distort_keep_the_drawn_look_where_a_guide_reaches_past_the_rest_of_the_art() {
// GUARDS: a compound path or group whose guides reach past the rest of its art was read with a
// live Transform that scales, turns or reflects (or, on a group, a live Free Distort) measured from
// bounds that take in those guides. Such an object keeps its drawn look.
let hide = |s: String| s.replace('\n', "\n%_");
// A compound path of a square and `rest`, under its drawn look.
let compound = |rest: &str| {
format!(
"0 Ae\nu\n{RED}{}f\nU\n%_Bb\n%_{}0 BB\n1 (Bent) XW\n",
rect_path(16.0, 16.0, 64.0, 54.0),
hide(format!("*u\n{}f\n{rest}*U\n", rect_path(20.0, 20.0, 60.0, 50.0)))
)
};
// A group of a red square and `rest`, under its drawn look.
let group = |rest: &str| {
format!(
"0 Ae\nu\n{RED}{}f\nU\n%_0 Ae\n%_u\n%_{}U\n1 (Bent) XW\n",
rect_path(16.0, 16.0, 64.0, 54.0),
hide(format!("{RED}{}f\n{rest}", rect_path(20.0, 20.0, 60.0, 50.0)))
)
};
let guide = |from: (f64, f64), to: (f64, f64)| format!("{} {} m\n{} {} L\n(N) *\n", from.0, from.1, to.0, to.1);
let inside = guide((25.0, 25.0), (35.0, 35.0));
let past = guide((30.0, 30.0), (70.0, 40.0));
let nested = format!("0 Ae\nu\n{past}U\n");
let transform = |keys: &str| format!("{keys}0 /Bool (transformPatterns) ,\n");
let scale = transform("0.5 /Real (scaleH_Factor) ,\n0.5 /Real (scaleV_Factor) ,\n0 /Bool (scaleLines) ,\n");
let turn = transform("0.5 /Real (rotate_Radians) ,\n");
let reflect = transform("1 /Bool (reflectX) ,\n");
let moved = transform("5 /Real (moveH_Pts) ,\n");
let scale_in_place = transform("0.5 /Real (scaleH_Factor) ,\n0 /Bool (scaleLines) ,\n0 /Bool (transformObjects) ,\n");
// Transform Objects off and Transform Patterns on: only a pattern moves, and a solid fill has none.
let scale_patterns = "0.5 /Real (scaleH_Factor) ,\n0 /Bool (scaleLines) ,\n0 /Bool (transformObjects) ,\n1 /Bool (transformPatterns) ,\n";
let slanted = free_distort_keys([[25.0, 50.0], [65.0, 50.0], [20.0, 20.0], [60.0, 20.0]]);
let read = |name: &str, keys: &str, paint, art_: &str| read_ok(&format!("{}{}", distort_styles(name, keys, paint), layer(art_)));
let tr = "Adobe Transform";
let fd = "Adobe Free Distort";
for (what, r, id) in [
("a compound path scaled, its guide inside", read(tr, &scale, BLUE_FILL, &compound(&inside)), "distort.transform"),
("a compound path moved, its guide past", read(tr, &moved, BLUE_FILL, &compound(&past)), "distort.transform"),
("a compound path distorted, its guide past", read(fd, &slanted, BLUE_FILL, &compound(&past)), "distort.freeDistort"),
("a group scaled, its guide inside", read(tr, &scale, None, &group(&inside)), "distort.transform"),
("a group moved, its guide past", read(tr, &moved, None, &group(&past)), "distort.transform"),
("a group scaled with Transform Objects off, its guide past", read(tr, &scale_in_place, None, &group(&past)), "distort.transform"),
(
"a compound path scaled with Transform Objects off and Transform Patterns on, its guide past",
read(tr, scale_patterns, BLUE_FILL, &compound(&past)),
"distort.transform",
),
("a group distorted, its guide inside", read(fd, &slanted, None, &group(&inside)), "distort.freeDistort"),
("a group distorted with no corner moved, its guide past", read(fd, "", None, &group(&past)), "distort.freeDistort"),
// A hidden member is measured too, and this one takes in the guide.
(
"a group scaled, its guide past the square and inside a hidden member",
read(tr, &scale, None, &group(&format!("1 Xw\n{RED}{}f\n0 Xw\n{past}", rect_path(10.0, 10.0, 80.0, 60.0)))),
"distort.transform",
),
] {
assert!(!r.warnings.iter().any(|w| w.contains("drawn look")), "{what}: {:?}", r.warnings);
let a = art(&r.doc);
assert_eq!(a.len(), 1, "{what}: {a:#?}");
assert!(a[0].children().map_or(0, |c| c.len()) >= 2, "{what}: the object, not its look: {a:#?}");
let [e] = a[0].appearance.effects.as_slice() else { panic!("{what}: {:?}", a[0].appearance) };
assert_eq!(e.id, id, "{what}");
}
for (what, r) in [
("a compound path scaled, its guide past", read(tr, &scale, BLUE_FILL, &compound(&past))),
("a compound path turned, its guide past", read(tr, &turn, BLUE_FILL, &compound(&past))),
("a compound path reflected, its guide past", read(tr, &reflect, BLUE_FILL, &compound(&past))),
("a group scaled, its guide past", read(tr, &scale, None, &group(&past))),
("a group turned, its guide past", read(tr, &turn, None, &group(&past))),
("a group distorted, its guide past", read(fd, &slanted, None, &group(&past))),
("a group scaled, its guide past in a group in it", read(tr, &scale, None, &group(&nested))),
(
"a group scaled, its guide past in a compound path in it",
read(tr, &scale, None, &group(&format!("*u\n{RED}{}f\n{past}*U\n", rect_path(25.0, 25.0, 35.0, 35.0)))),
),
] {
let a = art(&r.doc);
assert_eq!(a.len(), 1, "{what}: {a:#?}");
assert!(a[0].appearance.effects.is_empty(), "{what}: the drawn look: {a:#?}");
assert!(r.warnings.iter().any(|w| w.contains("drawn look")), "{what}: {:?}", r.warnings);
}
}
#[test]
fn twist_on_a_straight_compound_path_keeps_the_drawn_look_where_a_guide_reaches_past_its_other_members() {
// GUARDS: a straight compound path whose guide members reach past its other members was read
+1 -1
View File
@@ -297,7 +297,7 @@ private editing data. VectorCraft:
### Illustrator's private editing data
The app's own editing copy of a file (an EPS after its `%%EOF`, a `.ai`'s `AIPrivateData` streams, a PDF's `AIPDFPrivateData` streams when it was saved with the editing data (#868), Zstandard or zlib, the EPS's in ASCII85) is not documented as a whole. VectorCraft reads its structure: layers and sublayers (names, order, visibility, lock, printing, preview, dimming, colour), groups as they were nested, compound paths (painted by their last path, or the last painted one, with the paths of groups inside them kept as their paths: #1410), clipping groups and layer clipping (several clipping paths in a clipping group, a layer or an opacity mask's art clip to their intersection, and a compound path of clipping paths stays one clip; a filled clipping path keeps its fill, which paints under the art it clips, except the path of a mask that covers several layers, whose fill is read as a path of its own in the layer that holds the mask's path, and a compound clipping path whose subpaths paint differently, whose filled subpaths are read as a compound path of their own under the art it clips; clipping paths that would nest the art past the document's 32 levels stop the editing data from being read: #5789), object names, hidden and locked objects, fills and strokes (grey, CMYK, RGB, named and spot colours, spot colours defined in Lab with their Lab values (#1032), global process colours as global swatches at their tint; a stroke of width 0, `0 w`, on a path, a gradient-filled path, legacy type or in an art style comes in as a 0.25 pt hairline, as from PDF: #1671), linear and radial gradients, pattern fills with their patterns as pattern swatches (#1025), gradient and pattern names in the file up to their first newline (a name that another swatch, or a gradient or pattern defined earlier, already has is numbered "Sky 2"; a name without a newline is kept, and when another swatch has it, the pattern's swatch, or a named color sharing a gradient or pattern swatch's name, is numbered the same way), opacity, blend modes, isolation and knockout, embedded images where their matrix puts them, rotated ones too (#2269), with their alpha channel (CMYK images keep their ink amounts, as they do when a `.ai` opens from its PDF part, and an alpha channel that hides part of a CMYK image becomes a grayscale opacity mask), placed (linked) files as linked images in their place, each showing the low-resolution preview the file keeps of it until its file is found or relinked in the Links panel (#1264), with the folder the file keeps relative to the document's, where the link is looked for when its path is gone, placed PDF and `.ai` pages as placed documents of the [page and Crop to box](https://helpx.adobe.com/illustrator/desktop/add-and-import-files/import-other-file-types/adobe-pdf-placement-options.html) their dictionary names (`AI11 PlacedPDFPageIndex`, `AI11 PlacedPDFCropTo`; a value VectorCraft doesn't read, or a binding to an image variable, leaves a linked image), guides, and every artboard where it is, with its center mark, cross hairs, video safe areas and video ruler pixel aspect ratio. VectorCraft reads `CropAreaActive`, an `/Int` in the dictionary that holds the artboard array, as the index of the active artboard in that array, and the file opens with that artboard active; without it, or when it names no artboard that opens, the first artboard is active. It also reads the Document Raster Effects Settings (resolution, color model, background, anti-alias, clipping mask, Add Around Object and Preserve Spot Colors), the author from the header's `%%For` (an EPS's own header when the editing data's has none), swatches for the header's `%%CMYKCustomColor` and `%%RGBCustomColor` colors that the document has none of, and `%%TemplateBox` in older files; a setting with a value of another type or out of range keeps its default. Objects on Path groups open live, with their path, their objects in order along it, Pivot and Rotate; one with a dragged spacing or other options opens as a plain group. A gradient with stops in the middle runs its whole ramp across its shape, and a gradient object does not pass its fill to the next path (#1390). An object whose art style is one fill and one stroke at most (solid colours, its own gradient, a variable-width profile on a Stroke Offset stroke or written as each side's widths) with Drop Shadow, Inner Glow, Outer Glow, Feather, Round Corners, Scribble, Offset Path, Outline Object, Outline Stroke, Convert to Shape, Tweak (only when it moves nothing), Pucker & Bloat at 0 or Bas Relief (read from its settings block: [raster effects reference](https://helpx.adobe.com/illustrator/desktop/special-effects-styles/apply-filter-effects/raster-effects-reference.html), [layered image file format specification](https://www.adobe.com/devnet-apps/photoshop/fileformatashtml/), [scripting the filter gallery](https://community.adobe.com/questions-712/scripting-support-for-the-filter-gallery-1064646)) comes in as itself withLine truncated
The app's own editing copy of a file (an EPS after its `%%EOF`, a `.ai`'s `AIPrivateData` streams, a PDF's `AIPDFPrivateData` streams when it was saved with the editing data (#868), Zstandard or zlib, the EPS's in ASCII85) is not documented as a whole. VectorCraft reads its structure: layers and sublayers (names, order, visibility, lock, printing, preview, dimming, colour), groups as they were nested, compound paths (painted by their last path, or the last painted one, with the paths of groups inside them kept as their paths: #1410), clipping groups and layer clipping (several clipping paths in a clipping group, a layer or an opacity mask's art clip to their intersection, and a compound path of clipping paths stays one clip; a filled clipping path keeps its fill, which paints under the art it clips, except the path of a mask that covers several layers, whose fill is read as a path of its own in the layer that holds the mask's path, and a compound clipping path whose subpaths paint differently, whose filled subpaths are read as a compound path of their own under the art it clips; clipping paths that would nest the art past the document's 32 levels stop the editing data from being read: #5789), object names, hidden and locked objects, fills and strokes (grey, CMYK, RGB, named and spot colours, spot colours defined in Lab with their Lab values (#1032), global process colours as global swatches at their tint; a stroke of width 0, `0 w`, on a path, a gradient-filled path, legacy type or in an art style comes in as a 0.25 pt hairline, as from PDF: #1671), linear and radial gradients, pattern fills with their patterns as pattern swatches (#1025), gradient and pattern names in the file up to their first newline (a name that another swatch, or a gradient or pattern defined earlier, already has is numbered "Sky 2"; a name without a newline is kept, and when another swatch has it, the pattern's swatch, or a named color sharing a gradient or pattern swatch's name, is numbered the same way), opacity, blend modes, isolation and knockout, embedded images where their matrix puts them, rotated ones too (#2269), with their alpha channel (CMYK images keep their ink amounts, as they do when a `.ai` opens from its PDF part, and an alpha channel that hides part of a CMYK image becomes a grayscale opacity mask), placed (linked) files as linked images in their place, each showing the low-resolution preview the file keeps of it until its file is found or relinked in the Links panel (#1264), with the folder the file keeps relative to the document's, where the link is looked for when its path is gone, placed PDF and `.ai` pages as placed documents of the [page and Crop to box](https://helpx.adobe.com/illustrator/desktop/add-and-import-files/import-other-file-types/adobe-pdf-placement-options.html) their dictionary names (`AI11 PlacedPDFPageIndex`, `AI11 PlacedPDFCropTo`; a value VectorCraft doesn't read, or a binding to an image variable, leaves a linked image), guides, and every artboard where it is, with its center mark, cross hairs, video safe areas and video ruler pixel aspect ratio. VectorCraft reads `CropAreaActive`, an `/Int` in the dictionary that holds the artboard array, as the index of the active artboard in that array, and the file opens with that artboard active; without it, or when it names no artboard that opens, the first artboard is active. It also reads the Document Raster Effects Settings (resolution, color model, background, anti-alias, clipping mask, Add Around Object and Preserve Spot Colors), the author from the header's `%%For` (an EPS's own header when the editing data's has none), swatches for the header's `%%CMYKCustomColor` and `%%RGBCustomColor` colors that the document has none of, and `%%TemplateBox` in older files; a setting with a value of another type or out of range keeps its default. Objects on Path groups open live, with their path, their objects in order along it, Pivot and Rotate; one with a dragged spacing or other options opens as a plain group. A gradient with stops in the middle runs its whole ramp across its shape, and a gradient object does not pass its fill to the next path (#1390). An object whose art style is one fill and one stroke at most (solid colours, its own gradient, a variable-width profile on a Stroke Offset stroke or written as each side's widths) with Drop Shadow, Inner Glow, Outer Glow, Feather, Round Corners, Scribble, Offset Path, Outline Object, Outline Stroke, Convert to Shape, Tweak (only when it moves nothing), Pucker & Bloat at 0 or Bas Relief (read from its settings block: [raster effects reference](https://helpx.adobe.com/illustrator/desktop/special-effects-styles/apply-filter-effects/raster-effects-reference.html), [layered image file format specification](https://www.adobe.com/devnet-apps/photoshop/fileformatashtml/), [scripting the filter gallery](https://community.adobe.com/questions-712/scripting-support-for-the-filter-gallery-1064646)) comes in as itself withLine truncated
A run of type in the editing data whose baseline direction is 1 opens with Standard Vertical Roman Alignment (https://helpx.adobe.com/illustrator/using/formatting-asian-characters.html) on, which is VectorCraft's own mapping: its half-width characters stand upright in vertical type, and horizontal type keeps the mark with no change to its layout. A run whose baseline direction is 2 or 3 (Tate-chu-yoko), or that names none in the run, its character style or the document's defaults, opens with it off. The scripting reference lists 1, 2 and 3 as the Standard, vertical rotated and Tate-chu-yoko baseline directions (https://web.archive.org/web/20170621180804/https://wwwimages.adobe.com/content/dam/Adobe/en/devnet/illustrator/sdk/CC2015_3/Illustrator%20VBScript%20Reference.pdf, page 256).
A Scatter brush in the editing data whose last 15 numbers start with 1 comes into the Brushes panel in Tints. Each brush art section is read without its frame: an unnamed, unpainted rectangle with no settings of its own at the art's bounds (within 1/1000 pt), closed, or open with its first corner again at the end. A wider frame stays in the art, and an art group with a state or look of its own (hidden, locked, isolated, knockout, an opacity, a blend mode, a name, a mask, a note or an appearance) stays a group.
+1 -1
View File
@@ -1985,7 +1985,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur
In a `.ai` or EPS opened from its editing data, a Scatter brush whose last 15 numbers start with 1 comes into the Brushes panel in Tints, and each brush art section is read without its frame, an unnamed, unpainted rectangle with no settings of its own at the art's bounds (within 1/1000 pt). A wider frame stays in the art, and an art group with a state or look of its own (hidden, locked, isolated, knockout, an opacity, a blend mode, a name, a mask, a note or an appearance) stays a group (`crates/eps/src/import/ai/tests.rs`).
A PDF-compatible `.ai` saved with Include Editing Data for Other Apps writes a Scatter or Art brush whose art holds opacity masks to the Brushes panel of its editing copy. This is VectorCraft's own rule for brushes a document already holds. Each mask's art is written in the brush's art section in the form VectorCraft's `.ai` reader reads (`define_brush_art` in `crates/eps/src/import/ai/read/directives.rs`), with the mask's Clip and Invert Mask options, whether it is disabled and whether it moves with its object, for masks up to seven deep in one another's art. A brush whose mask art holds more than paths, compound paths and groups with one solid fill and one plain stroke each is left out with a warning, and a path with an Art brush whose art holds a mask is written as its drawn look. When the reader turns an Art brush's art over, it turns the art of a mask that doesn't move with its object over too (`scatter_and_art_brush_mask_art_round_trips` and `brushes_whose_mask_art_isnt_read_back_are_left_out` in `crates/eps/src/ai_editing/tests.rs`, `an_art_brushs_opacity_mask_art_turns_over_with_its_object` in `crates/eps/src/import/ai/tests.rs`).
In a `.ai` opened from its editing data, type with Warp on the object or on one of its fills or strokes opens as type with the effect live when the live warp draws as the art saved with it. When it draws differently, or when the file's limit of checks has no check left for it, it opens as that art, and one note says how many did. Type stays live without a comparison when the saved art paints nothing or draws type of its own, in frames of threaded type, when a text variable binds it, and when its text object doesn't come in as one text object (`crates/eps/src/import/ai/envelope.rs`, `crates/eps/src/import/tests_native.rs`).
In a `.ai` opened from its editing data, an object with a Tweak that moves nothing or Pucker & Bloat at 0 opens as itself with the effect live. A path, compound path or group whose only effect is Transform without copies, or a Free Distort whose corners make a parallelogram, opens as itself with it live, and so does an object with nothing stroked whose only effect is Twist: a path or compound path with straight segments at up to 180° either way, unless it is a compound path with a guide member that reaches past its other members and the angle is not 0°, and another path, compound path or group with no guide in it at up to 90° either way (limits VectorCraft sets); one twisted further keeps the drawn art. A gradient or pattern, an image, type, a clipping group, an opacity mask or effects inside the object, or a stroke with a Transform that scales, rotates or reflects, keep the drawn art (`crates/eps/src/import/ai/style/tests.rs`, `crates/eps/src/import/ai/tests.rs`, `crates/eps/src/import/ai/read/ops.rs`).
In a `.ai` opened from its editing data, an object with a Tweak that moves nothing or Pucker & Bloat at 0 opens as itself with the effect live. A path, compound path or group whose only effect is Transform without copies, or a Free Distort whose corners make a parallelogram, opens as itself with it live (not when a guide in it reaches past the rest of its art, hidden members included, and the Transform scales, rotates or reflects the object with Transform Objects on, or the object is a group and the Free Distort moves a corner), and so does an object with nothing stroked whose only effect is Twist: a path or compound path with straight segments at up to 180° either way, unless it is a compound path with a guide member that reaches past its other members and the angle is not 0°, and another path, compound path or group with no guide in it at up to 90° either way (limits VectorCraft sets); one twisted further keeps the drawn art. A gradient or pattern, an image, type, a clipping group, an opacity mask or effects inside the object, or a stroke with a Transform that scales, rotates or reflects, keep the drawn art (`crates/eps/src/import/ai/style/tests.rs`, `crates/eps/src/import/ai/tests.rs`, `crates/eps/src/import/ai/read/ops.rs`).
A PDF page whose `UserUnit` (PDF 1.6) is above 1 opens at its size in points, its numbers times the `UserUnit` (one above 75,000 counts as 75,000), and `document.pdfInfo` gives its size and boxes in points too. A `.ai` whose editing data has its artboards in the units of such a page opens from that data at the page's size, with its layers, and when the layers can't be read its pages still take the artboard layout of the data, scaled the same way (part of #1482).
`document.open`, `file.place` and `document.pdfInfo` reject a `cropTo`, `crop`, `password`, `colorMode` or `textAs` that is not a string, such as `"textAs": true`, and `document.pdfInfo` rejects a `thumbnailSize` that is not a number; the error names the param, and nothing opens or is placed. A param left out or given as null keeps its default (`crates/engine/src/cmd/fileio/tests_pdfimport.rs`).
When the PDF content of a `.ai` has a page for each artboard, the layers are compared with every page on its artboard (until the pages compared take 8,388,608 pixels at the comparison's scale, about 67 letter-size pages, or number 128): art that only the layers or only a later page draws is handled as art that differs on the first page is, and a text object that a later page doesn't draw is left out unless its layer doesn't print (`crates/eps/src/import/tests_native.rs`).