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.
* 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]>
- 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.
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.
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.
- 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.
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.
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.
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.
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.
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.
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.
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.
- 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.
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.
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`).
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.