Repository navigation
Envelopes: type's strokes paint at their own weight along the bent outlines - #6724
Conversation
…tlines (storytold#6644) With Envelope Options > Distort Appearance on, VectorCraft turned the strokes of type in an envelope into filled outlines and bent them with the art, so a stroke got thinner where the grid squeezes the type and thicker where it stretches it. The drawn art of users' .ai files keeps those strokes as stroked paths at the type's own weights, and the ring they paint is as wide wherever the grid squeezes or stretches the type. An envelope of stroked type in such a grid therefore didn't draw as its drawn art and kept it instead of opening live. Type's strokes (its characters' and those on its own appearance) now paint along the bent glyph outlines at their own weight, with Distort Appearance on or off, also in an envelope inside an envelope: - doc: `map_node` maps the groups that hold type's glyph outlines with `Hooks::type_appearance` in place of `Hooks::appearance`, for type in the envelope's contents and for type that a live object in them (an inner envelope) outlined (`Warper::type_outlines`). Such a group's opacity mask is mapped with the ordinary hooks, so it bends as other art does. Groups marked as type's outlines in the contents themselves (art an earlier Expand made) stay plain art. - effects: `bake_type_appearance`, `bake_appearance` with strokes kept as strokes: geometry effects on type's fills and strokes still bake in and bend. - doc: `max_outset` counts type's character strokes as type's own visual bounds do (`char_stroke_outset`). It left them out, though they already painted past an envelope's grid where the glyphs reach its edge; this also grows the visual bounds of blends and repeats of stroked type and the reach of symbol art holding it. Paths' strokes, geometry effects, opacity masks, linear gradients and pattern fills bend as before. The canvas, hit testing, effect bounds, Expand, every export and the .ai save take the evaluation from the same hooks. Expand of an envelope of stroked type gives the bent outlines with the strokes on them. This changes how VectorCraft's own envelopes of stroked type draw. Tests: envelope_distort::type_strokes_paint_at_their_own_weight_in_a_squeezed_envelope, a_stroke_on_types_appearance_paints_at_its_own_weight_in_a_squeezed_envelope, type_strokes_paint_at_their_own_weight_in_an_envelope_inside_an_envelope, a_paths_stroke_still_bends_in_a_squeezed_envelope, an_opacity_mask_on_type_bends_as_other_art, the_visual_bounds_of_an_envelope_hold_its_types_strokes, the_visual_bounds_of_a_repeat_of_stroked_type_grow_by_half_the_stroke, expanding_an_envelope_of_stroked_type_keeps_the_stroke_at_its_weight, bake::tests::type_pieces_bake_their_geometry_effects_and_keep_their_strokes and tests_native::an_envelope_of_stroked_type_whose_drawn_art_strokes_the_bent_outlines_at_the_weight_opens_live. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
Merged, thanks @jmverges! It passed its CI checks. |
What and why
Fixes #6644.
With Envelope Options › Distort Appearance on, VectorCraft turned the strokes of type in an envelope into filled outlines and bent them with the art. A stroke got thinner where the grid squeezes the type and thicker where it stretches it. The drawn art in users'
.aifiles keeps those strokes as stroked paths at the type's own weights, and the ring they paint is as wide wherever the grid squeezes or stretches the type. So an envelope of stroked type in such a grid didn't draw like its drawn art, and it kept that art instead of opening live.Type's strokes now paint along the bent glyph outlines at their own weight. That covers the characters' strokes and the strokes on the type's own appearance, with Distort Appearance on or off, and also in an envelope inside an envelope.
map_node(doc) maps the groups that hold type's glyph outlines with the newHooks::type_appearance, in place ofHooks::appearance. It does so for type in the envelope's contents, and for type that a live object in them outlined, such as an inner envelope (Warper::type_outlines).bake_type_appearance(effects) isbake_appearancewith strokes kept as strokes. Geometry effects on type's fills and strokes still bake in and bend.max_outset(doc) now counts type's character strokes the way type's own visual bounds do (char_stroke_outset). It used to leave them out, though they already painted past an envelope's grid where the glyphs reach its edge. This also grows the visual bounds of blends and repeats of stroked type, and the reach of symbol art that holds it.What still bends:
The canvas, hit testing, effect bounds, Expand, every export and the
.aisave all take the evaluation from the same hooks. Expand of an envelope of stroked type gives the bent outlines with the strokes on them.Before (
main) and after (this branch): "WAVE" at 110 pt with a 3 pt black stroke, in an arc warp with 75% horizontal distortion. Onmainthe stroke thickens where the warp enlarges the type; with this change it keeps its weight.Made with
vectorcraft-cli run(text.create,text.setStyle, thenobject.envelope.makeWithWarpwithh: 75), exported at 144 ppi.This changes how VectorCraft's own envelopes of stroked type draw. New envelopes have Distort Appearance on. #6644 asks the maintainers whether that's what you want.
How it was tested
envelope_distort::type_strokes_paint_at_their_own_weight_in_a_squeezed_envelopea_stroke_on_types_appearance_paints_at_its_own_weight_in_a_squeezed_envelopetype_strokes_paint_at_their_own_weight_in_an_envelope_inside_an_envelopean_opacity_mask_on_type_bends_as_other_artthe_visual_bounds_of_an_envelope_hold_its_types_strokes(it also caps them)the_visual_bounds_of_a_repeat_of_stroked_type_grow_by_half_the_strokeexpanding_an_envelope_of_stroked_type_keeps_the_stroke_at_its_weightbake::tests::type_pieces_bake_their_geometry_effects_and_keep_their_strokestests_native::an_envelope_of_stroked_type_whose_drawn_art_strokes_the_bent_outlines_at_the_weight_opens_livea_paths_stroke_still_bends_in_a_squeezed_envelopeand the existingdistort_appearance_bends_strokes_and_effects_with_the_artpass either way.a_warp_of_stroked_type_maps_from_its_bounds_with_strokes_where_its_drawn_art_doesbuilt its drawn art with VectorCraft's old bent-stroke evaluation, which filled the outlines and dropped the strokes. It now uses the same helper as the import test, which strokes the bent outlines at the weight. It still checks the stroked box from [Bug Report] [VectorCraft] Envelope Distort #3179.cargo xtask ciwith Rust 1.99.1 on Linux x86_64 passed on this branch, rebased onmainat b08e421: fmt, clippy, the workspace tests (18,045 passed), doctests, no-bundled-fonts, pdf-deps, assets, brands, cursors, layers, wasm and i18n-report. As before, I skippedvectorcraft-text'stests::harakat::coloured_harakat_keep_kashida, which picks up the Arial installed here. Note thatvectorcraft-effects'envelope_ink::live_evaluation_measures_type_in_envelopes_by_its_glyphsfails when run withcargo test -p vectorcraft-effectsalone, onmaintoo: without the bundled fonts the default font draws nothing. It passes in the workspace run.main:Checklist
cargo xtask cipasses (fmt, clippy, tests, assets, brands, layers, wasm), apart from the machine-specificvectorcraft-texttest noted 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