Skip to content

Envelopes: type's strokes paint at their own weight along the bent outlines - #6724

Merged
bflatastic merged 1 commit into
storytold:mainfrom
jmverges:fix/6644-envelope-type-strokes
Nov 12, 2026
Merged

bflatastic merged 1 commit into
storytold:mainfrom
jmverges:fix/6644-envelope-type-strokes

Conversation

@jmverges

@jmverges jmverges commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

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' .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. 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 new Hooks::type_appearance, in place of Hooks::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).
    • Such a group's opacity mask is mapped with the ordinary hooks, so it bends like other art.
    • Groups marked as type outlines in the contents themselves, such as art an earlier Expand made, stay plain art.
  • bake_type_appearance (effects) is bake_appearance with 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:

  • paths' strokes;
  • geometry effects;
  • opacity masks;
  • linear gradients and pattern fills, following their own options.

The canvas, hit testing, effect bounds, Expand, every export and the .ai save 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. On main the stroke thickens where the warp enlarges the type; with this change it keeps its weight.

Before: main

After: this branch

Made with vectorcraft-cli run (text.create, text.setStyle, then object.envelope.makeWithWarp with h: 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

  • New 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
    • an_opacity_mask_on_type_bends_as_other_art
    • the_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_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
    • tests_native::an_envelope_of_stroked_type_whose_drawn_art_strokes_the_bent_outlines_at_the_weight_opens_live
    • All of them fail without the change, each against the mutation of the part it covers.
  • Guard: a_paths_stroke_still_bends_in_a_squeezed_envelope and the existing distort_appearance_bends_strokes_and_effects_with_the_art pass either way.
  • Changed helper: a_warp_of_stroked_type_maps_from_its_bounds_with_strokes_where_its_drawn_art_does built 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.
  • Gate: every step of cargo xtask ci with Rust 1.99.1 on Linux x86_64 passed on this branch, rebased on main at 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 skipped vectorcraft-text's tests::harakat::coloured_harakat_keep_kashida, which picks up the Arial installed here. Note that vectorcraft-effects' envelope_ink::live_evaluation_measures_type_in_envelopes_by_its_glyphs fails when run with cargo test -p vectorcraft-effects alone, on main too: without the bundled fonts the default font draws nothing. It passes in the workspace run.
  • Measured on 224 of our own garment files, used locally and never committed, against main:
    • Envelopes of type that open live: 135 → 154 of 203, in 13 more files. No file loses one.
    • Read mode (layers vs PDF part): no file changed.
    • Renders: 31 files changed, at most 2.3% of pixels.
      • 19 came closer to the file's own page.
      • 11 moved a little further, because an envelope now opens live in place of its drawn art (the page's own art).
      • One moved by 4 pixels.
    • Notes:

Checklist

  • cargo xtask ci passes (fmt, clippy, tests, assets, brands, layers, wasm), apart from the machine-specific vectorcraft-text test noted above.
  • No panics in shipped code: no unwrap(), expect(), panic!, unreachable!, todo! or
    unimplemented! outside tests, and no unchecked indexing on data from files, parameters or
    messages. Errors are returned as Result and shown to the user
    (why and how).
  • Clean-room: nothing copied from Adobe products or GPL/AGPL code (AGENTS.md).
  • Every new asset has a row in ASSETS.md (none added).

Summary by CodeRabbit

  • New Features
    • Text strokes inside envelopes now follow the bent glyph outlines while retaining their stroke weight, including with Distort Appearance enabled and in nested envelopes.
    • Geometry effects and opacity masks on text continue to bend with the envelope. Visual bounds now account for text strokes.
    • Expanding an envelope preserves text strokes as strokes rather than converting them into filled outlines.
  • Documentation
    • Updated envelope guidance and compatibility notes to describe text-stroke behavior.

…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>
@coderabbitai

coderabbitai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The change keeps type strokes at their own weight along bent glyph outlines in envelopes. Type geometry effects and opacity-mask strokes still distort. Envelope bounds include character strokes. Regression tests and parity documentation cover rendering, expansion, and EPS import behavior.

Changes: Envelope type stroke rendering

Layer / File(s) Summary
Type appearance baking
crates/effects/src/bake.rs, crates/effects/src/bake/tests.rs, crates/effects/src/lib.rs, crates/effects/src/live.rs
Adds type-specific appearance baking that applies geometry effects without outlining strokes. Live expansion provides this baker through a dedicated hook.
Envelope mapping and bounds
crates/doc/src/live/expand.rs, crates/doc/src/live/envelope.rs, crates/engine/src/tests/envelope_distort.rs
Envelope mapping tracks type outlines and uses type-specific baking in that context. Character-stroke outsets contribute to envelope bounds. Tests cover stroke weight, nested envelopes, opacity masks, and expansion.
Import coverage and parity records
crates/eps/src/import/tests_native.rs, docs/file-format-parity.md, docs/mcp.md, docs/target-app-parity.md, docs/type-parity.md
EPS tests cover stroked type whose drawn envelope strokes follow bent glyph outlines. Parity documents describe rendering, bounds, expansion, and import behavior.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix · Severity of issue fixed: Medium

Suggested reviewers: dotcoocoo, bflatastic, aiongg

Merge Risk: Minimal · up to 54303

Type strokes in envelopes now keep their own weight along bent outlines, and the reviewed paths show no concrete merge-blocking defect. Stroked text nested inside an opacity mask is an unclear edge case that may be worth documenting or testing later.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: type strokes in envelopes now paint at their own weight along the bent glyph outlines. The changeset matches this (doc, effects, engine tests, and docs). The title is …
Description check Passed The description follows the template. It has 'What and why' with a clear explanation of the problem, the fix, and the scope (including what still bends). It has 'How it was tested' with the new tests,…
Linked Issues check Passed [#6644] The linked issue asks that type's strokes paint along the bent glyph outlines at their own weight with Distort Appearance on. The summary of changes shows this behavior: crates/doc/src/live/ex…
Out of Scope Changes check Passed The changes stay connected to #6644. Core changes are in crates/doc/src/live/expand.rs, crates/doc/src/live/envelope.rs, crates/effects/src/bake.rs, crates/effects/src/lib.rs, and crates/effects/src/l…
Full details: Title check

Explanation

The title names the main change: type strokes in envelopes now paint at their own weight along the bent glyph outlines. The changeset matches this (doc, effects, engine tests, and docs). The title is specific and concise, and it is an accurate summary of the primary behavior change.

Full details: Description check

Explanation

The description follows the template. It has 'What and why' with a clear explanation of the problem, the fix, and the scope (including what still bends). It has 'How it was tested' with the new tests, the guard test, the CI gate, and measurements. The checklist is filled in. It links issue #6644 and includes before/after images. The description is thorough and the template structure is respected.

Full details: Linked Issues check

Explanation

[#6644] The linked issue asks that type's strokes paint along the bent glyph outlines at their own weight with Distort Appearance on. The summary of changes shows this behavior: crates/doc/src/live/expand.rs adds Hooks::type_appearance and Warper::type_outlines, which map type's glyph-outline groups with the new hook instead of Hooks::appearance. crates/effects/src/bake.rs adds bake_type_appearance, which keeps strokes as strokes (outline_strokes = false) and still bakes geometry effects. crates/effects/src/live.rs wires this hook into with_hooks. Nested envelopes are covered through the propagated type-outline context. Paths' strokes are left unchanged, which matches the issue's evidence scope. The summary lists engine tests in crates/engine/src/tests/envelope_distort.rs and an EPS import test in tests_native.rs that cover the squeezed-envelope stroke weight, nested envelopes, opacity masks, and Expand. The issue is open and frames the change as a maintainer question. The PR answers that question by implementing the requested behavior. Assessment is based on the whole-PR summary and the described tests. I did not read the test bodies or the full diff, so test-level correctness rests on the author's report.

Full details: Out of Scope Changes check

Explanation

The changes stay connected to #6644. Core changes are in crates/doc/src/live/expand.rs, crates/doc/src/live/envelope.rs, crates/effects/src/bake.rs, crates/effects/src/lib.rs, and crates/effects/src/live.rs. These implement the type-appearance evaluation path. Supporting tests in crates/engine/src/tests/envelope_distort.rs, crates/effects/src/bake/tests.rs, and crates/eps/src/import/tests_native.rs cover that path. The max_outset change (char_stroke_outset counted in envelope bounds) is a necessary consequence of the change: once type strokes paint at their own weight past the grid, the envelope's visual bounds must include them. Its wider effect on blend, repeat, and symbol-art bounds follows from the same shared bounds logic and is not a separate feature. The docs updates (docs/mcp.md, docs/type-parity.md, docs/target-app-parity.md, docs/file-format-parity.md) describe the changed behavior. The PR also changes the drawn-art test helper for #3179 to use the new import helper. The author states that it still checks the stroked box from #3179. No change was found that is unrelated to the issue.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

LanguageTool

LanguageTool checks are incomplete because the process-local organization character budget was exhausted. Remaining chunks and files were skipped; findings from completed checks are retained.

docs/target-app-parity.md

LanguageTool checks are incomplete because the per-file request limit of 5 was reached. Remaining text was skipped; findings from completed checks are retained.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 7f3a046 and 5430349.

Files selected for processing: 12

  • crates/doc/src/live/envelope.rs
  • crates/doc/src/live/expand.rs
  • crates/effects/src/bake.rs
  • crates/effects/src/bake/tests.rs
  • crates/effects/src/lib.rs
  • crates/effects/src/live.rs
  • crates/engine/src/tests/envelope_distort.rs
  • crates/eps/src/import/tests_native.rs
  • docs/file-format-parity.md
  • docs/mcp.md
  • docs/target-app-parity.md
  • docs/type-parity.md

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@bflatastic
bflatastic merged commit 53e0969 into storytold:main Nov 12, 2026
7 checks passed
@bflatastic

Copy link
Copy Markdown
Member

Merged, thanks @jmverges! It passed its CI checks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Envelopes: with Distort Appearance, type's strokes bend with the art, while .ai files draw them at their own weight

2 participants