mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-16 12:03:31 +00:00
.ai save: a cut clipping object keeps its name, opacity mask and variables
A clipping object written as art cut to it (a group, an image, a symbol instance, a live object, type, or a path inside art already cut to another clipping object) lost its name, opacity mask and variable bindings in the editing data: no written object carried its dictionary, and a painted one put its name on each of its fill and stroke objects. The unpainted path that carried its text wrap options now carries its whole dictionary, in the form the .ai reader reads (art_dictionary in crates/eps/src/import/ai/read/document.rs). Its fills and strokes keep only the opacity mask they are drawn through. The path is admitted by the object count, so at the object limit its dictionary is never left on the object before it, and a path whose dictionary comes out empty is taken out again.
This commit is contained in:
@@ -12598,3 +12598,199 @@ fn a_clipping_objects_text_wrap_is_left_out_without_room() {
|
||||
assert_eq!(carriers, if room >= 4 { vec![true] } else { vec![] }, "{room}\n{text}");
|
||||
}
|
||||
}
|
||||
|
||||
/// A clipping object written as art cut to it (one that isn't a path or compound path with points,
|
||||
/// or any clipping object in art already cut to one) keeps its name, its opacity mask and its
|
||||
/// visibility variable on one unpainted object, locked and hidden as it was: the reader reads the
|
||||
/// name once, on that object, with the mask, and binds the variable to it. The fills and strokes the
|
||||
/// clipping object paints keep its opacity mask, without its name.
|
||||
#[test]
|
||||
fn a_cut_clipping_object_keeps_its_name_mask_and_variables() {
|
||||
use vectorcraft_doc::{TextObject, Variable, VariableKind};
|
||||
// Each case, with the number of objects written for the clipping object's paint.
|
||||
let cases = [
|
||||
("group", 0),
|
||||
("hidden", 0),
|
||||
("locked", 0),
|
||||
("image", 0),
|
||||
("instance", 0),
|
||||
("blend", 0),
|
||||
("type", 1),
|
||||
("unpainted path", 0),
|
||||
("unpainted compound", 0),
|
||||
("fill", 1),
|
||||
("stroke", 1),
|
||||
("fill and stroke", 2),
|
||||
];
|
||||
for (case, parts) in cases {
|
||||
let mut doc = Document::new(200.0, 100.0);
|
||||
let layer = doc.layers[0].id;
|
||||
let art = square(&mut doc, Rect::new(0.0, 0.0, 10.0, 10.0), LEAF);
|
||||
doc.symbols.push(Symbol { dynamic: false, name: "Leaf".into(), art: Arc::new(art) });
|
||||
let rect = Rect::new(20.0, 20.0, 80.0, 80.0);
|
||||
let mut cutter = match case {
|
||||
"image" => image_node(&mut doc, ImageBlob::png(rgb_png()), (3, 2), Affine::new([20.0, 0.0, 0.0, 20.0, 30.0, 40.0]), None),
|
||||
"instance" => instance(&mut doc, "Leaf", Affine::translate((40.0, 30.0))),
|
||||
"blend" => {
|
||||
let keys = vec![
|
||||
Arc::new(square(&mut doc, Rect::new(20.0, 20.0, 30.0, 30.0), Color::gray(0.5))),
|
||||
Arc::new(square(&mut doc, Rect::new(60.0, 20.0, 70.0, 30.0), Color::gray(0.5))),
|
||||
];
|
||||
let spec = vectorcraft_doc::BlendSpec { spacing: vectorcraft_doc::BlendSpacing::Distance(10.0), ..Default::default() };
|
||||
Node::new(doc.alloc_id(), NodeKind::Blend { children: keys, spec: Box::new(spec) })
|
||||
}
|
||||
"type" => text_node(&mut doc, TextObject::point(vectorcraft_geom::Point::new(30.0, 50.0), "Clip", style(24.0, Color::BLACK))),
|
||||
"unpainted path" => clipping(&mut doc, shapes::rectangle(rect)),
|
||||
"unpainted compound" => {
|
||||
let outer = Node::path(doc.alloc_id(), shapes::rectangle(rect), Appearance::default());
|
||||
let inner = Node::path(doc.alloc_id(), shapes::rectangle(Rect::new(30.0, 30.0, 70.0, 70.0)), Appearance::default());
|
||||
Node::new(doc.alloc_id(), NodeKind::Compound { children: vec![Arc::new(outer), Arc::new(inner)], rule: FillRule::EvenOdd })
|
||||
}
|
||||
"fill" | "stroke" | "fill and stroke" => {
|
||||
let mut c = clipping(&mut doc, shapes::rectangle(rect));
|
||||
let fill = if case == "stroke" { Paint::None } else { solid(Color::gray(0.5)) };
|
||||
let stroke = if case == "fill" { Paint::None } else { solid(Color::rgb(0.0, 0.0, 1.0)) };
|
||||
c.appearance = Appearance::basic(fill, stroke, if case == "fill" { 0.0 } else { 2.0 }).into();
|
||||
c
|
||||
}
|
||||
_ => {
|
||||
let members = vec![square(&mut doc, Rect::new(20.0, 20.0, 50.0, 60.0), Color::gray(0.5)), square(&mut doc, rect, Color::gray(0.5))];
|
||||
group(&mut doc, members, false)
|
||||
}
|
||||
};
|
||||
cutter.name = Some("Cutter".into());
|
||||
cutter.visible = case != "hidden";
|
||||
cutter.locked = case == "locked";
|
||||
let veil = square(&mut doc, Rect::new(20.0, 20.0, 60.0, 60.0), Color::rgb(1.0, 1.0, 1.0));
|
||||
cutter.extras_mut().mask = Some(Box::new(OpacityMask::new(veil, false)));
|
||||
let id = cutter.id;
|
||||
let member = square(&mut doc, Rect::new(30.0, 30.0, 70.0, 50.0), Color::rgb(1.0, 0.0, 0.0));
|
||||
let mut top = group(&mut doc, vec![cutter, member], true);
|
||||
if matches!(case, "unpainted path" | "unpainted compound" | "fill" | "stroke" | "fill and stroke") {
|
||||
let frame = square(&mut doc, Rect::new(0.0, 0.0, 100.0, 100.0), Color::gray(0.9));
|
||||
let frame = group(&mut doc, vec![frame], false);
|
||||
top = group(&mut doc, vec![frame, top], true);
|
||||
}
|
||||
doc.insert(Some(layer), usize::MAX, top).unwrap();
|
||||
doc.variables.variables.push(Variable { name: "show".into(), kind: VariableKind::Visibility });
|
||||
doc.variables.bind(id, "show");
|
||||
let out = export_ai_editing(&doc, &opts()).unwrap();
|
||||
assert!(out.warnings.iter().all(|w| w != writer::BINDINGS), "{case}: {:?}", out.warnings);
|
||||
let text = String::from_utf8(out.program).unwrap().replace("\r\n", "\n");
|
||||
assert_eq!(text.matches("%_/XMLUID : (Cutter) ; (AI10_ArtUID) ,").count(), 1, "{case}\n{text}");
|
||||
assert_eq!(text.matches("(AI9_Mask)").count(), 1 + parts, "{case}\n{text}");
|
||||
let back = read_back(&doc);
|
||||
let (mut cutters, mut masked) = (vec![], 0);
|
||||
back.layers[0].walk(&mut |n| {
|
||||
masked += usize::from(n.extras().mask.is_some());
|
||||
if n.name.as_deref() == Some("Cutter") {
|
||||
let unpainted = matches!(n.kind, NodeKind::Path { .. } | NodeKind::Compound { .. }) && n.appearance.items.is_empty();
|
||||
cutters.push((n.id, unpainted, n.extras().mask.is_some(), n.locked, n.visible));
|
||||
}
|
||||
});
|
||||
let [(carrier, unpainted, mask, locked, visible)] = cutters[..] else { panic!("{case}: {cutters:?}\n{text}") };
|
||||
assert!(unpainted && mask, "{case}");
|
||||
assert_eq!((locked, visible), (case == "locked", case != "hidden"), "{case}");
|
||||
assert_eq!(masked, 1 + parts, "{case}");
|
||||
assert_eq!(back.variables.objects_of("show"), vec![carrier], "{case}");
|
||||
}
|
||||
}
|
||||
|
||||
/// With too little room for the unpainted object that carries a cut clipping object's dictionary,
|
||||
/// the dictionary is left out, never written on another object; with room for the object but not
|
||||
/// for its opacity mask's art, only the mask is left out. The data stays readable.
|
||||
#[test]
|
||||
fn a_cut_clipping_objects_dictionary_is_left_out_without_room() {
|
||||
let mut doc = Document::new(200.0, 100.0);
|
||||
let layer = doc.layers[0].id;
|
||||
let before = named(square(&mut doc, Rect::new(150.0, 10.0, 160.0, 20.0), Color::gray(0.2)), "Before");
|
||||
doc.insert(Some(layer), usize::MAX, before).unwrap();
|
||||
let members = vec![
|
||||
square(&mut doc, Rect::new(20.0, 20.0, 50.0, 60.0), Color::gray(0.5)),
|
||||
square(&mut doc, Rect::new(60.0, 30.0, 90.0, 70.0), Color::gray(0.5)),
|
||||
];
|
||||
let mut cutter = wrapped(named(group(&mut doc, members, false), "Cutter"), 2.0, false);
|
||||
cutter.locked = true;
|
||||
let veil = vec![
|
||||
square(&mut doc, Rect::new(20.0, 20.0, 40.0, 40.0), Color::rgb(1.0, 1.0, 1.0)),
|
||||
square(&mut doc, Rect::new(40.0, 40.0, 60.0, 60.0), Color::rgb(1.0, 1.0, 1.0)),
|
||||
];
|
||||
let veil = group(&mut doc, veil, false);
|
||||
cutter.extras_mut().mask = Some(Box::new(OpacityMask::new(veil, false)));
|
||||
let member = square(&mut doc, Rect::new(30.0, 30.0, 70.0, 50.0), Color::rgb(1.0, 0.0, 0.0));
|
||||
let top = group(&mut doc, vec![cutter, member], true);
|
||||
doc.insert(Some(layer), usize::MAX, top).unwrap();
|
||||
let all = crate::import::objects_read(&export_ai_editing(&doc, &opts()).unwrap().program).unwrap();
|
||||
let mut kept = vec![];
|
||||
for room in 0..=all {
|
||||
let out = export_within(&doc, &opts(), room).unwrap();
|
||||
assert!(crate::import::objects_read(&out.program).unwrap() <= room);
|
||||
let text = String::from_utf8_lossy(&out.program).replace("\r\n", "\n");
|
||||
let (back, _) = crate::ai_alone(&out.program).unwrap();
|
||||
let mut found = vec![];
|
||||
back.layers[0].walk(&mut |n| {
|
||||
let x = n.extras();
|
||||
if !matches!(n.kind, NodeKind::Layer { .. }) && (n.name.is_some() || x.wrap.is_some() || x.mask.is_some()) {
|
||||
let carrier = matches!(n.kind, NodeKind::Compound { .. }) && n.appearance.items.is_empty();
|
||||
found.push((n.name.clone(), carrier, x.wrap.is_some(), x.mask.is_some(), n.locked));
|
||||
}
|
||||
});
|
||||
let before = (Some("Before".to_string()), false, false, false, false);
|
||||
let rest = match found.split_first() {
|
||||
Some((b, rest)) if room > 0 => {
|
||||
assert_eq!(b, &before, "{room}\n{text}");
|
||||
rest
|
||||
}
|
||||
_ => &found[..],
|
||||
};
|
||||
match rest {
|
||||
[] => kept.push((false, false)),
|
||||
[(name, true, true, mask, true)] if name.as_deref() == Some("Cutter") => kept.push((true, *mask)),
|
||||
_ => panic!("{room}: {found:?}\n{text}"),
|
||||
}
|
||||
}
|
||||
assert_eq!(kept.last(), Some(&(true, true)));
|
||||
// Once the carrier fits it stays, and once its mask fits it stays too.
|
||||
let carrier = kept.iter().position(|k| k.0).unwrap();
|
||||
let mask = kept.iter().position(|k| k.1).unwrap();
|
||||
assert!(carrier < mask, "{kept:?}");
|
||||
assert!(kept[carrier..].iter().all(|k| k.0) && kept[mask..].iter().all(|k| k.1), "{kept:?}");
|
||||
}
|
||||
|
||||
/// A cut clipping object with an opacity mask alone gets no unpainted object when its mask's art
|
||||
/// doesn't fit: an object without the dictionary it was written for would be extra art.
|
||||
#[test]
|
||||
fn a_cut_clipping_object_without_room_for_its_mask_gets_no_carrier() {
|
||||
let mut doc = Document::new(200.0, 100.0);
|
||||
let layer = doc.layers[0].id;
|
||||
let members = vec![
|
||||
square(&mut doc, Rect::new(20.0, 20.0, 50.0, 60.0), Color::gray(0.5)),
|
||||
square(&mut doc, Rect::new(60.0, 30.0, 90.0, 70.0), Color::gray(0.5)),
|
||||
];
|
||||
let mut cutter = group(&mut doc, members, false);
|
||||
let veil = vec![
|
||||
square(&mut doc, Rect::new(20.0, 20.0, 40.0, 40.0), Color::rgb(1.0, 1.0, 1.0)),
|
||||
square(&mut doc, Rect::new(40.0, 40.0, 60.0, 60.0), Color::rgb(1.0, 1.0, 1.0)),
|
||||
];
|
||||
let veil = group(&mut doc, veil, false);
|
||||
cutter.extras_mut().mask = Some(Box::new(OpacityMask::new(veil, false)));
|
||||
let top = group(&mut doc, vec![cutter], true);
|
||||
doc.insert(Some(layer), usize::MAX, top).unwrap();
|
||||
let all = crate::import::objects_read(&export_ai_editing(&doc, &opts()).unwrap().program).unwrap();
|
||||
for room in 0..=all {
|
||||
let out = export_within(&doc, &opts(), room).unwrap();
|
||||
let text = String::from_utf8_lossy(&out.program).replace("\r\n", "\n");
|
||||
let (back, _) = crate::ai_alone(&out.program).unwrap();
|
||||
let mut carriers = vec![];
|
||||
back.layers[0].walk(&mut |n| {
|
||||
if matches!(n.kind, NodeKind::Compound { .. }) && n.appearance.items.is_empty() {
|
||||
carriers.push(n.extras().mask.is_some());
|
||||
}
|
||||
});
|
||||
assert!(carriers.is_empty() || carriers == [true], "{room}: {carriers:?}\n{text}");
|
||||
assert_eq!(carriers.is_empty(), !text.contains("(AI9_Mask)"), "{room}\n{text}");
|
||||
if room == all {
|
||||
assert_eq!(carriers, [true], "{text}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1231,17 +1231,19 @@ impl<'a> Writer<'a> {
|
||||
}
|
||||
|
||||
/// A container's members, the first one's outline cutting the others: its fills painted
|
||||
/// behind them (cut to the region outside too), its strokes over them, not cut by it. Its text
|
||||
/// wrap options are written once, under them all ([`Self::wrap_carrier`]), and not with its fills
|
||||
/// or strokes, which may be cut or left out.
|
||||
/// behind them (cut to the region outside too), its strokes over them, not cut by it. Its name,
|
||||
/// variables and text wrap options are written once, under them all, with its opacity mask
|
||||
/// ([`Self::object_carrier`]), and not with its fills or strokes, which may be cut or left out
|
||||
/// and keep only the opacity mask they are drawn through.
|
||||
fn clip_contents(&mut self, children: &[Arc<Node>]) {
|
||||
let Some((first, rest)) = children.split_first() else { return };
|
||||
self.wrap_carrier(first);
|
||||
self.object_carrier(first);
|
||||
// Nothing to clip by hides the clipped art.
|
||||
let Some((outline, rule)) = vectorcraft_effects::clip_outline(first) else { return };
|
||||
let mut paint = first.clip_paint();
|
||||
for part in [&mut paint.fill, &mut paint.stroke].into_iter().flatten() {
|
||||
part.extras_mut().wrap = None;
|
||||
part.name = None;
|
||||
}
|
||||
let outer = self.clip.clone();
|
||||
let region = self.cut(&PathData::from_bezpath(&outline), rule);
|
||||
@@ -1258,26 +1260,46 @@ impl<'a> Writer<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
/// The text wrap options of clipping object `first`, when it has them, on an unpainted path
|
||||
/// (a compound path for several subpaths) of the outline area type wraps around
|
||||
/// ([`vectorcraft_doc::text::wrap_outline`]), uncut, locked and hidden as `first` is. Nothing is
|
||||
/// written for an empty outline or without room for the path ([`Self::take_objects`]).
|
||||
fn wrap_carrier(&mut self, first: &Node) {
|
||||
let Some(wrap) = first.extras().wrap.filter(|_| self.drawn == 0 && !self.in_look) else { return };
|
||||
let outline = vectorcraft_doc::text::wrap_outline(first);
|
||||
if outline.is_empty() {
|
||||
/// The dictionary of clipping object `first` ([`Self::dictionary`]: its name, visibility
|
||||
/// variables, text wrap options and opacity mask), when it has one, on an unpainted path (a
|
||||
/// compound path for several subpaths), uncut, locked and hidden as `first` is. The path is the
|
||||
/// outline area type wraps around when `first` has text wrap options
|
||||
/// ([`vectorcraft_doc::text::wrap_outline`]); else, and without the options when that outline is
|
||||
/// empty, `first`'s clipping outline, or the rectangle of its bounds when it has none. Nothing
|
||||
/// is written without such a path, or without room for the path ([`Self::take_objects`]), or
|
||||
/// when the dictionary would be empty (an opacity mask left out with nothing else in it).
|
||||
fn object_carrier(&mut self, first: &Node) {
|
||||
let points = |p: &PathData| p.subpaths.iter().any(|sp| !sp.anchors.is_empty());
|
||||
let wrap = first.extras().wrap.filter(|_| self.drawn == 0 && !self.in_look);
|
||||
let wrap_outline = wrap.map(|_| vectorcraft_doc::text::wrap_outline(first)).filter(points);
|
||||
let named = first.name.as_deref().is_some_and(|s| !s.is_empty());
|
||||
let bound = !self.bound_variables(first, false, false).is_empty();
|
||||
if wrap_outline.is_none() && !named && !bound && first.extras().mask.is_none() {
|
||||
return;
|
||||
}
|
||||
let wrapped = wrap_outline.is_some();
|
||||
let outline = wrap_outline
|
||||
.or_else(|| vectorcraft_effects::clip_outline(first).map(|(o, _)| PathData::from_bezpath(&o)).filter(points))
|
||||
.or_else(|| finite_bounds(first).map(shapes::rectangle));
|
||||
let Some(outline) = outline else { return };
|
||||
let (start, state, gs, objects) = (self.body.len(), self.state, self.gs, self.objects);
|
||||
self.state(first.locked, !first.visible);
|
||||
let start = self.body.len();
|
||||
self.plain_object(&outline, FillRule::NonZero, None, None, Xy::of(first).object());
|
||||
if self.body.len() == start {
|
||||
if self.objects == objects {
|
||||
// Without the path, its lock and hidden lines are taken out too, and no dictionary follows.
|
||||
self.body.truncate(start);
|
||||
self.state = state;
|
||||
return;
|
||||
}
|
||||
self.block_end = usize::MAX;
|
||||
self.body.push_str("%_/ArtDictionary :\n");
|
||||
self.text_wrap(wrap);
|
||||
self.body.push_str("%_;\n%_\n");
|
||||
let path_end = self.body.len();
|
||||
// Text wrap options go only on the outline area type wraps around.
|
||||
self.wrap_moved = !wrapped;
|
||||
self.dictionary(first);
|
||||
if self.body.len() == path_end {
|
||||
self.body.truncate(start);
|
||||
(self.state, self.gs, self.objects) = (state, gs, objects);
|
||||
}
|
||||
}
|
||||
|
||||
/// `path` (filled by `rule`) cut to the region the art is cut to, as a non-zero path.
|
||||
|
||||
@@ -1842,6 +1842,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur
|
||||
A PDF-compatible `.ai` saved with Include Editing Data for Other Apps keeps the document's variables, data sets and the bindings of objects to variables in its editing copy, in the form the variable library reader above reads, so they come back when the file is opened. Bindings to layers, to type written as outlines, to graphs and to linked images written as other objects, data set values of graphs, and variables, data sets, bindings and values past the writer's limits are left out with a warning (#6024; `crates/eps/src/ai_editing/tests.rs` `variables_data_sets_and_bindings_are_read_back`; `crates/eps/src/ai_editing/writer/variables.rs` lists what is left out).
|
||||
A PDF-compatible `.ai` saved with Include Editing Data for Other Apps keeps each wrap object's Text Wrap Options in its editing copy: the Offset, positive or negative, and Invert Wrap ([the help page](https://helpx.adobe.com/illustrator/desktop/design-with-text/add-manage-text/wrap-or-unwrap-text-around-objects.html)), in the form the `.ai` reader reads them (`text_wrap` in `crates/eps/src/import/ai/read/document.rs`), so they come back when the file is opened. An offset past the -1000 to 1000 pt the reader keeps is written as the nearer end of that range. On a large canvas the offset is written at the art's scale and comes back at its size. Art the writer draws for an object, such as a blend's steps or a symbol instance written as its art, has only that object's options, and a clipping path written as its fills and its strokes has its options once (`crates/eps/src/ai_editing/tests.rs` `text_wrap_options_are_written_and_read_back`, `drawn_art_keeps_only_its_objects_text_wrap`, `text_wrap_offsets_on_a_large_canvas_come_back_at_their_size`, `text_wrap_options_of_type_and_envelopes_are_read_back`, `a_clipping_path_written_as_its_paint_keeps_one_text_wrap`).
|
||||
A clipping object whose clipped art is written cut to it (a group, an image, a symbol instance, type, or a path or compound path inside art cut to another clipping object) keeps its Text Wrap Options in the editing copy on an unpainted path, or compound path, of the outline area type wraps around, under the art it clips and locked or hidden as the object is. The `.ai` reader reads an unpainted path (`paint` in `crates/eps/src/import/ai/read/art.rs`) and gives it the options of the dictionary after it (`text_wrap` in `crates/eps/src/import/ai/read/document.rs`), so area type below the object wraps the same way when the file is opened. Without room for that path under the object limit, the options are left out (`crates/eps/src/ai_editing/tests.rs` `a_clipping_object_not_written_whole_keeps_its_text_wrap`, `a_clipping_objects_text_wrap_is_left_out_without_room`).
|
||||
The same unpainted path also carries that clipping object's name, opacity mask and visibility variables, so a group, image, symbol instance, live object, type or path used as a clipping object and written cut to it opens with one object of its name, its opacity mask, and its visibility variables bound to it. The clipping object's fills and strokes keep the opacity mask they are drawn through, without the name. The `.ai` reader gives the unpainted path the name, mask and XML id of the dictionary after it (`art_dictionary` at `crates/eps/src/import/ai/read/document.rs:752`) and binds the variable library's `docRef` to that XML id (`doc_ref` at `crates/eps/src/import/ai/read/document.rs:1731`). Text and image variables of such a clipping object are left out with a warning, since the reader binds them only to type and linked images. Without room for the path the dictionary is left out, and without room for the mask's art only the mask is left out (`crates/eps/src/ai_editing/tests.rs` `a_cut_clipping_object_keeps_its_name_mask_and_variables`, `a_cut_clipping_objects_dictionary_is_left_out_without_room`, `a_cut_clipping_object_without_room_for_its_mask_gets_no_carrier`).
|
||||
Area type wrapped only by plain saved paths, compound paths or groups remains editable in the `.ai` editing copy when each frame's wrap recomputes unchanged; other wrapped area type remains outlines. The `.ai` reader works the wrap out again from the objects above the type (`resolve_text_wrap` in `crates/eps/src/import/native/build.rs`), so the writer keeps type only where each wrap object is written as itself (one path with no paint, a solid fill or a plain solid stroke, a compound path of visible members, or a group of such objects, without effects, an opacity mask or clipping), its offset is within -1000 to 1000 pt, and the shapes of every area type in the file stay within the 2,000,000 anchors the reader copies; when art is left out at the object limit, such type is written as outlines. This is VectorCraft's own round-trip rule (`crates/eps/src/ai_editing/tests.rs` `area_type_wrapped_by_plain_objects_stays_type`, `area_type_wrapped_by_other_objects_stays_outlines`, `threaded_area_type_wrapped_by_plain_objects_stays_type`, `area_type_wrapped_on_a_large_canvas_stays_type`, `area_type_wrapped_past_the_reader_limit_stays_outlines`, `area_type_wrapped_past_the_object_limit_is_written_as_outlines`).
|
||||
Type written as its outlines in the editing copy still wraps area type by its bounds, not by its glyphs, when the file is opened: the outlines' group ends with an unpainted rectangle at the type's bounds that carries its Text Wrap Options, in the form the `.ai` reader reads a path's options (`text_wrap` in `crates/eps/src/import/ai/read/document.rs`), and the group keeps the type's name (`crates/eps/src/ai_editing/tests.rs` `type_written_as_outlines_keeps_wrapping_by_its_bounds`).
|
||||
A symbol instance written as its art, and a blend, mesh, repeat, placed document, intertwine or envelope written as a group of its art, likewise still wraps area type by its bounds when the file is opened, as it did before saving, not by the members of that art: the group starts with the same unpainted rectangle, which takes the object's lock and visibility, and the group keeps the object's name and transparency without options of its own. Area type in that art is above the rectangle, so the rectangle does not wrap it. The rectangle takes its place in the object limit before the art; without room for it, the options are left out with the limit's warning. An object without finite bounds keeps the options on its group. This is VectorCraft's own round-trip rule (`crates/eps/src/ai_editing/tests.rs` `live_art_written_as_a_group_keeps_wrapping_by_its_bounds`, `wrap_bounds_of_live_art_fit_the_object_limit_and_leave_area_type_in_the_art_unwrapped`, `live_art_without_bounds_keeps_its_text_wrap_on_the_group`).
|
||||
|
||||
Reference in New Issue
Block a user