Commit Graph
9456 Commits
Author SHA1 Message Date
dotCooCoo cf30177ba8 Merge main into feat/scripts-print-printer 2026-11-23 11:10:17 -08:00
dotCooCoo a149f93392 Script checker: code the check can't read keeps a Folder's length, hidden and readonly setters
The check leaves out `length`, `hidden` and `readonly` set on `new
Folder(...)`, a `Folder` place, or a variable holding one, but a script
can give that name a File object in ways the check does not read. Such a
setter now counts as a file write in a check whose files:

- use `with`, or name `eval`, `Function`, `evalFile` or `constructor`,
  as a word or as a string literal in brackets (`this['eval'](s)`,
  `$['evalFile'](f)`, `(function () {}).constructor(s)`)
- read, call or assign a property in brackets when the brackets hold
  anything but one string or number literal (`this[k](s)`,
  `this['ev' + 'al'](s)`, `this[('eval')](s)`, `this[0, 'eval'](s)`,
  `$[k](f)`, `g[k] = ...`), including a preprocessor line inside the
  brackets
- assign a property in brackets whose name is a string literal longer
  than 256 characters, or properties of more than 1,000 names
- assign or declare `Folder`

A variable whose name a member assignment writes (`$.global.d = ...`,
`this.d = ...`, `this['d'] = ...`) counts as one that may hold a File
object. Array literals, `o['plain']` and `a[0]` leave the Folder alone.

docs/mcp.md and the progress line in docs/target-app-parity.md state the
rule.
2026-11-23 09:54:50 -08: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 <[email protected]>
Co-authored-by: skylartaylor <[email protected]>
2026-11-22 18:18:18 -06:00
dotCooCoo a704798119 Scripts: printer jobs count pages from the art as it prints, and app['open'] gives a document
- Document.print to a printer no longer counts pages with print.preview,
  which leaves out artboard backgrounds and placed files. It passes
  file.print a new maxPages param: file.print counts the pages of the art
  it prints and composes nothing when the job has more, answering
  {pages, format}. An artboard that holds only its background now prints
  with skipBlank, and a job turned away by the sheet limit is not
  composed. When the pages follow from the artboards alone, the count is
  checked before Print as Bitmap or a flattener preset prepares the art,
  after the level and the flattener preset are checked.
- The printers a run lists keep the system's default printer when it
  comes after the first 256 (it takes the last place), and a repeated
  name keeps a later default mark without a second entry.
- The script checker reads app['open'](f) as giving a document, as
  app.open(f) does, so a print of the variable that holds it counts as a
  file write.
- The print job test checks the artwork in each prepared job, not only
  that the two jobs differ.

Docs: docs/mcp.md (maxPages, the page count, the default printer),
docs/roadmap.md M13 row.
2026-11-22 02:39:54 -08:00
dotCooCoo 619ccb2a34 Merge feat/scripts-api-d10-print-options into feat/scripts-print-printer 2026-11-22 01:08:19 -08:00
dotCooCoo 058d83c8c7 Scripts: a script's print jobs are sent only after a deliberate Print press
The question before a script's print jobs are sent no longer has a
default button. Enter does nothing; the jobs are sent only after the
person clicks Print, or presses Space once Tab has moved the focus to
it. Print takes no click or focus for one second after the dialog is
first drawn (VectorCraft's own value, on the app's clock), and the
dialog does not open while a text field or text on the canvas has the
keyboard. ui.dialog.confirm and synthetic input stay refused. Cancel,
Escape and ui.dialog.cancel drop the jobs.

File.hidden: the setter stores the new path with set_path, which the
merge of main requires.

Docs: docs/mcp.md, docs/target-app-parity.md.
2026-11-22 00:00:19 -08:00
dotCooCoo 141dc48e1a Scripts: addDocument and addDocumentNoUI count for print, docs name the preset base
The script checker reports `print` on a document that `documents.addDocument()`
or `documents.addDocumentNoUI()` returns, with or without `app.`, as a file
write, as it does for `documents.add()`. Both methods return a Document on the
Documents help page.

docs/mcp.md and the print module's notes say that with `printPreset` assigned,
`print` starts from the preset's settings: an assigned `artboardRange` replaces
that range, and an unassigned scale factor keeps the preset's value.
2026-11-21 22:25:50 -08:00
dotCooCoo 42409dc6ee Merge main into feat/scripts-api-d10-print-options
# Conflicts:
#	docs/mcp.md
2026-11-21 21:16:24 -08:00
dotCooCoo b28d5352d5 Merge feat/scripts-api-d1a-app-documents into feat/scripts-api-d10-print-options
# Conflicts:
#	crates/engine/src/script/dom.rs
#	crates/engine/tests/it/script_host_vs_scriptcheck.rs
2026-11-21 21:11:22 -08:00
dotCooCoo b2d458f667 Scripts: print lists in the host name check, applies range and print area over saved settings
- The host name check lists Document.print as a file write, and app's
  print lists, PrintOptions, its option classes and the printing
  enumerations as names that stay inside the run.
- The script checker reports a file write for print called on a
  document: app.activeDocument, app.documents[i], documents.add(),
  documents.getByName() and app.open(), or a variable that holds one.
  A print method of any other object is not reported.
- An assigned artboardRange without printAllArtboards replaces the saved
  range. An assigned printArea prints by artboard when the saved
  settings, or the preset's, ignore the artboards: the assigned range,
  or each artboard.
- The two scale factors are linked only when they are equal, as
  file.print compares them.
- The format follows the name jobOptions.file gives, also when that
  name is a link to a file with another extension.
- A print option name with a control character at either end throws.
2026-11-21 21:01:41 -08:00
dotCooCoo 8f4ecd4045 Merge main into feat/scripts-print-printer
# Conflicts:
#	docs/mcp.md
2026-11-21 20:52:42 -08:00
dotCooCoo b965a3ef1f Scripts: Document.print sends to a printer after the run and the person's approval, and app.printerList lists printers
Document.print without jobOptions.file now prints to the printer that
PrintOptions.printerName names, or to the default printer. A run started
in the app gets a bounded list of the print service's printer names
(at most 256, names up to 512 bytes, no control characters), and
app.printerList gives a Printer object for each. A name must match a
listed printer exactly.

print composes each job as a print-ready PDF and holds it until the
run ends. When the run's changes are kept, a dialog lists each job's
document, printer and pages, and only the person at the keyboard can
choose Print: ui.dialog.confirm and synthetic input are refused. Cancel
drops the jobs. A failed or stopped run sends nothing, and no job is
sent if one of its printers is no longer installed. A run prepares at
most 4 jobs, 100 pages and 32 MiB, and pages are counted before a job
is composed. The web, MCP and the command line cannot print to a
printer from a script.

Docs: docs/mcp.md, docs/target-app-parity.md.
2026-11-21 20:51:08 -08:00
BFlat db9acab4da Merge pull request #9004 from dotCooCoo/fix/retype-even-odd-turned-counters
Retype: a glyph in an even-odd compound matches with only some of its contours reversed
2026-11-22 11:38:53 +07:00
BFlat 90cd5eef57 Merge pull request #9016 from dotCooCoo/fix/dynamic-symbol-part-selection-paint
Symbols: Direct Selection picks a dynamic instance's part where its fill and stroke effects draw it
2026-11-22 11:38:33 +07:00
BFlat f03d04b91b Merge pull request #8996 from dotCooCoo/fix/simplify-smooth-keep-closed-start
Paths: Object > Path > Simplify and Smooth keep a closed path's start
2026-11-22 11:38:13 +07:00
BFlat 37610608f1 Merge pull request #8976 from dotCooCoo/fix/smooth-region-rejects-bad-params
Smooth: path.smoothRegion and path.joinScrub refuse a radius, fidelity or tolerance out of range
2026-11-22 11:37:54 +07:00
BFlat 1360f9ac6f Merge pull request #8961 from dotCooCoo/fix/safe-mode-expand-hidden-symbol-art
Expand Appearance: Safe Mode skips art that a group's raster image leaves out
2026-11-22 11:37:14 +07:00
BFlat 789f5033bb Merge pull request #8954 from dotCooCoo/fix/params-textedit-rest
Type: text commands refuse a parameter of the wrong type
2026-11-22 11:36:54 +07:00
BFlat 55064f7f59 Merge pull request #8949 from dotCooCoo/feat/dimension-drag-reposition
Dimension tool: a drag from a dimension already drawn moves it
2026-11-22 11:36:34 +07:00
BFlat 1cf0a2806a Merge pull request #9045 from dotCooCoo/feat/quick-pen-arc-protractor-i9314
Pen: Quick Pen shows a protractor around an arc's center and snaps to its ticks
2026-11-22 10:54:06 +07:00
BFlat 7ad52eacb8 Merge pull request #9017 from dotCooCoo/fix/test262-runner-coverage
Tests: the test262 runner parses and runs the Annex B tests
2026-11-22 10:53:45 +07:00
BFlat f658b42bc6 Merge pull request #9013 from dotCooCoo/feat/psd-invert-threshold-posterize-layers
PSD import: apply Invert, Threshold and Posterize adjustment layers
2026-11-22 10:53:23 +07:00
BFlat 0aa2601eb9 Merge pull request #8995 from dotCooCoo/fix/3d-expand-inflate-bevel-twist-curves
3D: Expand Appearance keeps curves on Inflate faces, interior bevel edges and twist cuts
2026-11-22 10:53:03 +07:00
BFlat 980bd43e34 Merge pull request #8979 from dotCooCoo/fix/smooth-never-rougher
Smooth: a drag that reaches only a sliver of the next segment no longer splits it
2026-11-22 10:52:20 +07:00
BFlat 8f27f7c4ba Merge pull request #8978 from dotCooCoo/fix/unembed-keeps-current-mask
Links: Unembed leaves a released or edited clipping mask as it is
2026-11-22 10:51:59 +07:00
BFlat e6e376e1ca Merge pull request #8974 from dotCooCoo/fix/sample-color-stop-of-given-objects
Eyedropper: sampling into a stop of given objects reads their gradient
2026-11-22 10:51:39 +07:00
BFlat 1de9ad593c Merge pull request #8973 from dotCooCoo/fix/eps-freeform-plate-cells
Print: an overprinting freeform gradient leaves out the cells its plate samples write without ink
2026-11-22 10:51:19 +07:00
BFlat 0882bd3850 Merge pull request #8970 from dotCooCoo/fix/image-quad-malformed-corner
Native file: a distorted image with a malformed saved corner opens placed by its transform
2026-11-22 10:50:58 +07:00
BFlat 4cea62ceee Merge pull request #8969 from dotCooCoo/fix/live-paint-bucket-freeform-points
Live Paint: freeform point edits without a target leave the selection alone under the bucket
2026-11-22 10:50:38 +07:00
BFlat 6767fefb11 Merge pull request #8968 from dotCooCoo/feat/script-file-hidden-create-alias
Scripts: File.hidden can be set and File.createAlias makes a link within the grants
2026-11-22 10:50:17 +07:00
BFlat ce062ce2a5 Merge pull request #8966 from dotCooCoo/fix/pattern-commands-unknown-ids
Patterns: pattern and Repeat commands refuse an ids entry that names no object
2026-11-22 10:49:36 +07:00
BFlat c2e1e28f87 Merge pull request #8958 from dotCooCoo/fix/duplicate-item-aligned-to-identical
Appearance: aligned copies go to `to` when the stacks are the same
2026-11-22 10:49:15 +07:00
BFlat 467261f531 Merge pull request #8957 from dotCooCoo/feat/plugin-storage-fuel
Plug-ins: storage calls pay instructions for the bytes they move
2026-11-22 10:48:55 +07:00
BFlat 6ba9e7ab0a Merge pull request #8956 from dotCooCoo/fix/curvature-circle-skip-on-selection
Shapes: the Curvature Circle tool reaches its circles again after Deselect
2026-11-22 10:48:35 +07:00
BFlat bbf17b4daf Merge pull request #8955 from dotCooCoo/fix/save-for-web-fixed-palette-clear-slot
Save for Web: a Custom table keeps shifted and locked colors first, and 255 opaque colors beside transparent pixels
2026-11-22 10:48:14 +07:00
BFlat a79fab35fe Merge pull request #8945 from dotCooCoo/fix/scriptcheck-folder-ambiguity
Script checker: setting length, hidden or readonly on new Folder(...) or a Folder place is not a file write
2026-11-22 10:47:33 +07:00
BFlat 27e413fda5 Merge pull request #8936 from dotCooCoo/fix/dimension-level-snap-checks
Dimension tool: a line at a slight angle or past the distance limit is not a level
2026-11-22 10:46:51 +07:00
BFlat b288f27bd8 Merge pull request #8930 from dotCooCoo/fix/flare-lone-x2-y2-error
Flare: a lone x2 or y2 in shape.flare is an error
2026-11-22 10:46:31 +07:00
BFlat b3c83f75ba Merge pull request #8923 from dotCooCoo/fix/library-pattern-color-copies
Swatch libraries: repeated adds reuse numbered colors, and tints link to a color of their kind
2026-11-22 10:45:30 +07:00
dotCooCoo 1b429b586e Scripts: Document.print prints to a file with PrintOptions and its option classes
Document.print(options) writes the file jobOptions.file names, checked as
saveAs checks its file: PostScript when the name ends with .ps or
postScriptLevel is assigned, a print-ready PDF otherwise. Only the
properties a script assigns are sent to file.print over the document's
saved print settings, which stay as they are, and no undo step is added.
Without a file it throws, since printing to a printer is not available
to scripts yet.

- new PrintOptions() and its nine option classes read as their help
  pages' defaults until assigned, and a PrintOptions holds its option
  objects by reference. Each value is checked when it is assigned.
- Preset, profile and paper names must name an existing preset, an RGB
  or CMYK profile or a known paper; an empty name or one holding a path
  separator or control character throws. An artboardRange naming a
  missing artboard throws before anything is written.
- Options and values that are not mapped throw an error that says they
  are not available yet. printerName and PPDName take only "".
- app.printPresetsList lists the print presets, app.PPDFileList is
  empty, and the print enumerations are published.
- Each warning file.print gives goes to the Script Console.
- vc.run still cannot run file.print or print.*.
- A hosted File given to or returned by a member stays a File.

Help pages: https://ai-scripting.docsforadobe.dev/jsobjref/PrintOptions/
and the option class pages beside it.
2026-11-21 18:31:30 -08:00
dotCooCoo abe8b303de Scripts: remove and removeAll keep art on a locked artboard
PageItem.remove() and PageItems.removeAll() checked only whether the
object and its layers and groups were shown and unlocked, then passed the
ids to edit.clear, which deletes named objects without checking artboard
locks. Both now throw "cannot delete objects on a locked artboard" with
the object ids and delete nothing, as art on a locked artboard is not
editable elsewhere in the document.
2026-11-21 18:14:01 -08:00
dotCooCoo d14830b6b7 Scripts: saveAs and exportFile refuse a file open for writing and scales under 1%
A save or export to a file that a File object holds open for writing throws "Script file is open for writing", and a command the script runs does not write such a file besides the one named (an SVG's images), so the bytes the File writes at the end of the run do not replace the output. horizontalScale and verticalScale take 1 to 776.19, since a raster export writes at least 0.01 pixels per point.

The script checker reports a document's saveAs and exportFile as file writes, and the host name check lists the save, export and open names, option classes and enumerations.
2026-11-21 17:36:55 -08:00
dotCooCoo ff26d5e4a3 Swatch libraries: colors a pattern brings skip the library's other names
A global or spot color that a library pattern's art brings under a
numbered name no longer takes a name the library gives another swatch.
Before, adding a pattern whose art uses "Ink" to a document with another
"Ink" brought the color as "Ink 2" even when the library has its own
"Ink 2"; adding that library swatch next then came in as "Ink 2 2". The
brought color now takes the next free name the library does not use
("Ink 3"), and every paint linked to it follows the new name, so adding
the library's "Ink 2" next adds it under its own name and adding both
again adds nothing.

A color the pattern's art brings or takes is the color a library tint
or gradient links to only when it has the library color's paint and its
process, global or spot kind, as for the other lookups in the same add.

The test a_numbered_copy_named_like_another_library_color_is_found now
makes the blue "Ink 2" itself, as an earlier version's pattern add left
it, since a pattern add no longer gives that name.
2026-11-21 15:38:19 -08:00
dotCooCoo 5cb6480258 Scripts: assigning PageItem.selected keeps how the other objects are selected
Setting selected to true or false runs select.add or select.toggle for that one object, so the
other objects keep their direct-selected anchors and segments and the key object. Before, it
replaced the selection with whole objects.
2026-11-21 14:53:28 -08:00
dotCooCoo ac28d0b6ba Pen: Alt tapped during a Quick Pen press moves the end on or off the tick at once
A press keeps the pointer and the snapped point for the end of the piece it adds. When Alt
changes the action during the press, the end goes through the protractor's tick again for the
new action, so a continuous arc that snapped to a tick and becomes a sharp-corner arc ends at the
pointer, and a piece that becomes a continuous arc goes onto the tick, without waiting for the
next drag. This also covers a press that has not dragged.
2026-11-21 14:41:30 -08:00
dotCooCoo ba0441c458 Scripts: addDocument takes only a DocumentPreset and throws when its profile cannot be read
- new DocumentPreset() now makes an object of the DocumentPreset class whose settings the run
  keeps, so addDocument refuses a plain object, one with a typename of DocumentPreset included,
  with a TypeError naming presetSettings.
- When file.new reports a profileError, addDocument throws an error that names the profile and
  the reason, and the document made with the defaults is put back.
- A script's file.new reads the New Document profile file in the app's own profiles folder;
  the automation roots in force still apply. Before, the script's file gate refused the folder,
  so a scripted addDocument never used an edited profile.

Docs: docs/mcp.md.
2026-11-21 14:33:43 -08:00
dotCooCoo 55f7dc9205 Scripts: Document.saveAs, Document.exportFile and app.open with option classes
Scripts save, export and open documents through Document.saveAs,
Document.exportFile and app.open, with IllustratorSaveOptions,
EPSSaveOptions, PDFSaveOptions, ExportOptionsPNG24, ExportOptionsJPEG,
ExportOptionsSVG and a PDFFileOptions record, the ExportType and related
enumerations, and app.userInteractionLevel. Each method runs file.saveAs,
document.export or document.open inside the run's transaction.

- A File argument reaches the host as its path only when the File class
  made it: the path is held in an internal slot that scripts cannot set,
  and a plain object that imitates a File is refused.
- Each path is checked as a File opened for reading or writing would be,
  before the command runs, and the command's own reads and writes are then
  held to the script's grants, leaving out the open documents' files.
  A read-only file is not written over.
- Options a command maps are applied; a listed option that is not mapped
  is accepted only at its documented default, and any other value, a bad
  type or an out-of-range number throws before anything is written.
  Without options, saveAs to a .ai, .eps or .pdf path and exportFile as
  PNG24, JPEG or SVG use the defaults a new options object holds. With
  pDFPreset named, a PDFSaveOptions option still at its default keeps the
  preset's value. A raster export at 100% has one pixel per point.
- An export or save that writes several files, such as an SVG that writes
  its embedded images beside it or an EPS with a file per artboard, checks
  every path before writing the first.

Docs: docs/mcp.md, docs/target-app-parity.md.
2026-11-21 13:51:09 -08:00
dotCooCoo a99702361a Pen: Quick Pen snaps no first continuous arc to a tick and hides a stale hover
A continuous arc that starts a path has no direction to follow and
sweeps the arc size, as a sharp-corner arc does. Moving its end onto a
protractor tick put the end on a circle the drawn arc does not follow,
so `tick_end` now gives no tick for it.

The hover keeps the snap settings it was made with (`SnapSettings` in
guides/snap.rs: the window, zoom, snapping options, tolerances,
Alignment Guides and construction angles). After one of them changes
under a still pointer, the hover's rubber band, protractor, distance
label and Smart Guides are hidden until the pointer moves, also through
a press, so the preview shows no point that a click would not place.
A press also drops the hover, so after a click puts an arc's end on a
tick no preview runs from that end back to the pointer. While the
pointer hovers, the tool asks the canvas to hover it again when the
view, the document or the selection changes (`wants_rehover`).
2026-11-21 13:27:49 -08:00
dotCooCoo f33e0cb16d Scripts: PageItem.remove refuses hidden or locked art as removeAll does
remove() on an object that is hidden or locked, sits in a hidden or locked layer or group, or is a group holding such an object now throws and deletes nothing, the same rule pageItems.removeAll() applies. docs/mcp.md states both rules and that width and height scale along the page's axes.
2026-11-21 12:37:34 -08:00
dotCooCoo fa3c5af490 Docs: when a group's mask, or a clipping base's, hides all of it on PSD import 2026-11-21 12:37:12 -08:00