Files
vectorcraft/crates/eps
jmvergesandClaude Opus 5.5 f71fe2e5d8 .ai import: type that ends a clipping group without a clipping path clips it
Illustrator writes a clipping mask of type from the text document as a
clipping group (`q` ... `Q`) with no clipping path (`W`), the text object
(`/AI11Text`) last. The reader took only `W` paths (and legacy type in
rendering modes 4 to 7) as clipping paths, so it read such a group unclipped:
its art painted past the letters, and where the layers then differed too much
from the page the file opened as its page.

- `Reader::end_container` records each clipping group with no clipping path
  whose last object is a text slot (not the type a look draws) in
  `Structure::type_clips`, by the group's id. The group is still read as it is:
  the slot is filled later.
- `clip_by_type` (crates/eps/src/import/ai/read.rs) moves the type to the
  front as the group's clipping path once its slot became one text object that
  is still the group's last object. A slot left empty or filled with several
  objects (type and the strokes the page draws around it) leaves the group as
  read, unclipped, as before.
- The layers apply it after `fill_slots`; such type is never weighed as type
  the page doesn't draw (`MADE` is taken off), since the page shows it by what
  it clips. Envelopes of type apply it to their contents after `put_type`, so
  one opens live where its drawn art shows the clip (`WarpedType::type_clips`).

Measured on 224 garment files we own (used locally, never committed): 14 renders
change; 12 come closer to the file's own page (for example 15.7 % → 0.07 %,
26.5 % → 0.28 %, 58.5 % → 1.4 % of the page differing), one file has no PDF
content to compare with, and in one the texture inside a word changes along
the letters' edges (0.35 % → 0.56 %). Envelopes of type that open live stay at
185; no file opens another way and no note changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 07:42:46 +00:00
..