Type on a path sits at fractions of its path's length. Scaling the path
non-uniformly changes where a fraction lands (CodeRabbit's case: M0 0 L100 0
L100 100 under diag(2, 1) moves the start bracket from (200, 0) to (150, 0)).
Path type now bakes the vertical scale into the character sizes and scales
its path uniformly by it, which keeps every fraction where it was; the
horizontal stretch stays in the transform.
Baking an object's scale into the character attributes removed that scale
from the type's transform, but the area frame (and a path type's path), which
is drawn through that transform too, kept its unscaled size. A 120 x 80 frame
scaled 200% shrank back to 120 x 80 on the page, so the 24 pt type broke into
two lines and the rest became overset.
The frame and the path now take the scale the transform loses, so they, the
line breaks and every glyph stay where they were.
Fixes#8297
- The steps of a live blend are written as drawn art: copies of key
objects with text wrap options no longer write those options again.
The keys keep theirs on the hidden lines and the blend keeps its own.
- The record holds Specified Distance as a 32-bit float, which the
reader reads back as its shortest decimal. The writer now compares the
blend with that distance, so a distance typed in another unit (10 mm
is 28.346456... pt) is written live when it lays out as many steps.
- blend_steps_settled has unit tests for each of its cases.
- blends_write_the_same_bytes_again checks that every blend is written
live both times.
- Comments name the blend plugin's XP line by its constant.
- docs/target-app-parity.md lists live blends in the .ai editing copy;
a line in docs/file-format-parity.md is wrapped like the rest.
Tests: a_live_blends_steps_carry_no_text_wrap_options,
a_blend_spaced_in_millimeters_is_written_live,
steps_settle_unless_rounding_can_change_their_count.
The editing copy of a PDF-compatible .ai wrote every blend as its steps.
Blends the .ai reader opens live are now written live:
- The blend's key objects and, when it has a spine of its own, its
spine are written as a group on hidden lines, each key's dictionary
naming it a key and its id and the spine's naming it the spine. Its
steps follow as a group, then the Path Blends record of its spacing
(Smooth Color, Specified Steps, Specified Distance with its distance),
orientation (Align to Page, Align to Path) and keys, then its
dictionary (name, text wrap options, variables) and its opacity and
blending mode as a group's after its end. A spine edited on the canvas
is written with each key's anchor on the key. A replaced spine is
written with an anchor where each key sits, so it opens with those
anchors and lays out the same steps.
- Each blend is checked with the reader's own reading before it is
written, and the blends together against the objects the reader lays
out in one file. Written as their steps with a warning: blends with
easing, a color shift or start points; with effects, an appearance or
an opacity mask of their own; of objects other than paths, compound
paths and groups, of clipping groups, of more than 62 key objects, of
hidden keys or keys holding a blend; of keys with geometry or
Pathfinder effects or a group's own fills and strokes, which the
editing copy writes as their result; of keys the editing copy would
change otherwise (empty paths or subpaths, paths and compound path
members of several subpaths, several fills or strokes, strokes a plain
line can't draw, dashes of more than 64 lengths, hidden fills or strokes, fills or strokes other than
a color, in a Lab color or with transparency or effects of their own,
effects, opacity masks); blends where one key has a fill or stroke of
no paint or a stroke of no width and another has one that draws;
blends whose spine has more than one part;
blends whose step count is close to where rounding the written
coordinates and colors changes it; blends the reader would open with
other settings or not as drawn; blends inside objects with geometry or
Pathfinder effects or a group's own fills and strokes; blends in
opacity masks, pattern tiles, symbols and art cut to a clipping object
or nested eight levels deep in art written in place of other objects;
blends whose art would pass the most objects the reader reads; and
every blend on a large canvas.
- The steps set their own transparency and lock and hidden state after
the hidden lines, for readers of the printed form.
Each construct is written in the form the .ai reader reads (blend.rs,
read/document.rs blend roles, read/containers.rs end_blend, read/ops.rs
XP and transparency), and every object written counts toward the
reader's object limit as the reader counts it. The record's orientation
word and a blend with no spine part are read as #8243 reads them.
Blend Options, key objects and spines:
https://helpx.adobe.com/illustrator/desktop/manage-colors/apply-transparency-and-blending/blend-options-overview.htmlhttps://help.adobe.com/archive/en_US/illustrator/cs5/illustrator_cs5_help.pdf#page=260
Tests: the round trip of blends of each spacing and orientation, with
no spine of their own, an edited spine and replaced curved spines,
named, at half opacity, hidden and locked, with text wrap options, of
compound paths, of groups and of 62 keys, each laying out the same steps
as the document's blend; the record's words (Align to Path's angle
included) and the dictionaries; the steps' own state after the hidden
lines; the same bytes on a second write; each case written as its
steps, with as many steps as are drawn, where they are drawn (among
them Specified Distance 0.03 pt from where its count changes, on a
spine of 200 segments, which comes back live on a spine of two); blends in
pattern tiles, opacity masks, symbols, art cut to a clipping object and
eight levels down; the object limit; the reader's blend limit; a large
canvas; fuzz cases for damaged written blends.
Docs: docs/file-format-parity.md.
EPS export writes a gradient whose stop links to a spot swatch named
Cyan, Magenta, Yellow or Black and carries process plates in process
colors, with a warning. The stop_inks doc comment and the progress-doc
line now say so.
A fill, stroke or gradient stop links to a swatch by name, and the first
swatch of that name is the one it prints from. The plate list added a spot
plate for every spot swatch, so a spot swatch after a process swatch of the
same name got a plate that printed nothing, while art linked by that name
separated as process. The plate list now takes only the first swatch of
each name.
A spot swatch named Cyan, Magenta, Yellow or Black had no plate of its own
and printed nothing on the process plate of its name. Art linked to it now
prints its tint on that process plate, as PDF and EPS export write it, and
a gradient stop's own process plates print beside it.
- A gradient's freeform points count only when its kind is Freeform, in
the Overprint Black check and in the plate separator. A gradient of
another kind is checked by its stops.
- Characters inside opacity mask art no longer draw with Darken on
separations, as the mask art's fills and strokes already do not.
- With Overprint Black on, a symbol instance whose own fill or stroke
changes or fill stain repaint its art, or whose symbol holds such an
instance, prints as its placed art and is checked with the paints it
prints with. Placement stays within the symbol object limit and the
drawn depth limit, and skips hidden objects and template layers.
The Contextual Task Bar and the Control bar check, each time they are
drawn, whether the selection holds a color that Recolor Artwork can
change. The check walked the whole subtree of each selected object even
after the first color, so with one large group selected, the check read
every paint in the group.
- Node::try_walk visits in walk's order and ends at a ControlFlow::Break.
- swatches::node_has_colors stops at the first color node_colors would
visit; node_colors now runs the same visitor without stopping, so the
two read the same nodes and paints in the same order.
- has_colors in the task bar uses node_has_colors.
The result is the same for every selection. On one group of 100,000
paths, the check takes 16 ns instead of 14.5 ms when the first path is
filled; when only the last path is filled, or none is, it costs about
what the full walk costs.
Every click, hover, Select Behind list and marquee made new symbol boxes
and measured the art of each symbol its instances show again, and so did
the locked-artboard check each of them made. With 20,000 instances of
8,000 different symbols a click took 27 to 33 ms.
Hit tests now start from the art boxes, nesting depths and name index
that earlier hit tests measured on the same thread, for the last two
sets of symbols. The locked-artboard check of a hit test starts from the
same art boxes, and what it measures is kept with the rest. The boxes
are measured again when a symbol's name or art, the 9-slice guides or
the inputs of clipping-path effects change. The kept list holds a weak
pointer to each symbol's art, so it does not keep a closed document's
art alive, and art changed in place no longer matches. Art boxes of
symbols whose art holds 9-slice instances are measured on each call, as
before.
The Print dialog's Output section has an Overprint Black checkbox under
Convert All Spot Colors to Process, off by default and available with
Separations (print.setup output.overprintBlack, kept with the document
and in print presets). With it on, solid 100% process K or 100% gray
fills, strokes and characters, and gradients whose every stop (or every
freeform point) is, overprint in the printed copy, so the inks under them
stay on the other plates. Rich, RGB, Lab, spot-linked and lighter blacks
knock out. The document and its own overprint settings do not change, and
composite output ignores the option.
Plates draw an overprinting paint that puts no ink on them as nothing, so
PostScript separations keep the inks below it too. Overprinting character
fills and strokes now darken on PDF plates like fills and strokes, a type
object's own fill in a PDF is drawn with its blending mode, and Edit >
Edit Colors > Overprint Black counts a gradient with a spot-linked stop as
a spot black and a freeform gradient by its color points.
Clear with `ids`, which Cut uses for the objects it copied, removed each
id from the selection with its own scan of the selected objects. It now
calls Selection::remove_all once, which gives the same selection.
With 50,000 objects selected and all of them cut, the selection step
takes 5.5 ms instead of 572 ms (release build, median of 7 wall-clock
runs, measured while other builds were running). The new tests compare
the result with removing each id in turn, including Undo and Redo, and
an ignored benchmark times both.
File > Place with Link (the default) now places an EPS file, a PostScript file or a PostScript .ai from a path as one locked placed document instead of an embedded group. It shows the art that placing without Link gives (clipped to the bounding box, or the art's bounds with crop: "bounding"). Links check, update and relink it, Break Link and Object > Expand give the Link-false group, a save keeps its preview, every output draws its vectors, and Package copies the file, also from the bytes the document holds when the file is gone. Links lists it as EPS or PostScript, also after a save that kept only its preview. A DCS file stays a linked image; Link off and dataBase64 still embed.
A line graph whose style record draws its lines as shapes now opens as a
live graph with Draw Filled Lines on, and its lineShapeWidth becomes the
Line Width (3 pt reads as the default). The flag is ignored when the
points are not connected, as the published file format specification
says (printed pp. 147-148). Saving writes both values in the Gy record.
- Widths from 0.01 to 100 pt are kept. A wider Line Width, a width under
0.01 pt with filled lines, and filled lines without connected points
are saved as the graph's art with the existing warning.
- In a filled-line series, a filled path with the thin black band
outline is read as a band and does not set the series stroke. A
filled path with another outline must be a square marker or legend
swatch; otherwise the graph keeps its art as plain objects.
- The reader in crates/eps/src/import/ai/read/graph.rs reads each value
the writer in crates/eps/src/ai_graph.rs writes; the save-then-open
tests cover the default, 8 pt and 150 pt widths in both .ai forms.
header_size now reads a BMP BITMAPINFOHEADER when the probes refuse the file,
so Paste of a 30,000² poked header reports "too large to draw" instead of
that the size can't be read. through_jpeg encodes with the image crate again
so the block-artifact trace test stays calibrated; the JPEG writer is still
on main's code. Also use a no-break space before ":" in three French typography
rows (unchanged from main) so the catalog check is green.
decode_within mapped every LimitExceeded to Ok(None) ("oversized, accept
unread"). craft-image-codecs raises that for its decompression-bomb guard
when a tiny file declares a large image, so Place accepted a header-only
23,170² gray PNG instead of reporting that its pixels can't be read.
Ok(None) now only when the header says the image would take more than the
allowance as samples or as RGBA. A decode that hits a limit stays an error.
Embedded and linked images read their pixels with decode_within: the
size from the header against the allowance first (as samples and as
RGBA, #1717), then the pixels as stored. map_rgb, sampling, coverage,
link previews and checked_with_pixels all go through it.
decoded_pixels_are_those_the_image_crate_read compares PNG, GIF, WebP,
TIFF and BMP at each depth the image crate writes with its pixels, and
JPEG within two steps, including the pixels checked_with_pixels hands
on. The 11,586² allowance test is a compact PNG; craft-image-codecs
refuses a GIF whose unbacked logical screen is past 256 MiB.
The decoding File › Open, Place and the renderer share moves to
vectorcraft-doc (decode.rs: decode_image, decoded_layout), and SVG
import's images read through it: the size from the header against the
allowance first, then the pixels as stored with the profile the file
embeds (a TIFF's still read by the TIFF reader).
decoded_pixels_are_those_the_image_crate_read compares PNG, GIF, WebP,
TIFF and BMP at each depth the image crate writes with its pixels, and
JPEG within two steps.
group3_tiff_rgba decodes each strip or tile with
craft_stream_codecs::decode_ccitt_raw instead of hayro-ccitt; the error
messages stay as they were. vectorcraft-engine's group3_reference test
keeps the hayro-ccitt reader as the reference: over 190 Group 3 TIFFs and
5,500 cut or edited copies the pixels and refusals match, except that a
strip or tile wider than MAX_CCITT_COLUMNS (2^20) is refused as an
overflow where hayro-ccitt ran out of data. Needs craft-libs#1772.
The CMYK reader's JPEG side (inks, component count, size, ICC profile)
uses craft_image_codecs::jpeg_inks instead of zune-jpeg, which stays only
as the dev-dependency the comparison test reads with: inks, sizes,
component counts and profiles match it over CMYK, YCCK, RGB and gray
JPEGs, whole and cut off. Frames zune-jpeg panicked on read as no inks.
Needs craft-libs#1779.
A click or a marquee with the selection tools now finds a path or compound
path where its live geometry effects draw it, the copies a Transform effect
makes included, and not where its own geometry no longer paints.
- The engine registers its Use Preview Bounds evaluator with
`vectorcraft_doc::hit::set_drawn_art`. Hit testing keeps the evaluated art
per object, evaluates it again when the object, the document's symbols,
patterns, swatches or live inputs change, and widens each object's cull box
by the art its effects draw.
- Groups and layers with geometry effects or fills and strokes of their own
are hit through their evaluated art. Clicks, Select Behind, the locked
objects under the pointer and marquees map the art back to the members it
is drawn from, at the depth each tool selects, and Direct Selection takes a
group whose own paint the art draws.
- Clipping paths keep their own geometry, except that a clip group's own
effect moves where its mask outline is taken. An isolated clip group's
members are marqueed by their own geometry, as clicks take them. A clip
group whose evaluated art holds only its clipping path is tested member by
member.
- Outline view uses the plain paths, and a layer with Preview off is clicked
in outline. Intertwine groups keep their woven hit order.
Docs: docs/target-app-parity.md.
header_size reads every format's header through craft-image-codecs
(probe_allocation_size: stored size with no limit; a GIF's logical
screen through probe_size), no longer through the image crate's
readers. Metafile DIBs are written as PNG by craft-image-codecs.