Commit Graph
7507 Commits
Author SHA1 Message Date
dotCooCoo 2fbe099c48 Plug-ins: refuse replacing a compound path's members when one isn't a path
A member that is not a path (a compound path inside a compound path) is
not in the input's `path`, so a changed `path` or `type: "path"` deleted
it, together with any hidden or locked members it held. The host now
refuses such an output with an error naming the compound path. A
compound handed back as it was still keeps the member.

docs/plugins.md also says that new members keep the old ids by position
but not their names or live shapes. The test covers a nested compound
member and turning a compound with a guide member into a guide path.
2026-11-22 19:15:57 -08:00
dotCooCoo e4ce03a906 Plug-ins: a filter keeps a compound path's hidden and locked members
A filter that handed a compound path back rebuilt every member from the
returned path, even when the path was unchanged, so its hidden members
were shown and its locked members unlocked after any run.

- A compound path whose path comes back as it was, or is left out, keeps
  its members as they are.
- While a member is hidden, locked or a guide, a changed path or
  `type: "path"` is refused with an error naming the compound path. A
  guide member is allowed when the output also sets `guide`.
- A changed path still replaces the members, one per subpath, keeping
  the old members' ids by position.

Docs: docs/plugins.md.
2026-11-22 17:58:55 -08:00
dotCooCoo 0b8dae1401 Delete: removing objects one at a time keeps the id lookup cache
Every Document::remove_many cleared the id lookup cache, and the next
lookup with no cache walked the tree once to answer and again to
rebuild it. Deleting objects one by id at a time with edit.clear walked
the whole tree twice per Delete: 20,005 walks for 10,000 objects.

- remove_many keeps the cache and records which children it took out
  of each parent. A cached path then counts a node's index among its
  siblings less the removed siblings before it, so the nodes left are
  found without a walk whichever objects were removed (top, bottom,
  middle, or the art below a layer's ruler guides). The cache has no
  path for a removed node or a node inside one. The cache is still
  dropped once the removed nodes are half of its entries, and when it
  does not have a listed node where it is.
- index_path with no cache builds the cache and answers from it, in
  one walk. An id that appears more than once is still walked to, so
  the first in tree order is returned as before.

Release build, deleting each object of one layer by id with nothing
selected. Walks for 1,000 objects went from 2,005 to 14 in each order.
For 10,000 objects, median of three runs:

  from the top:     20,005 walks, 5.53 s  -> 15 walks, 4.28 s
  from the bottom:  20,005 walks, 11.24 s -> 15 walks, 10.87 s
  from the middle:  20,005 walks, 10.62 s -> 15 walks, 8.62 s

Each Delete is still one undo step. The time left still grows with the
square of the count: each Delete rebuilds the parent's child list and
keeps a copy of the document for undo, and this change does not touch
either.
2026-11-22 17:06:53 -08:00
dotCooCoo e30ce7fcdc Swatch libraries: a nested pattern's swatch keeps its free library name
A pattern that a library pattern's art is painted with, whose numbered
name ("Inner 2") the document gives another pattern, came in as
"Inner 2 2" with its swatch under that name too, so adding the library's
"Inner 2" swatch next found that swatch and left the name unused. The
swatch now takes the library swatch's name when no swatch or color group
uses it, and still paints the pattern that came in.

A color a library pattern's art brings no longer reuses a numbered copy
whose name the library gives another swatch when the copy is that
swatch, whether or not the art uses that swatch. Before, only a copy of
a swatch the same add brought was left out, so adding the library's blue
"Ink 2" and then a pattern painted with its blue "Ink" linked the
pattern's art to "Ink 2".

The params text, docs/mcp.md and the progress line describe both rules,
and the progress line says that Use Library Item's numbered names do not
skip the library's other names.
2026-11-22 17:01:51 -08:00
dotCooCoo c17e7936ef Scripts: the host-name tables list ExternalObject and its members
script_host_vs_scriptcheck failed on this branch because the host now adds the global
ExternalObject. It goes in the table of names that reach outside the document, with the
nativeCode id that script.check gives it; its length, prototype, search, constructor and
terminate members stay inside.
2026-11-22 17:01:22 -08:00
dotCooCoo 9562ed9b04 Preferences: Reset Preferences resets Smart Guides, Snap to Grid and the Contextual Task Bar
The Preferences dialog shows Smart Guides, Snap to Grid and General's Enable
Contextual Task Bar, but the app keeps them with the interface state, and
Reset Preferences left them as they were. Confirming Reset Preferences now
puts their defaults in the dialog with the other defaults: Smart Guides on,
Snap to Grid off, and the task bar as the current workspace was saved. OK
applies them and Cancel keeps the values in use. On a touch screen, where
the reset turns Enable Touch Workspace back on, OK sets the task bar in the
workspace it leaves, and the Touch workspace keeps its own.

prefs.reset (the Command Palette's Reset Preferences), alone or as a
command.batch step, resets them too, each only when it resets every category
or the setting's own (Smart Guides, Guides & Grid, General). With every
category or File Handling it also clears the app chosen for Edit Original, as
the dialog's reset does. The engine records the categories it reset
(Session::take_prefs_resets), and the app resets its own settings from them
after each command, each frame, and before a touch screen switches to the
Touch workspace.

A category that is not a string is now an error instead of a reset of every
category.
2026-11-22 16:56:25 -08:00
dotCooCoo a0cc0230b0 Scripts: an XMP sidecar update flushes the packet first and goes through on volumes without Unix permissions
- closeFile() flushes the temporary file to the disk with vectorcraft_format::sync_file before it
  takes the sidecar's name, as a saved document's temporary file is flushed.
- Keeping the sidecar's permissions is best effort, as in write_atomic: a volume that refuses Unix
  permissions (SMB, FAT) no longer makes every update throw "Script file could not be written".
- docs/mcp.md says both.
2026-11-22 16:52:35 -08:00
dotCooCoo dd303e9df7 Overprint: a white spot ink keeps overprinting with Discard White Overprint on
Discard White Overprint knocked out every white fill, stroke and character
that was set to overprint, including a white linked to a spot swatch such as
an opaque white ink. A white linked to a solid spot swatch at a tint above 0%
is an ink of its own, so it now keeps overprinting; only paper white knocks
out, a 0% tint of a spot swatch included. The rule is in
vectorcraft_doc::overprint (DiscardWhite, is_paper_white) and is used by PDF
export, Overprint Preview, Separations Preview, printed separations, the fills
and strokes of composite print with Overprints set to Simulate, and Print Ink
Fixes' Remove White Overprint.

Overprint Preview and Separations Preview also draw overprinting paper white
characters knocking out while the option is on, as PDF export already wrote
them. EPS export keeps every overprint, as before.
2026-11-22 16:49:45 -08:00
dotCooCoo ece910a3b7 Selection: a Cmd double-click after switching back is the active tool's
A switch from the Selection tool to another tool and back kept the
record of the selection tool Cmd lent the last press, so the Cmd
double-click that followed still went to Direct Selection. The record is
now cleared whenever the active tool changes and whenever the tool
starts afresh (a switch to another document or another view of it).
2026-11-22 16:45:24 -08:00
ncic aea7ae116a Pencil: a redraw stroke in the middle of an open path never closes it (#3793)
A stroke that starts and ends on an open path away from its ends now always
replaces the part between and leaves the path open. Before, a stroke across
the opening (over most of an L, or across a C) could keep the part between
and close the path along the stroke instead. Closing stays where the Pencil
shows the closing cursor: a stroke from one end that finishes on the other.
2026-11-23 01:42:18 +01:00
FredApps 110094fe7e Merge branch 'main' into refactor/metafile-pict-shared
Pin craft-metafile to craft-libs main 8f6ad14b, which includes the
merged PICT reader (storytold/craft-libs#3073), drop the craft-codepage
dependency the removed reader used, and update the PICT detection
comments for version 1 pictures.

Signed-off-by: FredApps <153173854+FredApps@users.noreply.github.com>
2026-11-23 07:20:25 +07:00
5af36bae87 Fix #4568: PDF import keeps embedded fonts for text whose family isn't installed (#4569)
* PDF import: keep embedded fonts for text whose family isn't installed

Glyphs drawn in an embedded font whose family isn't available are gathered
during import and built into one small TrueType font per family and style,
kept with the document (font/ttf blob). Text objects record the fonts and a
hash of their text: layout and rendering draw them in the kept font until the
text is edited (undo restores it) or the family is installed. Lines are
spaced against the file's own widths with per-glyph placement (#3756).

* PDF import: satisfy crate layering constraints without format dev-dep

* FileFont: negate us_win_descent in i32 to prevent overflow on extreme negative descenders

* PDF import: a kept font carries the file font's licence flags, and the docs say what that means

Review of #4569: the fsType of the file's font is copied to the font built from its glyphs (a test pins it against Embedding), so exports honour it; the docs state the limits, that the file's font program is not parsed, and that a saved file carries third-party glyphs.

* PDF import: a glyph curve far outside any glyph is left out; docs say what the limits and the font program mean

CodeRabbit on #4569: coordinates beyond 1e6 font units are refused before the curve is subdivided. The docs say the 64-font limit is what draws one type object and that the file's font program is read only for its licence flags and metrics.

* PDF import: two programs of one font keep the stricter licence flags; the docs cite their sources

CodeRabbit on #4569: embedded programs of one family and style share one built font, which kept the first program's fsType; it now takes the stricter of the two, whichever came first. The docs entry cites the Acrobat Help pages and the OpenType fsType specification.

* fmt

* PDF import: embedded fonts are on by default, with an opt-out preference

Owner decision on #4568. Preferences > File Handling > Use fonts embedded in imported PDFs (pdfImportEmbeddedFonts, on by default) and the embeddedFonts param of document.open and file.place: off, a PDF's type in a font the machine lacks is set in the fallback font with the missing-font warning, as before. One test each for on and off, one for the preference reaching the options.

* fmt after merging main

* docs: restore the status lines damaged by merges (main's line plus this PR's note)

* PDF import: set embedded_fonts through a builder method (keeps read_opened under the complexity limit)

* PDF import: move the missing-font notes out of read_opened (complexity limit after the merge)

* #4569: isolate file-font resources and reclaim live faces (UNVERIFIED)

* Preserve carried-font ownership across placement and recovery

* Fix carried-font regression test dependencies and unwind probe

* Use explicit OS2 heights in owned-font reference regression

* Keep native font regression artwork inside document layers

* fix(engine): bind file fonts when reading document profiles

* test(engine): initialize file-font leases in new image fixtures

* test: complete file-font lease initialization in image fixtures

* docs: keep the #4568 entry in the file-format parity status line

* fix(pdf): keep a line with another glyph for the same character as outlines (review)

A font kept with the document has one glyph per character. A glyph of the file's font that
differs from the one already kept for its character (a stylistic alternate that maps to the same
Unicode scalar) marks its line, which is imported as outlines so each glyph draws as the file
does.

* docs: resolve the leftover status-line conflict

* Placed document blob: give the new ImageBlob literal its file_font

* Test: a PDF's two glyphs for one character survive a native save and reopen as the file draws them

* Test: move the native save and reopen half of the two-glyphs regression to the engine (layers: no format dev-dep in pdf)

* Fix embedded-font preference help and English fallback checks

* Format embedded-font preference help with the workspace edition

---------

Co-authored-by: FredApps <FredApps@users.noreply.github.com>
Co-authored-by: skylartaylor <hi@skylar.cc>
2026-11-22 18:18:18 -06:00
dotCooCoo 06d430e4bd Scripts: a replaced XMP sidecar keeps its group and access ACL
closeFile() now replaces a sidecar through vectorcraft_format::keep_permissions, the same step a
saved document takes. On Unix the temporary file takes the sidecar's permission bits, group and (on
Linux) access ACL, or stays readable by its owner alone where the group or the ACL cannot be kept.
Permission bits that cannot be set fail the write, and the sidecar stays as it was. A Linux test
checks that a folder's default ACL does not reach a replaced sidecar.
2026-11-22 16:01:53 -08:00
dotCooCoo d2600b0bd9 Plug-ins: a JavaScript manifest opened by path is installed without reading it first
Opening a JavaScript plug-in's .vcplugin by its path now goes straight to
plugin.install {path}, which reads the manifest and its script with the
plug-in loader's limits. The app's file reader no longer reads the whole
file before the plug-in branch. The plugin.install params text is
reworded so that every alternative starts with its parameter name.
2026-11-22 15:39:40 -08:00
dotCooCoo dc9adb195d Scripts: pageItems lists the art inside blends, envelopes, repeats and intertwines
pageItems walked into groups and compound paths only, so the objects inside a blend,
an envelope, a repeat or an intertwine were missing from length, [i], index and
getByName, although each of them reports that container as its parent. The walk now
goes into every container's children.
2026-11-22 15:33:08 -08:00
dotCooCoo 3d460c1697 Scripts: guide, layer, move and addDocument fixes for the object model
- Document.selection and PageItem.selected refuse a path made into a
  guide while Lock Guides is on, instead of passing the check and then
  selecting nothing. The locked artboards are measured once per
  assignment.
- An edit whose command selects the objects it changes puts the current
  layer and the highlighted Layers panel rows back as they were.
  layer.setCurrent takes keepRows, which leaves the highlighted rows as
  they are.
- move on an object on a locked artboard throws Cannot move, as editable
  reads false for it. duplicate, with or without a relative object, on a
  hidden or locked object or an object on a locked artboard throws
  Cannot duplicate and makes no copy.
- When move takes the last path out of a compound path, the empty
  compound path is deleted in the same undo step.
- addDocument writes each warning from reading the profile's file to the
  Script Console as addDocument: <warning>, and a previewMode of
  PixelPreview throws an error that says it is not available yet.
2026-11-22 15:33:08 -08:00
dotCooCoo 828f43447d Undo: a command run during a tool drag is its own undo step
A command run from a panel, a menu or an automation client while a tool
drag was open ran inside the drag. With Real-time Drawing on, the drag's
next move put the document back to where the drag began and dropped the
command's edit, and Escape dropped it too. With Real-time Drawing off,
the release lost what the drag drew or moved.

Such a command now runs on the document without the drag's preview and
records its own undo step and journal entry. The drag then continues
from the command's result: with Real-time Drawing on, its preview is
applied again at once. The release records the drag's step after the
command's, Undo takes back the drag first and the command next, and
Escape cancels only the drag. The drag acts on the objects it started
with, so a selection the command makes does not change what it moves,
and the fill and stroke proxies keep showing those objects' paints.
Objects the command deletes, hides or locks are left out of the drag.
A change the command makes to the current layer or to the new-art paints
stays when the drag ends or is canceled. When the command deletes the
art being dragged, the drag records no step. A warning or an error from
the preview applied again goes to the command's result.

Commands that already kept the drag as a step first still do (Undo,
Redo, command.batch, swatch.renameGroup, edit.newDocumentFromState and
the others that call settle_interaction). Typing in progress is still
kept as a step of its own first. A command run during a Quick Pen press,
object.transform with copy during an Alt-drag, and a command run during
a dialog's or a panel's preview still run inside the interaction.

Docs: docs/mcp.md (undo / redo row), docs/target-app-parity.md.
2026-11-22 15:17:12 -08:00
dotCooCoo 03c1c6c70f Plug-ins: written type keeps one paragraph style per paragraph, and API level 2 filters may leave out an image's opacity
- A read-only image entry may leave out `opacity`, which hosts before API
  level 3 don't give, so a level 2 filter that rebuilds an image entry from
  the fields it knows still matches.
- A `text.paragraphs` list returned as it was given next to changed
  `text.runs` is checked against the new paragraphs: a count that no longer
  matches is refused instead of being dropped.
- Written runs hold at most 4,096 paragraphs, the limit for runs and for
  the paragraphs a filter is given.
- A fill or stroke in a written run's style with a key its `type` doesn't
  read (`tintt`) is refused with the `unknown key` error.
- The font family limit counts the name as given, not the trimmed name.
- The run styles of a type object are indexed once per object, not
  compared with every run's style.
- Character styles loaded from another document are skipped when their
  tracking, kerning, rotation, miter limit, dashes, Small Caps or variable
  font axes are out of range, as `charStyle.new` checks them.
- The plug-in command test's Size command adds a square, since an output
  that changes nothing records no undo step.

Docs: docs/plugins.md, docs/mcp.md, plugin.run params text.
2026-11-22 14:09:03 -08:00
dotCooCoo 2894c60473 Scripts: XMP packets are checked as they are read and written, and safe closes use a temporary file
- closeFile with XMPConst.CLOSE_UPDATE_SAFELY passes the flag to xmpWrite, which then writes only
  through a temporary file; where none may be made it throws and leaves the sidecar and the packet
  as they are.
- On Unix the temporary file is created with mode 0600 and takes the sidecar's permission bits
  after the packet is written.
- canPutXMP and putXMP check again that the file is open for update after converting the packet
  argument, since a toString may close it.
- Path arguments are converted once, so a toString that changes between calls cannot mix two
  paths.
- setLocalizedText moves an existing x-default item to the front.
- A second ExternalObject install is refused and keeps the registered namespaces.
- Text beside rdf:Description elements or their properties makes a packet malformed.
- Properties read from a packet share one copy of each namespace URI, and reading stops once the
  properties exceed the script heap.
- A value with qualifiers in the rdf:value form gives the text and options of its rdf:value, and
  an empty property element whose attributes are fields is a structure.
- serialize() and reading refuse a value that would be written with more than 1,024 attributes or
  namespace declarations in scope at one element.
- find_packet treats packet markers inside CDATA sections and comments as text, and passes over a
  packet that is not UTF-8 for the next one. A section that holds a trailer and then a start does
  not hide that start, and each marker search starts where the last one stopped, so the scan
  reads the bytes about once.
- An rdf:Alt item with xml:lang="" has no language, so its array is not a language alternative;
  the empty attribute is written back as it was.
- The rdf:about value counts toward the parse budget, also in a packet with no properties.
- docs/mcp.md says that the prefix limit applies to a namespace being registered.
- The round-trip property test generates valid packets, the retry test closes the same XMPFile
  again after a failed write, and the heap-limit test requires a heap-limit error and a change
  that goes through.
2026-11-22 13:40:36 -08:00
dotCooCoo 744faaab6c Tests: startup script tests remove their temporary folders
`tmp_dir` in `crates/engine/tests/script_startup.rs` now returns
`vectorcraft_testkit::TempDir`, which deletes the folder when the test
ends, also after a failed assertion. Before, every run left its folders
under the system temporary directory.
2026-11-22 13:20:56 -08:00
dotCooCoo fabec2187f History: an Effect Options step names an effect only when every target has it
effect.setParams named its step after the edited effect when the targets
that have an effect at the index all shared one, so with Feather on one
object and no effect on the other the step still recorded Feather. The
step now records the effect only when every target has one at the index
and all are the same. The target that has the effect is still edited.

The i18n menu-label test helper now reads an Effect menu item's label
through menus::effect_item_label, the function the menus draw it with.
2026-11-22 13:09:47 -08:00
ncic 3b668aec46 Pencil: a tall redraw keeps an open line's ends and a thin shape's body (#3793) 2026-11-22 21:59:44 +01:00
Terra854 eb3a9ba335 Import: share Mac Roman decoding across legacy formats (#9042) 2026-11-23 03:37:59 +07:00
dotCooCoo e37b052028 Print: the PDF fonts note names the fonts drawn as outlines
PDF print embeds subsets only of the fonts whose licenses allow it and
draws the others as outlines. The note that None and Complete add now
says so, as do the Fonts params text, docs/mcp.md and the progress line.
2026-11-22 12:12:38 -08:00
dotCooCoo 989aa08f16 Plug-ins: a failed removal keeps settings, and the key store reconnects
- plugin.remove deletes the stored module of a plug-in that isn't
  installed while its settings and cache are still moved aside, so a
  module that can't be deleted leaves them in place for the next try.
- plugin.remove of an invalid id no longer raises the grants generation.
- The size check before a signed grants write uses the generation the
  file is written at, so a file that fits the 1 MiB limit is kept.
- The system key store connection is dropped when the key store can't
  be reached through it or fails, and the next call connects again; a
  missing entry keeps the connection.
2026-11-22 11:58:30 -08:00
dotCooCoo 6327295d28 EPS: white fills and strokes knock out with Discard White Overprint
PDF export lets a fill or stroke marked to overprint do so only when it
is not white with Discard White Overprint in Output (Document Setup, on
by default). EPS export and composite PostScript printing ignored that
setting, so an overprinting white fill or stroke was written with
"true op" and the inks below it stayed visible. They now apply the same
rule to path fills and strokes, character fills and type object fills.

The tiles of an overprinting pattern fill overprint with it, as in PDF
export. Before, a tile marked to overprint wrote its own "true op" and
"false op", which turned overprinting off for the tiles after it.
Separated plates are not checked for white, since their colors are
already the plate's coverage.

Re-exporting or printing to PostScript a document with an overprinting
white fill or stroke gives different output: the white knocks out
instead of overprinting, unless Discard White Overprint in Output is off.
2026-11-22 11:39:17 -08:00
dotCooCoo 977e896fd0 Plug-ins: File › Place keeps a named importer and its params for every file
- file.place with `importer` and `params` and `paths`, or with no file,
  opened the Place dialog with only the files, so its OK read them with the
  built-in reader. Each dialog entry now carries the importer and its
  params, from the paths given, the desktop pick and the web pick, and OK
  passes them to file.place and file.place.queue.
- On the web, each picked file carries its own pick's importer and params.
  Picked files with other ones, or that arrive while a Place dialog is open,
  wait for the next dialog.
- The Place dialog does not read the start of a PDF, .ai, EPS or PostScript
  file placed with an importer named to tell whether Link would place it as
  a document.
- A path placed or opened with `importer` named is refused from its size
  before any of it is read. Before, its first 64 KiB were read first.
- docs/plugins.md and docs/mcp.md say when the size check runs, that the
  web's File › Place reads the picked file in the browser, that File ›
  Place's filters leave out extensions a built-in format reads, and that a
  dropped file a built-in format reads goes to that format.
2026-11-22 11:31:23 -08:00
dotCooCoo 185d79b820 Swatch libraries: only a numbered pattern swatch keeps its free library name
A library pattern swatch named after its pattern took the library
swatch's name whenever the document did not use it, even when its
pattern came in under another name. For an unnumbered name this changed
the existing result: adding a library "Tiles" to a document that has
another pattern "Tiles" without a swatch named the swatch "Tiles" while
it paints "Tiles 2". Only a numbered name, which the reservation keeps
for the library swatch, is now kept that way; an unnumbered one is named
after the pattern that comes in, as before.

docs/mcp.md is rewrapped where two lines were broken mid-paragraph, and
the progress line puts the Use Library Item sentence before the rules
that apply only to Add to Swatches.
2026-11-22 11:13:43 -08:00
dotCooCoo 606157cc34 Scripts: XMPFile methods take only XMPFile objects, and x-default updates its matches
- XMPFile's methods refuse an object the XMPFile constructor did not
  make, so a plain object or one made from XMPFile.prototype with
  properties of the same names is not read or written as a file.
- setLocalizedText for x-default also changes the items that had the
  text of the x-default item.

Tests: a_script_cannot_change_the_state_of_an_xmp_file in
crates/engine/src/tests/script_xmp.rs and
localized_text_for_x_default_changes_the_items_that_matched_it in
crates/js/src/xmp_tests.rs.
2026-11-22 11:09:01 -08:00
dotCooCoo 2592dde6c8 Selection: a Cmd double-click after a tool switch is the new tool's
The double-click or triple-click that follows a lent Cmd-click went to
the tool lent to that press even after another tool or document was
chosen. The lent tool is now kept with the document and the tool it was
lent from, and a follow-up in another document or after a tool switch
goes to the active tool.
2026-11-22 11:07:03 -08:00
dotCooCoo 72c4875990 Scripts: a script cannot change the state an XMPFile keeps
An XMPFile kept its path, open flags and pending packet in writable,
configurable properties, so a script could assign a packet to a file
opened for reading and closeFile wrote it without checking the update
flag or reading the packet.

- The properties holding an XMPFile's state are not writable,
  enumerable or configurable, and the pending packet is one of them from
  the start.
- The XMPMeta docs say that only the namespaces a packet's names use
  are registered, which is what reading a packet does.

Test: a_script_cannot_change_the_state_of_an_xmp_file in
crates/engine/src/tests/script_xmp.rs. Docs: docs/mcp.md.
2026-11-22 10:44:46 -08:00
dotCooCoo f6bbab4b6e Swatch libraries: swatches a pattern brings skip the library's numbered names
Add to Swatches now passes the clipboard importer the library's numbered
swatch names that a picked pattern's swatches and patterns can come in
under. A swatch or pattern that the import brings under a numbered name
skips those names. This replaces the placeholder and copy swatches that
held the names around the import. Paste and Use Library Item pass none
and number swatches as before.

- A tint or gradient of a numbered library name that the art brings,
  such as a tint "Ink 2" of "Ink", keeps that name. Before, in a
  document with another "Ink", the art's "Ink" came in as "Ink 2", the
  tint as "Ink 2 2", and adding the library's "Ink 2" next added it
  again.
- A swatch of a numbered library name that the document does not use
  comes in under that name instead of as the document's identical copy
  ("Ink 2 2"). A copy of it that the import already brought is not
  reused for another library color of the same paint.
- Of two library swatches with one numbered name, the first one in the
  library keeps the name when the other is a swatch the art brings or a
  pattern swatch.
- A pattern that the art is painted with, and its swatch, skip the
  library's names when they come in numbered. A pattern of a numbered
  name whose library swatch places it otherwise keeps its name, and the
  swatch that comes with it gets another, so adding the library swatch
  next finds its name free.
- A pattern swatch's numbered name skips the library's names, as a
  color's does, and a pattern swatch takes the library swatch's name
  when it is free, also when its pattern is reused.
- A pattern pasted into the document is still found: when skipping the
  names would add the pattern again, or would reuse it only by merging
  colors, an import that does not skip them is used if it reuses the
  pasted pattern and gives none of those names to another swatch.
- The paint and kind check on the colors a pattern's art brings or
  takes has a test: a library whose spot "Ink" shares its name with a
  global "Ink" in a color group, so that the art brings both.

docs/mcp.md is rewrapped and says that a library color is numbered
beside a document color of the same name and paint of another kind
(process, global or spot), not only beside a process color. The params
text of swatch.library.add, docs/mcp.md and the docs/target-app-parity.md
line describe these rules and name their tests.
2026-11-22 10:11:05 -08:00
dotCooCoo e3d10ec15e Images: colorized image overprint keeps main's white rule and skips painted effects
White now follows the rule main has for white fills: with Discard White
Overprint on, PDF export, the previews and printed separations knock a
white color out, and EPS export turns overprinting on as it does for
fills and strokes. The changes to EPS output for white fills and to white
spot inks are no longer part of this change.

- The previews and printed separations treat an image with a visible
  drop shadow, outer glow or Gaussian blur of its own as knocking out, so
  the effect is not darkened or hidden with the image.
- Legacy .ai reading takes an image mask's fill overprint only from an O
  written after the previous object, not from the path before it.
- A fill of None, which takes the color off, also turns its overprint off.
- On a PostScript separation plate, an overprinting image whose color puts
  none of the plate's ink down is left out while a fill or stroke of it
  still draws, and an image that does not overprint as a whole knocks out.
- PDF export writes an overprinting gray color as an image of black ink
  alone, so the other process inks below it stay.
2026-11-22 08:48:09 -08:00
dotCooCoo 23ad161d30 Print: the Fonts setting chooses how PostScript output sends type
The Graphics section's Fonts setting was stored but no print writer read
it: PostScript output always drew type as glyph outlines.

- Subset (the default) defines, in each page's setup, Type 3 fonts drawn
  from the faces' outlines that hold only the glyphs that page shows.
- Complete defines every glyph of each face the job shows once, in the
  job's setup, and fails with an error before writing anything when the
  definitions would take more than 64 MB.
- None sends no font program: each page asks for the printer's copy by
  its PostScript name (%%DocumentNeededResources, %%IncludeResource) and
  names each glyph in an encoding, with a note naming each font.
- Type in a gradient or pattern, color glyphs, glyphs bent along a
  curved path, ruby and, under None, glyphs without names stay outlines.
  So does type in a font whose license forbids embedding, or, under
  Subset, allows only whole embedding, with a warning.
- Only the sheets the print order prints are drawn.
- PDF print still embeds font subsets; None and Complete add a note
  saying so, in the print and its preview.

Docs: docs/mcp.md, the print.setup params text, docs/target-app-parity.md.
2026-11-22 08:40:41 -08:00
dotCooCoo 63143460eb Pathfinder: effects journal every option they use, and Outline follows Precision
- effect.apply with some Pathfinder Options in params journals all three
  options the effect used. The journal entry used to keep only the ones
  given, so a replay took the others from the preferences at that time.
  The journal now merges an object a command resolved with the object
  the call gave, key by key.
- A Pathfinder effect's stored precision that is not a number (true,
  false, "1abc") evaluates and scales as the 0.01 pt default. It used
  to read true as 1 pt, false as the 0.001 pt bound and "1abc" as 1 pt.
  Commands still refuse such a value with an error.
- Outline, the panel operation and the effect, applies Precision. Its
  tolerance for crossings that count as one point, and for coincident
  edges, is multiplied by precision / 0.01, so the default leaves the
  output unchanged.
- Pathfinder Options' precision range is the Pathfinder effects' range
  constant rather than a copy of it.

Docs: params text, docs/mcp.md, docs/target-app-parity.md.
2026-11-22 08:32:24 -08:00
dotCooCoo e06015b295 Plug-ins: object filters written in JavaScript
An object filter may be a .vcplugin manifest with "runtime": "js" and the
.js file its script key names in the same folder. plugin.install {path},
plugin.inspect, plugin.reload and File > Open read the two together; the
host keeps them as one JSON object (the manifest with the script's text in
source), which plugin.install {dataBase64} also takes and which the grant's
SHA-256 covers.

Each run gets a new interpreter with no file, command or clock access, the
filter's instruction and time budgets, and a heap within the plug-in's
memory cap. run(input, params) returns the output a module returns, checked
the same way, and the document changes as one undo step. Syntax errors,
thrown errors, limits and a missing result name the plug-in and its script,
with the line and column when the interpreter reports them. A manifest
without script, an unsafe script name or a script over 8 MiB is refused
before the script is read.

Docs: docs/plugins.md (JavaScript filters), docs/mcp.md, progress line.
Part of #2193.
2026-11-22 08:26:24 -08:00
dotCooCoo 100a954317 Images: an overprinting colorized image keeps the inks its color leaves out
- EPS export writes an overprinting colorized image in a CMYK color in
  only the process inks the color puts down: one DeviceN image at
  Level 3, one Separation image per ink at Level 2. A pass turned away
  at the page limit takes back the passes before it, and the encoding
  cache keeps overprinting and plain encodings apart.
- A fill or stroke of a colorized image counts as drawing only with a
  visible Convert to Shape or Outline Object (one shared list with the
  effects crate), so another effect, such as Offset Path, no longer
  keeps the image from overprinting as a whole.
- Flattening without Preserve Overprints, and clearing overprints on
  PDF import and printing, also clear the overprint an image keeps
  after its color is removed, so a color given later knocks out.

Docs: docs/mcp.md (Overprint), docs/target-app-parity.md.
2026-11-22 08:18:56 -08:00
dotCooCoo 30eb12aba3 JavaScript: generator functions, yield and yield* in ES2015 realms
A realm made with Options::es2015 reads function* declarations and
expressions, *name() methods in object literals, yield and yield*, as
ECMA-262 11th edition sections 14.4 and 25.4 define them. A suspended
generator keeps its frame in its object; next, return and throw on
%GeneratorPrototype% push it back on the interpreter's frame stack, so
a resumption takes fuel and counts against the frame limit, and return
runs the finally blocks around the yield. Resuming a running generator
throws a TypeError. yield* passes next, throw and return on to its
iterator and closes one without throw before throwing a TypeError.
%GeneratorFunction% is reached through a generator function's
constructor. Outside generators, sloppy code still reads yield as a
name, and a realm without the option reads function* as a syntax error.

An engine that #targetengine kept from a .jsx run has no generator
built-ins, so a generator function called there throws a TypeError.

cargo xtask test262 runs the generator folders: 509 of 549 runs pass
(94 of 96 before). Docs: docs/mcp.md, docs/target-app-parity.md.
2026-11-22 08:15:47 -08:00
dotCooCoo 58dab25cc6 Scripts: a sidecar XMPFile replaces keeps its Unix permission bits
closeFile() writes a sidecar through a new temporary file and renames it
over the sidecar, so a 0600 sidecar became 0644 under a 022 umask. The
temporary file now takes the sidecar's permission bits before the
rename, as File.copy does for its target.

Test: a_replaced_sidecar_keeps_its_permissions (Unix only) in
crates/engine/src/tests/script_xmp.rs.
2026-11-22 08:11:31 -08:00
dotCooCoo 909c169afe Scripts: queued startup runs keep the file access scope of the request that queued them
In the app, script.startup.run starts only the first queued run inside the request; the later
startup scripts and the chosen script start from the frame loop. Each of them now starts, and its
file is read, in the scope captured when the queue was built, so a confined request's automation
roots apply to every run it queued.
2026-11-22 08:06:13 -08:00
dotCooCoo 17c2f43485 Direct Selection: optional preference keeps paths joined when Delete removes anchors
The new General preference Delete Removes Anchor Points and Keeps Paths
Joined (`deleteKeepsPathsJoined`, off by default) is the default of a new
`keepJoined` param of edit.clear (Delete, Backspace, Edit › Clear, and the
Layers panel's Delete button while no row is highlighted). With it on,
Delete removes the direct-selected anchors of each path as Remove Anchor
Points does, refitting the curve around each one, so a closed path stays
closed and an open path stays in one piece. The next anchor along is selected (the one
before at an open path's end), so the next Delete goes on along the path.

- Objects selected whole are deleted and paths with a selected segment
  are cut there, as before, in the same undo step. A path left with fewer
  than two anchors is deleted; a compound path keeps its other members.
  When no changed subpath keeps two anchors, the path stays selected
  whole, as Remove Anchor Points leaves it.
- The value used joins the journal entry, so a replay removes the anchors
  the same way whatever the preference is at the time; a saved step
  without it opens the paths as it did when it was recorded. A keepJoined
  value that is not a boolean is an error, also with ids, where the param
  has no other effect. path.deleteAnchors and Cut are unchanged.
- The Smart Pen does not take the Delete key, so Delete follows the
  preference with it chosen too.
- The label and its description have a row in every catalog.

Without keepJoined and with the preference off, edit.clear gives the same
result as before.

Part of #8326

Docs: docs/mcp.md, docs/target-app-parity.md.
2026-11-22 07:57:33 -08:00
dotCooCoo c664ce630b Plug-ins: importers whose manifest sets place also read files for File › Place
An importer plug-in with "place": true in its manifest now reads its files
for File › Place as well as File › Open. file.place, file.place.info and
file.place.queue take importer and params; without importer, a file no
built-in format reads goes to the first placing importer by id that lists
its extension. The importer is given at most 128 MiB of the file (a larger
file is refused from its size before it is read) with _context.mode
"place", and its objects, guides left out, become one group named after
the file, as one undo step, embedded. A decline, invalid output, a trap or
Cancel places nothing.

- The Place dialog lists placing importers' extensions under "All
  placeable files" and in a filter named after each importer.
- On the web, a placing importer's file dropped on the canvas is placed.
- A file placed with a named importer skips the text, PDF, DXF and PSD
  import options.
- document.formats and plugin.list mark placing importers with place:
  true; place on any other kind is refused at install.

Docs: docs/plugins.md, docs/mcp.md, docs/gaps.md, docs/target-app-parity.md.
2026-11-22 07:20:07 -08:00
dotCooCoo e48b811707 Scripts: an opacity a graph mark already has replaces the one its series keeps
Assigning PageItem.opacity skipped object.setProps when the item already
had that opacity, so a graph mark or label set to the opacity it shows
left the graph keeping the opacity another mark of its series or kind had
set. The setter now leaves the no-op check to object.setProps, as the
command does for that case. A value within the getter's rounding of the
item's opacity sends the opacity the item has, so assigning the opacity a
script read back still changes nothing and adds no undo step.
2026-11-22 07:02:06 -08:00
dotCooCoo 1592cee7a8 Plug-ins: Apply Last Filter and Last Filter… repeat the last filter plug-in
Object › Plug-ins now starts with Apply Last Filter (plugin.applyLastFilter)
and Last Filter… (plugin.lastFilter). Once a filter plug-in's plugin.run
succeeds (its menu item, its dialog's OK, a shortcut, a request, the last
plugin.run step of a command.batch or of an Action Batch that processed a
file or data set, or a background run once its result is applied), Apply
<name> runs it again on the selection with the same parameters, without
its dialog, as one undo step, and <name>… opens its dialog with those
parameters. A filter's own dialog opens with the parameters it last ran
with in the session. Previews, Cancel, failed runs, a plug-in's own
commands and live effects don't count.

Both items are grayed out, and return an error through automation, with
no document open, before a filter ran, once that filter was removed or
installed again, or when its manifest no longer takes the parameters as
they are. The parameters are kept for the session only, for at most 64
filters.

The help page describes the same pair for filters:
https://help.adobe.com/archive/en_US/illustrator/cs3/illustrator_cs3_help.pdf#page=357
Where the items sit and when they are grayed out are VectorCraft's own
rules.

Docs: docs/plugins.md, docs/mcp.md, docs/target-app-parity.md.
2026-11-22 06:48:36 -08:00
dotCooCoo faa5e3062c Scripts: .js scripts read optional chains and the ?? operator
With Options::es2015, vectorcraft-js reads and runs two ECMAScript 2020
forms: optional chains (a?.b, a?.[key], f?.(args) and the accesses and
calls after them) and ??.

- An optional step that finds undefined or null ends the whole chain
  with undefined, without evaluating its other keys and arguments.
  Parentheses end a chain. a?.b() and a.b?.() call with a as this,
  (a?.b)() does too, eval?.(code) is an indirect eval, and delete a?.b
  is true when a is undefined or null.
- ?? keeps any left side other than undefined and null.
- ?. before a digit still reads as ? and a number (a?.5:1).
- Mixing ?? with && or || without parentheses, assigning to or updating
  an optional chain, a tagged template after one and new a?.b() are
  syntax errors.

Two new jump instructions test for undefined and null, and the verifier
checks both of their paths. A chain of any length compiles with a loop.
.jsx files and source strings stay ES5.1, where ?. and ?? are syntax
errors.

The test262 ES2015 subset now also reads expressions/optional-chaining
and expressions/coalesce: 426 of 426 negative parse runs and 591 of 615
other runs pass with the option. The 24 failing runs are the same as
before this change.
2026-11-22 06:45:48 -08:00
dotCooCoo 945d0a42b0 Plug-ins: check every number in the type styles a filter writes
Type a filter returned went to layout with its character and paragraph
styles only parsed, and a style equal to one of the type's runs was not
checked at all, so a filter could set leading of 1e9, 100,000 tab stops,
a scale of 0 or a Kinsoku set the document does not have.

- The ranges the character and paragraph style commands keep each
  attribute to move to CharStyle::check_ranges and
  ParaStyle::check_ranges in vectorcraft-doc (text/attr_ranges.rs).
  charStyle.new, charStyle.edit, charStyle.setAttrs and the paragraph
  style commands call them, and so does the filter write path, for every
  run and paragraph style, including one the type already has.
- A paragraph style's custom Kinsoku set must name one of the
  document's sets, and takes that set's characters.
- The character style commands now also refuse tracking and kerning
  outside -1000 to 10000, rotation outside -360 to 360, a miter limit
  outside 1 to 500, Small Caps outside 1 to 200, negative dash lengths
  and a variable font axis setting that is not a number.

Each refusal names the object and the field, and the document does not
change. Docs: docs/plugins.md, docs/mcp.md, docs/target-app-parity.md.
2026-11-22 06:24:25 -08:00
dotCooCoo 4f73ef7fbb Images: Overprint Fill makes a colorized image's color overprint
A grayscale or 1-bit image colorized with a fill color had no way to
overprint: object.setOverprint {fill: true} changed nothing, since an
image has no fill row. The color now carries its own overprint flag
(colorize_overprint in native files).

- object.setOverprint (fill, without item) and attributes.info set and
  read it; Overprint Black and Print Ink Fixes' Remove White Overprint
  treat the color as the image's fill.
- Overprint Preview, Separations Preview and printed separations show
  the inks below the image where its color has none; on a plate the
  color puts no ink on, the image is left out.
- PDF export draws the image in an overprinting graphics state, a
  process color as an image of only the process inks it puts down.
- EPS export turns overprinting on for it, and now leaves white fills,
  strokes and colorized images knocking out with Discard White
  Overprint, as PDF export does.
- A legacy .ai file writes it as the image mask's fill overprint and
  reads it back. Warped pieces, geometry-effect copies and flattening
  keep or drop it as they do for fills.
- A white spot color is an ink: with Discard White Overprint it keeps
  overprinting in PDF and EPS export and in both previews.

Docs: docs/mcp.md (Overprint, Print Ink Fixes), docs/target-app-parity.md.
2026-11-22 06:15:41 -08:00
dotCooCoo 8cc1bc8530 Scripts: ExternalObject loads the XMP objects XMPMeta, XMPFile and XMPConst
new ExternalObject("lib:AdobeXMPScript") defines XMPMeta, XMPFile and
XMPConst in the script engine; any other library name throws and no
native library is loaded.

- XMPMeta reads a packet string and serializes one, with or without the
  packet wrapper: simple properties, arrays of simple items, language
  alternatives and namespace registration and lookup. Structures and
  values with qualifiers are kept as they were written.
- XMPFile reads and writes only where File may. A .xmp sidecar opened
  for update takes putXMP, and closeFile writes it through a temporary
  file in the same folder when the script may write there; other files
  are scanned for their packet and are read only. File's 8 MiB limit
  applies before reading.
- Packets are parsed with craft-xml: a document type declaration, an
  undefined entity, nesting over 64 levels and a packet over 8 MiB are
  refused with an error.
- Members not built yet (iterators, structure fields, qualifiers,
  aliases, sorting, byte-array packets, XMPFile.getFormatInfo) throw
  that they are not available yet.

The XMPConst flag values follow the public XMP Toolkit SDK header
XMP_Const.h. Tests: crates/js/src/xmp_tests.rs, with fuzz cases for the
packet parser and scanner, and crates/engine/src/tests/script_xmp.rs.
Docs: docs/mcp.md and docs/target-app-parity.md.
2026-11-22 06:11:31 -08:00
dotCooCoo 0d4780e33c Export: GIF and PNG-8 take the Transparency Dither settings
document.export reads transparencyDither (none, diffusion, pattern or
noise) and transparencyDitherAmount (0 to 100) for GIF and PNG-8 with
the same ids as Save for Web, and refuses an unknown method or an
amount outside 0 to 100. Other formats do not read the keys, and the
warnings name them as not used.

GIF and PNG-8 Options show Transparency Dither and, for Diffusion, its
Amount, disabled while Transparency is off.

Docs: docs/mcp.md, docs/target-app-parity.md.
2026-11-22 06:03:49 -08:00
dotCooCoo a1bd1ba906 Shape Builder: a fill chosen while the tool is active leaves the selection's fills
Choosing a fill while the Shape Builder was active (a swatch, the Color
panel, the Fill box or a paint command) ran paint.setFill on every
selected path, so all of them took the color. With Pick Color From set
to Color Swatches the tool merges with the current fill, so the pick is
the color for the next merge.

While the Shape Builder is active, a fill chosen without ids, id or item
now changes only the current fill, with either Pick Color From: with
Color Swatches the next merge fills with it, and with Artwork merges
still take their look from the art. A stroke chosen then still goes to
the selection. Swap Fill and Stroke and Default Fill and Stroke change
only the paint for new art, and Swap gives the current fill the stroke
the Stroke proxy shows. This is VectorCraft's own rule; no default
setting changes.

- painting_tool_of says which tool paints with the chosen fill or
  stroke: the Live Paint Bucket with both, the Shape Builder with the
  fill. Session::tool_paints(stroke) replaces bucket_paints, so the
  paint and gradient commands, previews, the proxies, the Stroke panel
  and the Gradient panel's eyedropper follow it for each kind.
- A new selection does not replace the tool's fill for new art, with
  New Art Has Basic Appearance on or off, and new art is not linked to
  a graphic style whose fill it does not have.
- A cancel puts back a fill previewed for the tool, also after another
  tool was chosen during the drag.
- An Eyedropper pick armed for a stop of the tool's gradient samples
  only into a stop of that gradient, and ends once that stop is gone.
  Choosing another tool drops the stop the pick was armed for, and a
  pick armed while the Eyedropper waits for a Cmd-drag keeps its stop.
- The paint.freeform commands refuse the Shape Builder's fill as they
  refuse the Live Paint Bucket's colors, which lie on no object. For
  the gradient either tool paints with, the Color panel, the Gradient
  panel, the stop popover and swatch drops edit its stops instead of
  points, and the Gradient panel shows its Draw toggle, ramp and stop
  fields in place of the point controls. paint.editGradient keeps the
  given stops of a freeform gradient that has no points yet.
- A gradient command that names no kind edits the proxy in front when
  the tool paints with it, else the kind the selection's active
  Appearance row stands for.
- set_paint lists the commands that painted no object in unpainted.
- Params text and docs/mcp.md describe the rule.

Help (Pick Color From, Color Swatches):
https://helpx.adobe.com/illustrator/desktop/draw-shapes-and-paths/draw-shapes/shape-builder-tool-options.html
https://help.adobe.com/archive/en_US/illustrator/cs5/illustrator_cs5_help.pdf#page=266
https://help.adobe.com/archive/en_US/illustrator/cs5/illustrator_cs5_help.pdf#page=267
2026-11-22 06:01:44 -08:00