Commit Graph
537 Commits
Author SHA1 Message Date
BFlat 6a2fa16cd1 Merge pull request #8289 from dotCooCoo/feat/ai-blends-in-editing-copy
.ai save: the editing copy keeps live blends
2026-11-17 14:32:25 +07:00
dotCooCoo 3829880993 .ai save: a live blend's steps carry no text wrap; metric distances stay live
- 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.
2026-11-16 21:19:00 -08:00
dotCooCoo 6dae0b77e5 Merge main into feat/webp-lossy-quality 2026-11-16 17:39:20 -08:00
dotCooCoo 4b2868bd07 .ai save: the editing copy keeps live blends
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.html
https://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.
2026-11-16 17:31:04 -08:00
dotCooCoo 2f7e60dd54 WebP: Lossy with a Quality setting writes a lossy WebP file
WebP Options has a Compression menu (Lossless, Lossy) and a Quality
slider from 0 to 100 that is enabled for Lossy. document.export,
document.serialize and Export for Screens take lossless: false with
quality (default 90) and write a VP8 file, with an ALPH chunk that keeps
the alpha exactly when some pixels are not opaque. Lossless stays the
default. A WebP quality above 100, or one that is not a whole number,
is refused with an error.

The encoder is the one craft-image-codecs already provides; no
dependency changes. The note that lossy WebP isn't available, its
catalog rows and the format text that described it are removed.
2026-11-16 12:30:56 -08:00
dotCooCoo 4e5a6953ba AI editing data: write Perceptual gradients with the stops on their curve
A gradient definition in the .ai editing data holds each stop's color, opacity, midpoint and ramp point, and VectorCraft's reader opens it as a Classic gradient. A Perceptual gradient was written with its own stops, so the file opened with different colors between them.

The writer now treats a Perceptual gradient as it treats a gradient mixed around the hue wheel, in the art and in the Swatches panel: the colors on its curve become stops of their own in process colors, at most 256, with a warning that names Perceptual gradients. A stop linked to a global process color reports its lost link for both methods. Dither is reported as its own loss. A freeform gradient, or one with more than 256 stops, is still written as its average color whatever its method.
2026-11-15 23:59:10 -08:00
BFlat 51ad60c5c7 Merge pull request #7985 from dotCooCoo/feat/psd-preserve-text-editability
PSD: Preserve Text Editability writes point type as editable type layers
2026-11-16 09:31:22 +07:00
BFlat 1ac6d68a7e Merge pull request #7968 from dotCooCoo/fix/graph-stacked-column-legend-stroke
Graphs: legend swatches have their series' stroke, so stacked column and area graphs save to .ai as graphs
2026-11-16 08:11:37 +07:00
dotCooCoo ec9c558456 .ai save: area type wrapped by plain paths, compound paths or groups stays type
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.
2026-11-15 12:56:22 -08:00
dotCooCoo 92b3b10e7b Graphs: legend swatches have the stroke of their series' marks
A default legend swatch of a stacked column, stacked bar, area or pie
series now has the thin white stroke the series' marks have, beside the
plot or across the top. Before, the swatch had no stroke, so the series
group painted with two strokes and a drawn stacked column or area graph
was saved to .ai as plain art with a warning. Both now open again as live
graphs. Stacked bar graphs are still written as art: the .ai reader has
no type for them.
2026-11-15 12:27:19 -08:00
dotCooCoo 4327c51f57 PSD: Preserve Text Editability writes point type as editable type layers
The PSD Options dialog gets Preserve Text Editability, and document.export
takes preserveText (with layers). Horizontal and vertical point type is
written as a type layer (a TySh block with its EngineData) that a reader
can edit, and keeps its pixels. The layer holds the text, its fonts by
PostScript name, size, leading, tracking, scaling, baseline shift, caps,
underline, strikethrough, fill color, Fractional Widths, paragraph
alignment and orientation.

Type that a type layer would draw differently stays pixels: area type,
type on a path, strokes, non-solid fills, fractional tracking, character
attributes the layer does not carry, paragraphs that set more than their
alignment or run right to left, System Layout, Optical Margin Alignment,
ruby, effects, an appearance of its own and opacity masks. A layer that
holds type becomes a group of its type layers and pixel layers of the art
between them, unless other art in it blends in a mode other than Normal.
2026-11-15 12:07:06 -08:00
BFlat 3239725c40 Merge pull request #7817 from dotCooCoo/feat/psd-import-options-import-slices-after-7649
PSD: Import Slices brings a file's slices in as user slices on Open and Place
2026-11-15 20:45:50 +07:00
BFlat 6ec6114d24 Merge pull request #7751 from Hassan1305/fix-7741-pdf-text-stroke-cap
PDF import: stroked type keeps its cap, join and miter limit (#7741)
2026-11-15 16:39:02 +07:00
dotCooCoo d842aa816c Merge main into feat/psd-import-options-import-slices-after-7649 2026-11-15 00:50:14 -08:00
HassanKhan 75c884e333 Merge remote-tracking branch 'upstream/main' into fix-7741-pdf-text-stroke-cap
# Conflicts:
#	docs/roadmap.md
#	docs/target-app-parity.md
2026-11-15 12:33:21 +05:00
dotCooCoo b64ee486f9 Merge main into fix/opacity-mask-art-inside-symbols-pattern-tiles 2026-11-14 22:26:08 -08:00
dotCooCoo d0b69af348 Merge main into feat/psd-import-options-import-slices-after-7649 2026-11-14 22:06:58 -08:00
HassanKhan 9dafc08f8f PDF import: a glyph stroked otherwise gets a run of its own (#7741)
A filled glyph joins a run of the same fill whatever its stroke, so with
fill and stroke rendering shown a glyph at a time, the stroke replayed
over the last glyph restyled the whole run: glyphs before it took its
cap, join and miter limit. When that stroke differs from the run's, the
glyph's text now splits off into a run of its own; the line's text is
unchanged, so slots, gaps and authored flags still line up.

Also record the change in the parity and roadmap docs.
2026-11-15 11:05:54 +05:00
HassanKhan 1301192aeb PDF import: stroked type keeps its cap, join and miter limit (#7741)
Glyph strokes reached the type's character style as paint and width only,
so stroked PDF text (rendering modes 1, 2, 5, 6, and under ActualText)
came in with butt caps, miter joins and a miter limit of 10. The text
path now carries the graphics state's line cap, line join and miter
limit, taken as paths take them, and glyphs stroked with other ones start
a run of their own.
2026-11-15 10:10:41 +05:00
dotCooCoo 599e1705ce PSD: Import Slices brings a file's slices in as user slices on Open and Place
Read image resource 1050 (version 6 records and the version 7 and 8
descriptor) and turn each slice the file did not generate automatically
into a user slice with its name, type, link, target, message, alternative
text, cell text and background color.

- document.open takes importSlices (default true) with either layer
  choice; file.place takes it (default true embedded, false linked; true
  with link is an error) and moves and scales the slices with the placed
  art in the same undo step. file.place.info, file.place.queue and
  document.psdInfo report or pass it.
- PSD Import Options gains Import Slices, enabled for a file with slices,
  independent of the conversion choice, and remembered with the other
  choices; a file with slices asks even with fewer than two layers.
- Slices outside the canvas, and slice data that can't be read, are left
  out with a warning while the art comes in. Counts, nesting and text
  lengths read from the file are capped.
2026-11-14 20:36:31 -08:00
dotCooCoo fb616f2c76 Merge main into feat/psd-import-options-import-slices-after-7649 2026-11-14 19:42:05 -08:00
dotCooCoo 85acda4523 Merge main into fix/opacity-mask-art-inside-symbols-pattern-tiles 2026-11-14 19:17:05 -08:00
dotCooCoo 6efa53f562 Merge main into fix/ai-off-artboard-art 2026-11-14 18:55:35 -08:00
BFlat 7c12d660af Merge pull request #7627 from dotCooCoo/feat/ai-save-graph-records
.ai save: live graphs are written as graph records
2026-11-15 09:47:28 +07:00
BFlat 237fe27e50 Merge pull request #7713 from dotCooCoo/feat/psd-clipping-path
PSD: a file's clipping path clips its merged image on Open and Place
2026-11-15 09:46:45 +07:00
dotCooCoo ba56730123 .ai editing data: opacity mask art in symbols and pattern tiles keeps live effects
Objects in an opacity mask's art inside a symbol definition or a pattern
tile are now written with their art styles, as mask art on the layers
already is. A symbol or pattern whose mask art has Offset Path opens with
the effect live in its definition, and its instances and pattern fills
draw as before. Each definition is written with the styled objects of its
own masks only, so art placed as copies inside it is not matched to
another definition's original.

- Mask art linked to a graphic style opens linked to it: the reader's
  style linking now goes into opacity masks' art.
- Links in pattern tiles count toward the lost-link warning, the warning
  is checked after unused symbols and swatch-only patterns are written,
  and links in art left out at the object limit are no longer counted as
  kept.
2026-11-14 17:34:29 -08:00
dotCooCoo a3ac628576 .ai import: symbol instances in older files are read, so art outside the artboard opens
Files saved for versions 10 to 13 place each symbol instance with a
TransformMatrix. On the page it takes the symbol's art to the canvas
(y down); in a symbol's art, it takes the art to that symbol's space. The
reader only knew the RTransformMatrix of newer files, so any such
instance made the editing data unreadable, and the file opened from its
PDF part alone, which holds only the art on the artboards.

The reader now converts a TransformMatrix with the canvas point of art
space's origin that the template box gives. A file whose symbol
instances were the only part it could not read now opens from its
layers, with the art outside its artboards.

The symbols fuzz test also damages the same data in the older form.

Docs: docs/target-app-parity.md, docs/file-format-parity.md.
2026-11-14 17:03:22 -08:00
dotCooCoo 06fbf967a9 Merge feat/psd-import-options into feat/psd-import-options-import-slices-after-7649 2026-11-14 16:23:42 -08:00
dotCooCoo d0f1346f87 Docs: record the PSD clipping path in the PSB row and the evidence list
The PSB row of docs/file-format-parity.md says the merged image comes in
clipped by the file's clipping path, as the PSD row does, and
docs/target-app-parity.md's evidence list gets a line for it.
2026-11-14 16:20:16 -08:00
dotCooCoo af010b6dec PSD: a file's clipping path clips its merged image on Open and Place
A PSD or PSB file can name one of its saved paths (image resources 2000
to 2997) as its clipping path in resource 2999. psdread::clipping_path
reads that path in the image's pixel space, under the even-odd rule the
file format specification gives, with a subpath around the whole image
first when the initial fill record says the fill starts with all
pixels.

File > Place of such a file, and File > Open of its merged image, put
the image in a clip group of that path with no paint. file.place answers
the image's id as `image`, as for a DCS file. Replacing an image alone
in a clip group with such a file keeps the image's scale and rotation.
links.update and links.relink leave the clip group as it is. Files that
name no clipping path come in as before.
2026-11-14 15:55:34 -08:00
dotCooCoo dba42af495 Merge main into feat/ai-save-graph-records 2026-11-14 15:21:09 -08:00
dotCooCoo b10ace75b6 Merge main into feat/psd-import-options 2026-11-14 13:45:30 -08:00
dotCooCoo 6a5110a40c Merge main into feat/ai-save-graph-records 2026-11-14 13:27:39 -08:00
dotCooCoo 6068c42ce6 Merge main into feat/open-pdf-pages-as-links 2026-11-14 12:23:47 -08:00
BFlat c6c06b2c68 Merge pull request #7442 from dotCooCoo/fix/eps-ryumin-light-h
EPS import: Ryumin-Light-H and GothicBBB-Medium-V read as Japanese type without their CIDFont
2026-11-15 03:19:37 +07:00
dotCooCoo dab13fbf14 Import PDF: Import PDF pages as links opens each page linked to its file
File › Open's Import PDF dialog gets Import PDF pages as links. With it on,
each page picked opens as a placed document linked to that page of the
file, on an artboard of its Crop To box and a layer named after the page,
in place of editable art. The Links panel lists each page, and Embed makes
a page editable.

document.open takes the matching linkPages param. It is refused for a
file that is not a PDF or a PDF-compatible .ai, for bytes without a path,
with a password and with textAs: outlines. The pages share one copy of
the file, and the document opens in CMYK when most of its pages do.
Save asks for a name, as for other partly read PDFs.
2026-11-14 12:13:59 -08:00
dotCooCoo 4d3a21eca7 PSD: Open and Place without Link ask how a layered file's layers come in
File > Open of a PSD or PSB file with two or more layers now shows PSD
Import Options: Convert Layers to Objects (with Import Hidden Layers) or
Flatten Layers to a Single Image. File > Place shows the same dialog for
such a file placed without Link, and so does a file dropped on the canvas
with Shift held. Several files placed together without Link take the
choices made last. A file placed with Link keeps its flat image.

file.place takes layers and hiddenLayers: with layers: true the layers
come in as one group named after the file, a layer as an image and a
layer group as a group, at the place the merged image would take and
clipped to the canvas when layers reach past it. link: true with layers
is an error, and so is hiddenLayers without layers. file.place.queue and
file.place.info pass both on. document.psdInfo counts a file's layers
from its layer records without decoding pixels.

Docs: the params text, docs/mcp.md, docs/file-format-parity.md and
docs/target-app-parity.md.
2026-11-14 10:45:30 -08:00
dotCooCoo 506f48daea .ai save: live graphs are written as graph records
Both .ai writers now write a graph that the .ai reader reads back as the
same graph with its records, so a saved graph opens again live, with its
table, type, axes and settings: %_Gs, the Gb, Gy, Gd, Ga/GA, Gz, Gc and
GC records, the graph's group with each series' group followed by a Go
tag, and %_GS (the published .ai file format specification, section 17
and appendix A). The records are the ones the reader in
crates/eps/src/import/ai/read/graph.rs (#7311) reads, in the form it
reads them.

The shared encoder in crates/eps/src/ai_graph.rs decides first whether
the reader keeps the graph whole: a column, stacked column, line or area
graph with a legend, settings the records carry, a table of 1 to 10,000
categories and 1 to 256 series with finite values, labels of at most 255
bytes without control characters, and art the reader attaches the graph
to. Any other graph is written as its art, with the existing warning, as
is a graph whose art the editing writer's object limit cuts short.
Tick-mark counts of 0 are written as 1, the count the reader keeps for
both.

Bar, stacked bar, scatter, pie and radar graphs, stacked column and area
graphs whose series marks carry a stroke their legend swatch lacks, and
line graphs with markers are still written as their art, with the
warning.
2026-11-14 08:20:05 -08:00
BFlat d31457281a Merge pull request #7436 from dotCooCoo/fix/svg-masked-shadow
SVG export: shadows in a masked group show in readers that bound it by its shapes
2026-11-14 21:48:10 +07:00
dotCooCoo 14076169fc Merge main into fix/svg-masked-shadow 2026-11-14 03:21:12 -08:00
dotCooCoo 0397bfa47f Merge main into fix/ai-calligraphic-samples 2026-11-14 02:53:05 -08:00
dotCooCoo 4678bda849 Merge main into fix/eps-ryumin-light-h 2026-11-14 02:18:10 -08:00
BFlat 111ceddb9b Merge pull request #7383 from dotCooCoo/feat/ai-art-brush-options
.ai import and save: Art brushes keep None, their width, scale and flips
2026-11-14 16:54:16 +07:00
dotCooCoo 3c4170fa25 Merge main into fix/svg-masked-shadow 2026-11-13 23:05:34 -08:00
dotCooCoo 66535b725b Merge main into fix/eps-ryumin-light-h 2026-11-13 23:05:31 -08:00
BFlat ab959b95a8 Merge pull request #7369 from dotCooCoo/fix/ai-hidden-ruler-guide
.ai import: hidden ruler guides open as ruler guides with their own state
2026-11-14 13:43:11 +07:00
dotCooCoo edee68e3d1 EPS import: Ryumin-Light-H and GothicBBB-Medium-V read as Japanese type without their CIDFont
A name ending in the row-and-cell CMap H or V split only when the file
defined the CIDFont or a face of that name was installed, so
/Ryumin-Light-H findfont in a file that only names it read its strings
byte by byte as a plain font: <467c> came in as "F|" instead of 日.
Ryumin-Light and GothicBBB-Medium, the Japanese CIDFonts a printer
carries (Adobe Technical Note #5014, appendix A.2), now split at H or V
as well. Latin names such as Foo-Bold-H still stay whole.
2026-11-13 20:48:18 -08:00
dotCooCoo 1fbbb0a4e7 SVG export: shadows in a masked group show in readers that bound it by its shapes
Some SVG readers draw a masked group only inside the bounding box of its
shapes. A drop shadow, glow, blur or feather inside the group paints past
those shapes, so these readers left it out, while others drew it.

A masked group now starts with a rectangle over the mask's region,
unpainted (fill="none") and hidden (visibility="hidden"), when what it
holds has a visible raster effect: on a member at any depth, on a fill or
stroke, in a symbol's art, or in the art a blend or other live object is
written as. The rectangle widens the group's bounding box without drawing
anything, and import leaves it out. The masked groups of a knockout group
get the same rectangle when an element inside them has such an effect.
Other masked art, brushed strokes included, is written as before, and so
is an object whose own effects are written outside its mask.

Tests: a_masked_group_spans_its_region_when_its_art_paints_past_its_shapes
and a_knockout_group_spans_its_masks_when_an_element_paints_past_its_shapes
in crates/svg/tests/it/blend_export.rs.
2026-11-13 20:23:15 -08:00
dotCooCoo e9ae8b9661 Merge main into fix/ai-calligraphic-samples 2026-11-13 19:50:31 -08:00
dotCooCoo 49a3c3d718 Merge main into feat/ai-art-brush-options 2026-11-13 19:09:26 -08:00