Commit Graph
664 Commits
Author SHA1 Message Date
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 f62932eb93 Merge pull request #7776 from dotCooCoo/feat/aia-files-carry-select-object-steps
Actions: Load Actions… reads .aia Set Selection steps as Select Object
2026-11-15 17:31:10 +07:00
dotCooCoo d842aa816c Merge main into feat/psd-import-options-import-slices-after-7649 2026-11-15 00:50:14 -08:00
dotCooCoo c0b1c2e144 Merge main into feat/color-management-policies 2026-11-14 22:51:34 -08:00
dotCooCoo d999d861de Color Settings: Convert to Working Space compensates CMYK black points
- CMYK colors converted between two loaded CMYK profiles now use the
  Color Settings black point compensation, as RGB colors already did:
  the conversion goes through linear ProPhoto RGB and maps the source
  profile's black onto the destination's.
- The edit.colorSettings, document.open and file.newFromTemplate params
  text and docs/mcp.md name file.newFromTemplate with the commands that
  apply the policies, and say that colorMode on open converts after the
  policies, through the profiles the document keeps.
- A test covers New from Template under the policies, and another the
  CMYK black point compensation.
2026-11-14 22:43:08 -08:00
dotCooCoo b7ff4b167a Merge main into feat/aia-files-carry-select-object-steps 2026-11-14 22:12:23 -08:00
dotCooCoo d0b69af348 Merge main into feat/psd-import-options-import-slices-after-7649 2026-11-14 22:06:58 -08:00
dotCooCoo fb616f2c76 Merge main into feat/psd-import-options-import-slices-after-7649 2026-11-14 19:42:05 -08:00
dotCooCoo c2a6655ae1 Merge main into feat/aia-files-carry-select-object-steps 2026-11-14 19:08:37 -08:00
dotCooCoo 6efa53f562 Merge main into fix/ai-off-artboard-art 2026-11-14 18:55:35 -08: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 621a793abe Actions: Load Actions… reads .aia Set Selection steps as Select Object
actionSet.read now lists each step's recorded values with their key, type
and value (a whole number, or UTF-8 text with its length in bytes), at
most 100,000 per set; a hexadecimal value with the wrong byte count still
marks the set truncated.

Load Actions… finds a Set Selection step by its internal name, whatever
its label, and adds it as a Select Object step (select.byNote) with its
note, Case Sensitive and Whole Word. The step comes in only with exactly
three recorded values: the note (key text, ustring, UTF-8, 1 to 1,024
bytes once trimmed) and the two options (keys word and case, boolean,
0 or 1). Any other Set Selection step is left out and counted, with no
option filled in. A step that is off in the file stays excluded, and the
set saves to and reloads from a .vcactions file unchanged.

Docs: docs/mcp.md, docs/target-app-parity.md, docs/ui-parity.md.
2026-11-14 18:21:40 -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 89f20c45c4 SVG import: bound selector matching and share the limits with linked and embedded SVGs
The measurement that runs before the style cascade and usvg now covers
the inputs that still got past it:

- usvg matches a selector without keeping what it found, so one whose
  leftmost part matches nothing tests every set of ancestors in turn.
  The measurement counts those tests for each copy and stops at
  50,000,000; past that the SVG is refused with "the SVG's style sheets
  take too long to match". An SVG image's matching stops at what the
  SVG showing it left.
- A test counts one more for every 16 attributes a lookup scans and
  every 16 bytes of the value it compares, so many classes against a
  long class list count the work they do, in usvg's matching and in
  the import's own cascade.
- The declarations the import's own cascade keeps, once per element,
  count toward the 64 MB, including those of `:not()` rules, which usvg
  drops. Each `:not()` alternative counts as a test.
- A linked SVG file is measured before its cascade runs. The linked SVG
  files share one measurement: once they pass the limits together, the
  files after that are shown without their links. The tests a file past
  the limits made still count.
- SVG images share the element limit and the selector tests with the
  SVG showing them, as they already shared the 64 MB.

The svg_filters reader measures its SVG before the cascade too.
2026-11-14 16:10:10 -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
BFlat dafd993395 Merge pull request #7658 from dotCooCoo/feat/svg-filter-defaults
Effects: Effect › SVG Filters lists default filters
2026-11-15 06:18:12 +07:00
BFlat 7ddeef73d6 Merge pull request #7608 from dotCooCoo/fix/emfplus-import
Metafile import: EMF and WMF are read through craft-metafile, so EMF+ pictures open
2026-11-15 06:16:24 +07:00
dotCooCoo 2793e3379a Merge main into feat/color-management-policies 2026-11-14 15:13:28 -08:00
dotCooCoo 9f7e74ece0 Color Settings: RGB and CMYK policies keep, take off or convert a document's profiles on open
edit.colorSettings takes rgbPolicy (off, preserveEmbedded, convert) and
cmykPolicy (the same and preserveNumbers), kept in Color Settings.json.
document.open, File > New from Template and File > Revert apply the policy
of each model to a profile the file is tagged with that is not the working
space: Preserve Embedded Profiles keeps it, Off and Preserve Numbers take it
off and keep the numbers, and Convert to Working Space converts that model's
colors into the working space and takes it off. The replies list a warning
per profile, and a changed document opens with unsaved changes. The
Separations panel's Color Settings section has the two lists.

A colorMode asked for on open converts after the policy, through the
document's own profiles. Document Color Mode also converts the points of
freeform gradient swatches.
2026-11-14 14:45:00 -08:00
BFlat ada5c74c47 Merge pull request #7203 from dotCooCoo/fix/file-folder-param-classification
Automation: one classification of file and folder params
2026-11-15 05:30:12 +07:00
dotCooCoo b10ace75b6 Merge main into feat/psd-import-options 2026-11-14 13:45:30 -08:00
dotCooCoo c61d27b825 Metafile import: hidden WMF records leave the scale alone, and a far stroke keeps the strokes before it
A WMF without a placeable box picks its scale from the map mode its
drawing records are played in. Lines and shapes drawn under R2_NOP or
R2_XORPEN, and PATBLT records the reader does not fill, no longer count,
with the mix mode saved and restored with SAVEDC and RESTOREDC.

An open stroke that reaches far outside the picture is left out before
it joins the strokes waiting to be joined, so the strokes drawn before
it are still added.
2026-11-14 13:39:05 -08:00
dotCooCoo ed3c5a1a4e Merge main into fix/emfplus-import 2026-11-14 12:28:49 -08:00
dotCooCoo 35ab0ee859 Merge main into fix/file-folder-param-classification 2026-11-14 12:17:54 -08:00
dotCooCoo fb8afd7919 Merge main into feat/svg-filter-defaults 2026-11-14 12:12:02 -08:00
dotCooCoo 0b1e1e99a1 Effects: Effect › SVG Filters lists default filters
Effect › SVG Filters and Apply SVG Filter list 14 default filters in
every document, before the document's own. The set, the names and the
values are VectorCraft's own, written with SVG 1.1 filter primitives
(crates/effects/src/svg_filter/defaults.rs).

A document holds none of the defaults until one is applied or edited
there. svgFilter.apply with a default's name copies it into the document
in the same undo step, and svgFilter.define with replace naming a default
adds the edited copy under that name. The copy is listed in the default's
place. svgFilter.delete refuses a default the document holds no copy of,
and deleting the copy lists the default again.

svgFilter.list also returns the defaults. svgFilter.apply takes index and
item to put the filter in the place of an applied SVG filter, which the
dialog's OK uses when it is opened for an applied effect; an index that
is not an applied SVG filter, null included, is an error.
2026-11-14 11:19:22 -08:00
dotCooCoo 4328783970 Merge main into feat/psd-import-options 2026-11-14 10:48:00 -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 769d14ee7a Merge main into feat/arrange-nest 2026-11-14 09:47:03 -08:00
BFlat d0b37826c0 Merge pull request #7338 from dotCooCoo/fix/colored-light-seams
3D: colored-light facets close their shared edges over an underlay
2026-11-15 00:40:19 +07:00
BFlat 01e66f0a19 Merge pull request #7477 from dotCooCoo/fix/dimension-second-point-guides
Dimension tool: no construction guides through a first point off the anchors
2026-11-15 00:39:29 +07:00
dotCooCoo 501dad41a1 Merge main into fix/file-folder-param-classification 2026-11-14 08:23:36 -08:00
dotCooCoo 0df1c3f284 Merge main into fix/emfplus-import 2026-11-14 07:24:22 -08:00
dotCooCoo 882980ed0f Merge main into feat/arrange-nest 2026-11-14 07:17:57 -08:00
BFlat cbba5e85fe Merge pull request #7528 from dotCooCoo/feat/ai-style-named-gradients
PDF/.ai import: graphic styles that paint with a named gradient load with it
2026-11-14 21:54:55 +07:00
BFlat 64dd5eb174 Merge pull request #7418 from dotCooCoo/fix/reflected-dimension-line
Dimension tool: a reflected aligned dimension has its line on the reflected side
2026-11-14 21:52:10 +07:00
BFlat 09f882b9d2 Merge pull request #7534 from dotCooCoo/fix/tiled-documents-own-profiles
Color management: documents behind the front one draw through their own profiles
2026-11-14 21:51:30 +07:00
dotCooCoo 9efde43f1d Metafile import: EMF and WMF are read through craft-metafile, so EMF+ pictures open
EMF and WMF import now plays the records with the shared craft-metafile
reader (storytold/craft-libs#778, at the craft-libs rev the SVG, EPS and
DXF crates already use) and maps its picture onto the document here:
paths with their fills, strokes, caps, joins, miter limits and dashes,
clipping groups, images and point type. The EMF and WMF record players in
crates/metafile/src/import and the DIB decoder they used are removed. The
writers are unchanged, and the PICT reader keeps its own player.

What changes for a file being opened, placed or pasted, and for an EPS
file's Windows metafile preview (read when its PostScript can't be):

- An EMF that draws with EMF+ records is read from them. It opened empty,
  with a warning that EMF+ is not read. A file with both kinds of record
  is read from its EMF+ records too.
- Hatched and pattern brushes fill with the average color of the brush's
  tile, translucent where the tile has gaps. Hatches filled with the hatch
  color and pattern brushes with gray.
- Translucent fills, strokes and EMF+ text keep their alpha as opacity.
- Text keeps a stretch across from the world transform; it kept only the
  turn. Text the file clips to a rectangle is clipped to it, and an
  underlined or struck-through font gives underlined or struck-through
  type.
- A clip path whose bounding box holds the whole picture is kept unless
  it is that rectangle; a diamond or a bow tie around the picture was
  dropped.
- Images drawn with SRCAND, SRCPAINT or SRCINVERT are drawn as they look
  over white, and images drawn with other raster operations are drawn as
  a plain copy. They were left out with a warning.
- Excluded clip rectangles and the other clip region modes are applied.
  A clip path combined with RGN_OR, RGN_XOR or RGN_DIFF is ignored
  without the warning it gave.
- An image past the reader's size or pixel limits, or one that can't be
  decoded, is left out without a warning of its own. A file past the
  reader's limits (more than 32 nested clip paths, 200,000 drawn items,
  256 MiB held) is read up to that point without a warning.
- An EMF record whose size is not a multiple of 4 ends the file, with the
  "ends early" warning.

Tests: an EMF+ only picture imports its fill (it failed before), a dual
EMF+ file draws its translucent EMF+ fill and not its fallback, hatch and
pattern brush colors, clipped and underlined text, excluded clip
rectangles, a shared clipping group, an odd record size, WMF at 1440
units an inch without a placeable header and at its own units with an
inverted box, an EMF without a frame, diamond and bow-tie clips, text with a
stretch, clips nested past the stack and 200,000 clip records; the fuzz
test gains random EMF+ records.
2026-11-14 06:04:19 -08:00
dotCooCoo cd86168e34 Color management: documents behind the front one draw through their own profiles
With Window › Arrange › Tile or floating document windows, every document
other than the front one was drawn through the profiles the front document
is assigned, since the active color settings are process-wide.

- cms::with_active puts other settings in place of the active ones on one
  thread, fast paths included, and puts them back after (also on a panic).
  cms::for_document gives the context a document's assigned profiles make,
  the same one each time for the same profiles and working settings.
- Each pane renders its document's art through colormgmt::doc_cms, on the
  render worker and on the UI thread alike, and draws its paper, artboard
  colors and transparency grid through the same settings.
- Loading or removing a profile redraws the documents assigned it, the
  ones behind the front one included.
- The ink and separation tables keep the tables of up to four color
  settings, so documents with different CMYK profiles side by side do not
  rebuild them on each redraw.

Placed documents inside a document behind the front one still draw through
the front document's profiles.
2026-11-14 02:24:51 -08:00
dotCooCoo cdd6ffa1f2 PDF/.ai import: graphic styles that paint with a named gradient load with it
A graphic style from a .ai or EPS library whose fill, or the fill or
stroke of a style of one paint, paints with one of the file's gradients
by name was left out of the library. Such styles now load with that
gradient at the style's angle. The style stores only the gradient's name
and angle, so the gradient is fitted to the bounds of each object the
style is applied to; this placement is VectorCraft's own rule.

- A style of one paint reads a gradient instance's fill or stroke as
  that gradient; a gradient outside an instance is still not read.
- A fill filter paints with its last paint: a color, a gradient or a
  pattern replaces whichever of the others came before it.
- A style naming a gradient the file doesn't define, or painting with a
  pattern, is still left out.

Docs: docs/mcp.md, graphicStyle.loadLibrary params, progress doc.
2026-11-14 02:05:00 -08:00
dotCooCoo a903feb870 Dimension tool: no construction guides through a first point off the anchors
With Smart Guides on, the Dimension tool's second point snapped onto the
construction guides through the first point (Smart Guides › Construction
Guides), so a click beside a segment straight below a first point that
was not on an anchor stayed on the vertical guide instead of landing on
the segment.

The second point now has no construction guides through a first point
that is not on an anchor. After a first point picked on an anchor, the
construction guides through it still apply. The second point still snaps
to anchors, centers and alignment lines, and with Snap to Perpendicular
or Snap to Tangent on it lands where the line from the first point meets
a segment square or grazes a curve.

Docs: docs/dimensions.md, docs/target-app-parity.md.
2026-11-13 21:26:04 -08:00
dotCooCoo 7abd11d19d Plug-ins: windows and processes take turns on the Plug-ins folder
Two windows or processes using one Plug-ins folder could interleave their
writes: an install from one could leave its module with the other's grant,
a grant written for one plug-in could drop one written for another, and
plug-in settings and cache changes could lose each other's keys or pass the
cache caps together.

Each change to the folder now runs in one turn on disabled.lock, the file
the disabled list was already locked with:

- plugin.install takes the turn before it reads the stored grants and holds
  it through the module, grant, put-back and disabled-list writes;
  plugin.remove holds it through grant removal and storage deletion.
- Grant writes, the disabled list, loading the folder, and the plug-ins'
  settings and cache changes read and write in a turn.
- When disabled.lock can't be locked, plugin.install and plugin.remove fail
  and change nothing, plugin.setEnabled keeps its change in the process, and
  loading the folder writes nothing to it.

Docs: docs/plugins.md, docs/mcp.md, the plugin.install and plugin.remove
params text, docs/target-app-parity.md.
2026-11-13 21:07:28 -08:00
dotCooCoo 395ddae55a Merge main into fix/file-folder-param-classification 2026-11-13 20:30:48 -08:00
dotCooCoo f643cddec4 Dimension tool: a reflected aligned dimension has its line on the reflected side
An unlinked aligned dimension that was reflected on its own kept its
offset, which is measured along the left normal of a to b. A reflection
turns that normal to the other side, so a line 30 pt above two level
points stayed 30 pt above them after a flip top to bottom instead of
going below them. The offset now changes sign when the transform
reverses orientation, as a reflection or a scale by a negative factor
does. Other transforms leave it as before, and linked, horizontal and
vertical dimensions keep their own rules.

Docs: docs/dimensions.md.
2026-11-13 19:48:30 -08:00
dotCooCoo 941b5fcb14 Merge main into fix/colored-light-seams 2026-11-13 19:08:25 -08:00
dotCooCoo a234216ea3 Cutting Tools: Nest Shapes packs the selected objects onto a sheet or roll
Object › Plug-ins › Cutting Tools › Nest Shapes… (`addon.cutting.nest`)
moves the selected objects close together onto a sheet or a roll of
material. The sheet starts at an artboard's top-left corner and is the
artboard's size or a set width and height; a roll is a set width with
no end. A margin (18 pt by default) is kept inside the sheet's edges and
a spacing (9 pt) between objects.

Objects are packed by their bounding boxes, with their strokes and
effects (the reach of shadows, glows and blurs included) or by their
geometry: the tallest first, each where its bottom edge is highest and
then furthest left. With Rotate, an object may turn 90° clockwise where
that puts its bottom edge higher or where only the turned object fits;
a turned object is measured after the turn. A path of a pixel-aligned
compound path is not turned. Objects that do not fit go in a column to
the right of the sheet, in stacking order. Objects on the pixel grid
move by whole points and take 1 pt more room, so they stay on the grid
and keep the margin and spacing. A path of a compound path selected on
its own moves alone. Objects without bounds, such as an empty group,
are not moved and are listed in the result.

The command is one undo step, and its result gives the objects placed,
put aside, turned and skipped and the length of material used. The
dialog has Preview.

The new Nest Shapes and Roll catalog rows are in every catalog.

Docs: docs/mcp.md (Cutting Tools add-on), docs/target-app-parity.md and
ROADMAP.
2026-11-13 18:40:14 -08:00
BFlat bf3cf422e2 Merge pull request #7311 from dotCooCoo/fix/ai-graphs-keep-data
PDF/.ai import: graphs keep their data and settings when their records read whole
2026-11-14 08:39:57 +07:00
dotCooCoo 269ca40954 Merge main into fix/colored-light-seams 2026-11-13 17:00:43 -08:00
dotCooCoo 5b4e613d0b 3D: colored-light facets close their shared edges over an underlay
Under a colored light, Inflate's facets were antialiased one by one.
Where two facets met, their edge pixels added up to less than full
coverage. The solid-color composite then showed its black channel
backdrop there, so internal edges drew darker at 1:1, and the per-facet
gradient art let the background through.

- The solid-color composite draws, in each channel, an underlay of the
  facets with 2 pt round seams between the black backdrop and the
  facets themselves.
- The per-facet routes put each run of consecutive faces of one surface
  over an underlay of its own faces, clipped to the union of the faces
  and their seams. Runs that carry a gradient's opacity mask are sealed
  with that mask. A face clip's footprint keeps only the outer contours
  of its seam stroke.
- The paint-copy allowance for cut faces counts 12 copies per facet.

At 1:1, inside the surface each color channel of an opaque fill is
within 3 levels of the same art drawn at 3x and averaged down, and
every pixel is opaque. Before, 2,267 channels differed by up to 10
levels on the solid Inflate, and 1,088 pixels of the gradient Inflate
were below full alpha. Under white light, the rendered pixels, the SVG
text, the PDF read back and the expanded art of Inflate, Extrude,
Rotate and Revolve are the same as before.

Docs: docs/three-d.md (Seams), docs/target-app-parity.md.
2026-11-13 16:03:37 -08:00