Repository navigation
.ai import: envelopes of type open live where they draw as their drawn art (#3179) - #6421
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
fa0d1a3 to
7967c61
Compare
…n art An envelope whose contents hold type kept its drawn art, with the type hidden, because the type is laid out from the text document only after the layers are read. It now waits for that, as warped type does: once its text slots hold their type, the envelope is made of that type and drawn by VectorCraft's own rule, and where it draws as the drawn art the file saves (the same check and budget as other envelopes) it takes the drawn art's place, with the type visible and editable in Edit Contents. The hidden copy of the type goes. As other live envelopes are, it is held to the page: when the layers with it don't draw as the page, its drawn art and hidden type are put back. A .ai whose layers would open alone, without its PDF part, now waits on the PDF part when an envelope of type is in them; where none opens live, the layers open alone as before. Layers built without a page leave envelopes of type their drawn art. Elsewhere it keeps its drawn art and hidden type, with the note: type in a font that isn't available, a slot without made type (threaded, bound to a text variable, a wrap object, type a look draws), an envelope that doesn't read, no check left, or one that draws differently. Envelopes in a symbol's or a pattern's art keep their drawn art. Part of storytold#3179. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…it draws The comparison with the page counts the area of each text object that shows as type, which it holds to less (type laid out again from the file's text can sit a little apart from the page's). It took the text object in a live envelope's contents for such type, at its own unbent box, so most of what an envelope of type draws went unweighed: one opened live where the page draws other art there, with only a note that the type differs. The envelope draws its type bent, as art, and is now weighed as such, as the drawn art it takes the place of is. Part of storytold#3179. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ugh they differ from the page An envelope of type opens live only where the layers with it draw as the page. Two ways of using layers that don't left it live all the same: the editing data trusted (they come from it with a note), and the objects that draw differently coming in as the page's art. In both the envelope now keeps its drawn art and its type, hidden, with the note, as where its drawn art is put back. A .ai whose layers would open alone, without its PDF part, then opens alone again, as it did before envelopes of type could open live, rather than compared with the page. The type put back no longer carries the mark of type made from the text document in its name. Part of storytold#3179. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…its drawn art A variable library binds the text object a slot of the envelope's contents became, which stays hidden beside the drawn art. Once the envelope opened live that hidden text object went, and its type in the envelope has an id of its own, so a visibility binding was dropped and counted as one that wasn't made. A slot bound to a text variable already kept the drawn art; one bound to a visibility variable does too now, with the note, so the binding is kept. Carrying the binding over to the type in the live envelope would bind an object inside an envelope's contents, which nothing in the import, the data sets or the .ai writer is known to handle, so it is left for later. Part of storytold#3179. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The file-format revision row for storytold#3179 says that the page check weighs a live envelope of type as the art it draws, that layers used though they don't draw as the page leave envelopes of type their drawn art, and that a slot bound to a visibility variable keeps it too, and lists the new tests. The parity assessment's evidence says the same, and the change gets its row and status entry there. Part of storytold#3179. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e until the drawn art is found The put-back after a failed page check replaces each live envelope with its drawn art in one go, which fails as a whole when one envelope lies in another's art: only the outermost are put back now. A live envelope of type removes its hidden type only once it has found the drawn art it replaces. The file format docs lose a revision row left twice by a rebase. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
7967c61 to
309d7e5
Compare
|
Merged, thanks @jmverges! It passed its CI checks. |
What and why
Part of #3179. Follows #6383 (the import note for type in an envelope), which has merged.
An envelope whose contents hold type (a warp, a mesh or a top object around type) kept its drawn art in a
.ai, with the type hidden, because the type is laid out from the text document only after the layers are read, so the envelope couldn't be built when itsXPclosed it.Now such an envelope waits for the type, the way warped type already does. Once its text slots hold their type, the envelope is built from that type and drawn by VectorCraft's own envelope rule. Where that draws as the drawn art the file saves (same check and same budget as other envelopes, seen on white and on black since #6413), it takes the drawn art's place: the type is visible and editable in Edit Contents, and the hidden copy goes away.
Elsewhere it keeps its drawn art and hidden type, with the #6383 note. That covers type in a font that isn't installed, a slot without type of its own (threaded, bound to a text or a visibility variable, a wrap object, type a look draws), an envelope in a symbol's or a pattern's art, an envelope that doesn't read, no check left, or one that draws differently.
The strict choice: typed envelopes go through the page comparison too
A live envelope made while reading (
end_envelope) is held to the page:Structure::envelopes_drawnmakesnothing_waits_on_pagefalse, so the layers are compared with the PDF part. Where they don't draw as it, the drawn art is put back (drawn_or_trusted). Typed envelopes now follow the same rules:envelopes_drawnwith its hidden type and drawn art. When the layers don't draw as the page, both are put back, as for other envelopes..aiwhose layers would otherwise open alone (ai_layers_alone, PDF part not imported) waits on the PDF part when an envelope of type is pending, so one can only open live after the page comparison.envelopes_drawndoes" version moved 16 of our files from their layers to their PDF part, because their layers had never been compared with the page before. That's a regression nobody asked for.build_without_page,build_on_page) leave envelopes of type their drawn art (WarpedType::compared).trust), and when the objects that differ come in as the page's art (keep_differing). A.aiwhose layers would open alone then opens alone, as before.If maintainers would rather rely on each envelope's own check against its drawn art and skip the page comparison for typed envelopes, the relaxation is small. Remove the
has_envelopes()early return inai_layers_alone, the onewarped_type.compared(...)line inbuild_fromand the twotype_drawncalls (the trust branch ofdrawn_or_trusted, and beforekeep_differing), and the page-comparison conditions are gone. The comparison weighing a live envelope as art stays either way. The per-envelope check against the drawn art stays either way. I measured that variant too: it gives the same 74 live envelopes on our files, so in this sample strictness costs no live envelopes, only importing the PDF part for files that carry type envelopes. Typed envelopes would still be put back byenvelopes_drawnwhen a page is there, so a full relaxation also needs that path adjusted.Known limits (found in review, not changed here)
How it was tested
tests_native::an_envelope_of_type_that_draws_as_its_drawn_art_opens_live,an_envelope_of_type_that_draws_apart_from_its_drawn_art_keeps_it,an_envelope_of_white_type_that_draws_apart_from_its_drawn_art_keeps_it,an_envelope_of_type_waits_on_the_page_of_layers_that_would_open_alone,an_envelope_of_type_that_draws_apart_from_the_page_does_not_open_live,trusted_layers_that_draw_apart_from_the_page_leave_an_envelope_of_type_its_drawn_art,layers_with_objects_that_come_in_as_the_page_art_leave_an_envelope_of_type_its_drawn_artandan_envelope_of_type_bound_to_a_visibility_variable_keeps_its_drawn_art. The last one checks that layers which would open alone wait on the PDF part, open alone with the drawn art when the PDF part differs, and open live when it matches. It fails with either half of the change disabled. All synthetic, written from scratch; the font-dependent ones skip when no font is installed, as before.cargo xtask ciwith Rust 1.99.1 on Linux x86_64, run one by one on this branch rebased onmain: fmt, clippy, test, doctests, no-bundled-fonts, pdf-deps, assets, brands, cursors, layers, wasm and i18n-report pass. As in PDF import: image masks open colorized by the color they are painted in (#6313) #6321, one test that fails on my machine whatever the change was skipped:vectorcraft-text'stests::harakat::coloured_harakat_keep_kashida, which picks the Arial installed here.main:main(which has .ai import: a note for type in an envelope (part of #3179) #6383): one file loses the type-in-envelope note, and two files whose layers are now compared with the page gain its type notes.Warps of type never matched their drawn art in these files, so they keep it. A follow-up check found that the content size these files save doesn't explain it: it varies widely against the type's boxes and is often stale, and mapping from it opened none of the 99. In many, the contents sit away from the drawn art; where they line up, VectorCraft's warp still bends differently from the warp grid the file saves. So this PR leaves warps alone.
Checklist
cargo xtask cipasses (fmt, clippy, tests, assets, brands, layers, wasm), apart from the one machine-specificvectorcraft-texttest above.unwrap(),expect(),panic!,unreachable!,todo!orunimplemented!outside tests, and no unchecked indexing on data from files, parameters ormessages. Errors are returned as
Resultand shown to the user(why and how).
ASSETS.md(none added).Summary by CodeRabbit