Area type with wrap shapes was always written as outlines in the editing
data for other apps. It is now written as type when the reader works the
same wrap out again from the objects above it: each wrap object is a path
of one subpath, a compound path of visible members, or an unclipped group
of such objects, with no paint, or a solid fill, a plain solid stroke or
both, without effects, art style, opacity mask or clipping, with an
offset within -1000 to 1000 pt; the type's stored shapes match the ones
those objects give it; and the shapes of all area type stay within the
2,000,000 anchors the reader copies. Each frame of a thread is checked on
its own. When art is left out at the object limit, such type is written
as outlines again. Other wrapped area type stays outlines.
The reader recomputes the wrap with resolve_wrap after reading
(resolve_text_wrap in crates/eps/src/import/native/build.rs) and reads the
options with text_wrap in crates/eps/src/import/ai/read/document.rs; the
round-trip tests check the reopened characters, frame, wrap shapes and
wrap objects. resolve_wrap's layer walk is shared through a new
wrap_sources so the check follows the same traversal.
EMF, WMF and SVG wrote a symbol instance from its symbol's art as stored,
so live effects inside that art were missing: a square moved 100 pt by a
Transform effect stayed in place in the file while the canvas drew it
moved. Art whose own place is off the artboard was left out even when
the effect moved it onto it.
These exports now call bake_document_placing_symbols, as PDF, print, EPS
and DXF do: each instance of a symbol whose art needs baking is written
as that art placed by the instance and then baked, so an instance that
scales or turns its art does not scale what its effects do. EMF and SVG
clip 9-slice cells and WMF does not, as each places other instances. In
SVG those instances are written as groups; instances of symbols without
such effects still share one <symbol>. Preserve Editing still embeds the
document with its live effects.
WrittenLayers gains hidden_objects. SVG sets it with Hidden Layers on,
since it then writes hidden objects too, so a hidden instance is written
hidden with its effects applied. The other exporters leave it off.
An SVG instance nested in another instance's art was shared through
<use> when the def allowed its own transform, while the <use> writes
that transform after the outer instances'. A stroked symbol nested in a
scaled instance then drew its stroke at double weight. The check now
uses the transform the <use> writes.
The editing copy of a large canvas wrote every envelope as its drawn
art. It now writes warp, mesh and top object envelopes live at 1/10 of
their size with the rest of the art, under the same checks as on a
normal canvas, and the reader opens them at their size from the editing
data alone or beside the PDF part.
Read from the editing data alone, a Large Canvas copy also gets:
- an envelope's saved box size compared with its contents at the
declared scale, so a bounds margin kept with Distort Appearance is no
longer lost;
- every path's stroke weight, dashes and dash offset at the declared
scale, not at 1/10.
An envelope record that lies in an outer envelope's AIDeformArtKey
block (X= ... X+) with no group around it now opens as a live envelope
inside the live outer one, and an object's own dictionary there (its
name) applies to it. Each envelope is still compared with its own drawn
art: an inner one that doesn't match keeps its drawn art as the outer
envelope's contents, and an outer one that doesn't match keeps its own.
- An envelope record in an opacity mask's art reads as part of the
mask; its block's X+ no longer ends the mask's art, which failed the
import.
- Envelopes still waiting for their XP when a dictionary ends keep
their drawn art, so a stray XP in a later container cannot take them.
The unpainted rectangle that carries the text wrap options of a symbol
instance, blend, mesh, repeat, placed document, intertwine or envelope
written as a group of its art is now the group's first member. Area type
below the object still wraps by its bounds after reopening, and area type
in the art itself is not wrapped by the rectangle, so art that holds area
type no longer keeps the options on its group and wraps by its members.
A symbol instance written as its art, and a blend, mesh, repeat, placed
document, intertwine or envelope written as a group of its art, wrapped
area type below it by its bounds before saving but by the members of
that art after reopening, because the group carried the text wrap
options. The group now ends with an unpainted rectangle at the object's
bounds that carries the options, as type written as outlines does, and
the group keeps the object's name, transparency, lock and visibility
without options of its own. Art holding shown area type written as
type keeps the options on its group; area type in an envelope does not
count. An object without finite bounds keeps the options on its group.
Without room for the rectangle within the object limit, the options are
left out with the limit's warning.
Each later placement of an image or a colorized image that was turned away at the page limit
was decoding and compressing it again. The scene now remembers what the first placement of a
turned-away encoding adds to the page and leaves later placements out with the same warning
while that still doesn't fit. Once the page has room again, after art is taken back, the image
is encoded and placed as usual.
A subpath's anchors are now an `Anchors` list held in chunks of up to
256 anchors behind `Arc`s. Copying a path copies the chunk table and
shares the chunks, and editing one anchor copies only the chunk that
holds it, so the undo step of a one-anchor edit no longer keeps a copy
of every anchor of the path. Inserting or removing an anchor copies the
chunk it is in and rebuilds the table. Reads and edits follow the Vec
and slice methods the code used; files write and read each subpath's
anchors as one list, as before, within the same anchor read budget.
The undo memory estimate counts only the chunks the other version of
the path does not hold, and the renderer's kept paths compare only the
chunks an edit copied when they look for moved anchors.
Moving one anchor of an open path of 10,000 or 200,000 anchors
(path.moveAnchor, path.setHandle, path.moveAnchors, a nudge) keeps at
most 48 KiB in its undo and redo steps, where it kept 56 bytes per
anchor.
The writer compared the top object's patch with the one the reader makes
of the written grid on an even 9 x 9 grid of places. A split side can
change how the reader samples a short curve that falls between those
places, so a top object could be written live although the reader would
map the contents differently there.
Coons::places gives the places in u and v where the patch's sides have
points. Each side runs straight between them, so the writer now compares
the four sides of both patches at every one of those places, within a
third of the tolerance; a point inside a patch blends its sides and
corners, so the patches then lie within the tolerance everywhere.
A .ai in the legacy PostScript format opened with the box around all of
its art as the artboard, so art placed off the artboard came in on it.
Files opened as .eps keep their page.
- A .ai file read through its layers used the EPS rule from #1102, which
makes the art's bounding box the artboard. It now keeps the artboard
its header gives (%AI5_ArtSize around the center of %AI3_TemplateBox),
with its art outside it. The engine opens a PostScript .ai or .ait
through the new vectorcraft_eps::import_ai; an EPS's private data is
still read as an EPS.
- A .ai of versions 3 and 4 (no %AI5_FileFormat) does not record its
artboard's size. When it has a template box, its artboard is now
VectorCraft's own default, a US Letter page, centered on the template
box's center, which the version 7 specification (section 2.2) places
at the artboard's center. Before, it was the art's box. This also
applies to .ai files other apps write with a template box and no art
size (#1027).
- The center of a template box with a size (a file with a template
image) is now the middle of the box, not its lower-left corner.
A .ai with neither an art size nor a template box keeps its art's box
as the artboard.
When art passes the page limit and is taken back, the writer now drops
every image encoding made while writing it (placed images, colorized
images and freeform fields) along with the cache entries that name
them. Before, only trailing field encodings were dropped, so a placed or
colorized image, and any field encoded before it, stayed in memory for
the rest of the export.
A placed or colorized image whose first placement does not fit under
the limit is no longer encoded into the cache; it is left out with the
existing warning.
The written EPS is unchanged.