Skip to content

.ai import: Offset Path, Outline Object and Outline Stroke open live - #5148

Merged
bflatastic merged 2 commits into
storytold:mainfrom
dotCooCoo:fix/ai-os10-path
Nov 2, 2026
Merged

bflatastic merged 2 commits into
storytold:mainfrom
dotCooCoo:fix/ai-os10-path

Conversation

@dotCooCoo

@dotCooCoo dotCooCoo commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

What and why

Part of #637.

A .ai or EPS path whose art style is one fill and one stroke at most, with Offset Path, Outline Object or Outline Stroke on the whole object, now opens as itself with those effects live, instead of as its drawn look. Type with Outline Object or Outline Stroke, on the object or on one of its fills or strokes, now keeps its art style live too. Effects can be applied to a whole object or to one of its fills or strokes (Help: apply and modify effects: "select the object and then select the attribute in the Appearance panel").

  • The filters are Adobe Offset Path, Adobe Outline Type (Outline Object) and Adobe Outline Stroke, as in this MIT-licensed effect script (LE_Functions.js, whose LE_OutlineObject writes Adobe Outline Type). Outline Object and Outline Stroke have no settings. Outline Stroke takes its width from the stroke it applies to.
  • Offset Path keeps its Offset, Joins and Miter Limit (Help: offset duplicate objects: "Specify the Offset, Joins, and Miter limit in the Offset Path dialog box"). The keys are ofst in points, jntp and mlim (community post: "0 = round, 1=bevel, 2=miter"; archived aiscripts.com post: "mlim is the MiterLimit Value").
  • The effects keep their order among the object's other effects (Help: appearance attributes: "Effects are listed from top to bottom in the order in which they are applied to the artwork"), and a hidden effect stays hidden.

An Offset Path with a missing key, an unknown key, a key of another type, a value that isn't a finite number, an offset beyond 100,000 pt, a miter limit outside 1 to 500 or a join other than 0, 1 or 2 now keeps the drawn look. Before, on type, a missing setting was read as 10 pt, miter or 4, and an out-of-range one was clamped. An Outline Object or Outline Stroke with any setting also keeps the drawn look. A path with one of these effects on one fill or stroke keeps its drawn look as before.

How it was tested

Synthetic art styles written in the tests, from scratch:

  • crates/eps/src/import/ai/style/tests.rs: Offset Path on the object with each join and a negative offset; Outline Object and Outline Stroke on the object, a fill and a stroke, Outline Object before the item's own style and Outline Stroke after it; two Offset Paths in order with the first one hidden; Offset Path before Transform on a fill and a stroke; and 15 Offset Path dictionaries that are not read (empty, ofst only, jntp only, a missing mlim, an extra key, wrong types, a string, an infinite value, an offset or miter limit out of range, joins 3, -1 and 0.5), on the object and on a fill.
  • crates/eps/src/import/ai/tests.rs: a path keeps its own geometry with Offset Path, a hidden Outline Object and Outline Stroke live; an Offset Path without mlim keeps the drawn look.
  • crates/eps/src/import/tests_native.rs: type keeps Outline Object on one fill. The Offset Path in that test now has its mlim.
  • With the three filters ignored, 7 tests fail.
  • crates/engine/tests/import_fuzz.rs: a new case with up to five of the three effects, shown or hidden, with any of Offset Path's keys and unknown ones as any type and value, on the object, a fill or a stroke of a path, a group and type; the hostile-data tokens include the filters and their keys.

On db33fea21e (base 05d5f99fd7), macOS:

  • cargo fmt --all -- --check
  • cargo clippy -p vectorcraft-eps -p vectorcraft-engine --all-targets -- -D warnings
  • cargo test -p vectorcraft-eps: 546 passed
  • cargo test -p vectorcraft-engine --lib -- ai: 391 passed
  • cargo xtask brands, layers, assets

The branch merges cleanly with main at 77274ac5ff. It changes the same lines of crates/eps/src/import/ai/style.rs as #5139, #5140, #5142 and #5144, and of docs/file-format-parity.md as #5046, #5082 and #5132; whichever merges later needs a rebase.

cargo xtask ci passed in this pull request's CI run on db33fea21e: https://github.com/storytold/vectorcraft/actions/runs/41339491685/job/124946281520

Checklist

  • cargo xtask ci passes (fmt, clippy, tests, assets, brands, layers, wasm).
  • 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.

Summary by CodeRabbit

  • New Features
    • .ai files now preserve supported live Offset Path, Outline Object, and Outline Stroke effects on eligible objects, including their settings, visibility, and order.
    • Supported effects can also be retained on text appearances.
  • Bug Fixes
    • Offset Path effects with missing, malformed, or out-of-range settings are no longer treated as supported live effects; these imports fall back to the drawn appearance.
  • Documentation
    • Updated .ai format guidance to clarify supported live effects and drawn-appearance fallback behavior.

@coderabbitai

coderabbitai Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Caution

Review failed

The pull request is closed.

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 5628de9 and db33fea.

Files selected for processing: 7
  • crates/engine/tests/import_fuzz.rs
  • crates/eps/src/import/ai/style.rs
  • crates/eps/src/import/ai/style/tests.rs
  • crates/eps/src/import/ai/tests.rs
  • crates/eps/src/import/tests_native.rs
  • docs/file-format-parity.md
  • docs/target-app-parity.md

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

Walkthrough

The Illustrator importer now recognizes Offset Path, Outline Object, and Outline Stroke effects in art styles. It validates Offset Path settings, preserves effect visibility and order, and includes tests for valid effects, invalid settings, and panic-free imports.

Changes: Illustrator Path Effects

Layer / File(s) Summary
Filter parsing and validation
crates/eps/src/import/ai/style.rs, crates/eps/src/import/ai/style/tests.rs, crates/engine/tests/import_fuzz.rs
The parser records filter entry types and recognizes Offset Path only when its required typed values are present and valid. It recognizes outline effects with no dictionary entries. Tests and fuzz coverage exercise settings, ordering, visibility, malformed values, and import panic behavior.
Path import and parity
crates/eps/src/import/ai/tests.rs, crates/eps/src/import/tests_native.rs, docs/file-format-parity.md, docs/target-app-parity.md
Import tests cover live path effects and drawn-look fallback when Offset Path settings are incomplete. Parity documentation describes supported effects, preserved settings, and unsupported effects on individual fills or strokes.

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

Change: Feature

Suggested reviewers: aiongg, erickuck

Merge Risk: Minimal · previous review db33f

The imported outline effects remain live on type. No concrete issue identified here prevents merging after normal checks.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 42.86% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title names the three effects (Offset Path, Outline Object, Outline Stroke) and the outcome (they open as live effects on .ai import). The changeset adds parsing, tests, and docs for exactly these…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The description includes the required What and why, How it was tested, and Checklist sections. It explains the behavior, fallback cases, test coverage, reported validation results, and marks all check…
Full details: Title check

Explanation

The title names the three effects (Offset Path, Outline Object, Outline Stroke) and the outcome (they open as live effects on .ai import). The changeset adds parsing, tests, and docs for exactly these effects, so the title matches the main change.

Full details: Description check

Explanation

The description includes the required What and why, How it was tested, and Checklist sections. It explains the behavior, fallback cases, test coverage, reported validation results, and marks all checklist items complete.

Full details: Docstring Coverage

Explanation

Docstring coverage is 42.86% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 7 functions across 5 files. (2 skipped: 2 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@bflatastic
bflatastic merged commit 7dc14eb into storytold:main Nov 2, 2026
3 checks passed
@bflatastic

Copy link
Copy Markdown
Member

Merged, thanks @dotCooCoo! It went in with this round's batch after a full CI run and a live check. Convert to Shape's test now expects Offset Path beside it to be read on any object, since this makes Offset Path live everywhere.

dotCooCoo added a commit to dotCooCoo/vectorcraft that referenced this pull request Nov 2, 2026
Read the Pathfinder filter through the shared dictionary parser's
Filter.kinds from storytold#5148 in place of the branch's own key tracker. Only
Add (Command 0) is read: its keys and values come from a public
LiveEffect XML example, and the other command numbers have no public
source, so they keep the drawn look.
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.

2 participants