Repository navigation
.ai import: copied area type and type on a path keep their own place - #1208
Conversation
Read through its editing data, a .ai put the copies of area type and type on a path on top of their original: the text document's frame of a copied object keeps the original's path (with a matrix of its own that isn't understood yet). The object's `/Art` path, which the layers' data keeps for each text object, is where the file places it: area type and type on a path now take it as their frame or path, by story and frame. On a file of cards made by copying one, the type laid out from the text document now lands on each card (515 text objects where its PDF part has them, against 467, many on one card, before). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
995a747 to
66fd1b7
Compare
|
Merged, thanks @p0lyg0n! Reading each object's own |
|
A correction to the description above: "checked on the real file" was wrong. When I checked, that file didn't open from its editing data at all. Its layers differed from the page in 5.0%, at the limit, so it fell back to its PDF part, and this change wasn't exercised on it. Sorry for the noise. On current main, the same file opens from its editing data with its type in place. Three things still differ from its page: badges drawn with several fills come in black, the last words of one description are cut off, and one title runs into its badge. I'll look into those separately. |
In a
.airead through its editing data, every copy of a piece of area type or type on a path landed on top of its original.The text document's frame for a copied object keeps the original's path. It carries a matrix of its own (
/2 [ 1 0 0 1 tx ty ]), but I couldn't pin down how that matrix maps to the page: the x offsets match the copies' spacing, while adding the y offset puts the frames off the page, so I didn't guess at it. Each/AI11Textobject in the layers' data already carries its own/Artpath (before/ConfiningPath), in absolute art-space coordinates, written with the documented path operators.ai/frames.rs:text_frames(data)reads each text object's/Artpath, keyed by story and frame (/StoryIndex,/FrameIndex), on plain lines or lines led by%_. It caps object count and size, and objects without a readable path are skipped.native.rs: when a story's frame is area type or type on a path, its node takes the object's own path as frame or path. Its region, which is used to match the page's type, is recomputed from that path. Point type is untouched, and so is any object without an/Artpath.Tests:
frames::each_text_object_has_its_own_frame_by_story_and_frame.tests_native::a_copied_area_type_object_is_framed_where_its_own_art_path_is: the text document frames the story at its original; the copy's/Artframes it elsewhere, and the area type lands there. The test fails without the change.On a real file of cards made by copying one card (two artboards, 515 text objects on its PDF part), opening it through the editing data gave 467 text objects, with every card's description and title arc piled onto one card. With this change all 515 come back, with the same text in the same place as the PDF part. The only remaining difference is the second artboard, which keeps the file's spacing.
cargo xtask cipasses.🤖 Generated with Claude Code