DXF export with Use Artboards baked the whole document's live effects
and placed symbol art again for every artboard. export_drawings now
checks the options and every region, bakes once, and writes each
drawing from the same baked document. export calls it with one drawing,
and the encoder makes one call for all the chosen artboards. Each
drawing's bytes, linked images, warnings and setting notes are the same
as before; the tests compare them with drawings baked one at a time.
action.batch refused a bad step before any file opened as `commands[i]`,
counted from 0, while a step that failed as it ran was named
`action step N (`id`)`, counted from 1. A step whose params its command
refused gave only the command's own error, without saying which step it
was.
- The checks before the batch (no command, an unknown command, a nested
batch, prefs.import) now name the step as `action step N (`id`) failed:`,
from 1, as the runtime errors do. A long unknown id is cut short in the
message, as an unknown key is.
- The parameter check names the action.batch step whose params it
refuses the same way. command.batch keeps passing the step's error on
as it is.
- Override Open matches only document.open, and Override Save only
document.save and file.saveAs: file.open, file.save and document.close
are not engine commands, and a step with one is refused as unknown.
The params text no longer lists them, and docs/mcp.md says a step with
file.open or file.save is refused as an unknown command.
An EMF or WMF export with Use Artboards applied the document's live
effects (geometry effects, and symbol art with effects) once for each
chosen artboard. vectorcraft_metafile::export_regions now checks every
region, applies the effects once and writes one metafile per region.
export is its one-region case, and the engine's encode calls
export_regions once for all chosen artboards. Each file's bytes and
warnings are unchanged.
File > Open's Import PDF dialog now starts with Import PDF pages as links
checked for All, so every page of a PDF opened from its file opens
linked, and clears the box when Range is picked, so a range opens as
art. A box checked or cleared by hand keeps that state until the other
of All and Range is picked; ui.dialog.set of allPages does the same.
The box stays clear for a file without its path, with a password, or
over the 256 MB that linkPages takes (fileio::pages_can_link).
Docs: docs/mcp.md, docs/target-app-parity.md, docs/file-format-parity.md.
A PDF/X-3 or PDF/X-4 export tagged every CMYK color with an ICC-based
space of the same profile that the output intent embeds. In PDF/X-3 and PDF/X-4, CMYK colors in the
profile of a CMYK output intent are now DeviceCMYK, and the profile is
written once, as the output intent's DestOutputProfile (ISO 32000-1,
14.11.5:
https://opensource.adobe.com/dc-acrobat-sdk-docs/pdfstandards/PDF32000_2008.pdf#page=641).
- With output.profiles none and a CMYK output intent, PDF/X-3 and PDF/X-4
write every CMYK color as DeviceCMYK, unless colors are converted to a
CMYK destination of another profile, which keeps its tag. Before, those
standards tagged every color whatever profiles said.
- RGB and gray colors stay tagged, and so do CMYK colors and images in
another profile.
- A CMYK image that carries the output intent's profile is DeviceCMYK,
and so is every CMYK image when none makes CMYK colors DeviceCMYK. A
CMYK JPEG then loses its ICC_PROFILE segments.
- Transparency groups blend in DeviceCMYK when CMYK colors are
DeviceCMYK, also when the file has no ICC-based CMYK space.
- Files without a standard keep the tags that profiles asks for.
- The Save PDF dialog's note for PDF/X-3 and PDF/X-4 says that CMYK
colors in the output intent's profile are written as DeviceCMYK.
Docs: docs/mcp.md, docs/target-app-parity.md and the document.exportPdf
params text.
The reader also counts pattern brushes, a pen's included, whose bitmap
it could not read, so the warning now says "image or pattern brush".
The document.open and clipboard.importEmf params text, docs/mcp.md and
the crate doc list the new warnings. A WMF test covers an unreadable
pattern brush and a DSTINVERT bit block transfer.
WebP Options has a Compression menu (Lossless, Lossy) and a Quality
slider from 0 to 100 that is enabled for Lossy. document.export,
document.serialize and Export for Screens take lossless: false with
quality (default 90) and write a VP8 file, with an ALPH chunk that keeps
the alpha exactly when some pixels are not opaque. Lossless stays the
default. A WebP quality above 100, or one that is not a whole number,
is refused with an error.
The encoder is the one craft-image-codecs already provides; no
dependency changes. The note that lossy WebP isn't available, its
catalog rows and the format text that described it are removed.
Under Include Bleed, a PDF row that sets no bleed now keeps the bleed values a saved PDF preset writes out and turns on useDocument, instead of replacing the whole bleed object. Its file key then matches a row of the same preset that asks for the document's bleed, so the two rows write one PDF.
The export walks for type and fonts and the artboard crop shared one
SymbolBoxes for every object. A SymbolBoxes also holds measuring budgets
(effect reaches, 9-slice placements), so in a large document objects late
in a walk could be measured by estimates where main measured them exactly.
SymbolBoxes::unmeasured makes new boxes that share the name index, and each
object is measured in boxes of its own again.
- The live-object walk (render/src/live.rs) finds symbols through the
frame's SymbolBoxes.
- SVG export's filter regions measure each object in unmeasured boxes, and
the region boxes share the writer's index.
- SVG import keeps each imported symbol's index, so a symbol whose art
holds instances no longer scans or indexes the list again.
- Object › Rasterize's clipping mask is left as it is on main, with
drawn_outline_with removed.
- The symbol-read-count feature of vectorcraft-doc gives other crates'
tests vectorcraft_doc::symbols_read. New tests check that a frame, an SVG
export, a PDF export, the type walk and the artboard crop read the symbol
list once among 2,000 symbols and 300 instances with drop shadows.
When the import refuses a file's PDF part and its editing data can't be
read either, the error named only the PDF part. It now adds "its editing
data couldn't be read either (<why>)", as layers already do
(crates/eps/src/import.rs). The reasons come from the editing data
reader (a size limit, damaged compression) and from the private data
streams (larger than 256 MB, another filter or decode parameters,
damaged zlib data). A file without editing data, and an open with pages
picked, layers off or the editing data off, keep the PDF part's error.
Part of #4366.
Drawing or exporting a symbol instance looked its symbol up by scanning
the document's symbol list, so a document with many instances and many
symbols spent most of a frame or an export on name comparisons. The
renderer, the SVG and PDF writers and the export walks now find symbols
through SymbolBoxes::symbol, which builds the name index once per frame,
export or walk and returns the first symbol of a name as before.
- Renderer: plain instances, inline graphics, instances with object
effects (their art and the symbol budget) and the effect bounds.
- SVG export: instance art, symbol defs and their reuse check, and the
paint reach of filter regions.
- PDF export: instance art, inline graphics and the brush search of
knockout masks.
- Export warnings and artboard crops measured what each object paints
with new symbol boxes per object, which built the name index again for
every instance. painted_bounds_with and drawn_outline_with take the
boxes once; Object › Rasterize's clipping mask uses them too.
With `pdfs: "single"` and several assets, layers or selected objects
(`selection: "each"`), document.exportForScreens wrote one PDF named
after the document holding only the first item's art, and every other
item's PDF was left out. Single file puts artboards on the pages of one
PDF; each asset, layer or object is cut out of the document with its own
art, so the export now refuses that combination before it writes any
file, and the Example line refuses it too. `pdfs: "multiple"` still
writes a PDF of each item, and `selection: "one"` writes one PDF either
way.
Docs: params text, docs/mcp.md, docs/target-app-parity.md.
With Export PDFs As set to a single file, a PDF row writes the first
item's document alone. The check for linked images outside the read
roots now looks only at that document, so an image linked in a later
asset no longer refuses a file that does not carry it.
Under automation read roots, every output that carries the native document
(a native file or template, an EPS file, a .ai or .ait file of every
artboard, a PDF of every artboard with Preserve Editing, from
document.serialize, document.export, document.exportSelection,
document.exportPdf, the saves, file.exportAs and Export for Screens rows)
is refused with "a linked image file is outside the read roots" when that
document names a linked image or placed file, a kept relative path or a
data set's image outside the roots, or holds a stored brush entry that
does not read as a brush. Nothing is written and the error names no file
or folder. Outputs without the native document are written as before.
The native document these files carry, and the documents file.package
writes or rewrites, leave out an Export for Screens folder outside the
read roots, as SVG with Preserve Editing already did. file.package refuses
a linked file it copies as it is (a PDF, .ai or EPS file, or a native
document with relink off) whose native document keeps such a folder, with
"a linked file's export folder is outside the read roots".
Export for Screens rows that write one artboard as a native, .ai or EPS
file are checked against that artboard's art. Each asset, layer or
selected object now writes its own native, .ai or EPS file: the per-artboard
document cache was keyed by artboard index alone, so every piece after the
first wrote the first piece's document.
Both messages get rows in the complete-message catalogs.
- swatch.library.add lists a library pattern swatch that stands for a
swatch added earlier in the same call under existing, not twice
under added.
- An empty library file (.gpl, .ase, .vcswatches) loads as an empty
library again; only a document with no swatches is refused. A
PostScript file whose swatches are only the default ones is refused
like a .ai or .eps.
- The Swatch Libraries filter of Other Library… also lists .ait and
.epsf files.
- The library panel finds a loaded library's pattern swatch by looking
only at libraries that have pattern swatches.
- The Czech message for Copy to User Defined names pattern swatches.
- Color spelling in the new params text and comments; docs/mcp.md
rewrapped.
A format row's file key was made before the top-level `antiAlias` was added to
its options, so a PDF row that sets no bleed and one that asks for the
document's bleed wrote two identical files under Include Bleed. The key is
now made again after the merge.
Swatches › Open Swatch Library › Other Library… read a document's
swatches without its pattern swatches, so a pattern from a .ai swatch
library came in only as the colors it uses.
- swatch.library.load keeps a document's pattern swatches, and keeps
the document for a library that has them. swatch.library.add brings
the pattern with its tile and art, as a pattern swatch with the
library swatch's name, placement and color group.
- The library panel draws those pattern swatches from their pattern.
- The Swatch Libraries filter of Other Library… lists .ai and .eps
files.
- A file with no swatches, and a .ai or .eps whose swatches are only
the default ones, are refused with "`<file>` has no swatches of its
own". Copy to User Defined refuses a loaded library with pattern
swatches, since a .vcswatches file can't hold them.
Docs: docs/mcp.md, docs/target-app-parity.md.
With Include Bleed, every artboard was grown by the document's bleed and
PDF rows were written from the grown artboard. A row that used the
document's bleed then put the bleed around it a second time: a 100 pt
artboard with a 9 pt bleed wrote a 118 pt TrimBox in a 136 pt BleedBox,
and printer's marks lined up with the bleed edge instead of the trim.
PDF rows now write the artboards as they are, with the row's bleed around
each one once (PDF 32000-1:2008, 14.11.2: the TrimBox is the finished
page and the BleedBox holds it). The bleed is the row's own values, zero
included, else the document's bleed when the row sets none and its PDF
preset gives none or a bleed of 0. That gives a 100 pt TrimBox in a
118 pt BleedBox for one file per artboard, a single file and the Full
Document. Raster, SVG, EPS, AI and native rows still write the grown
artboard.
A PDF/X row that sets a bleed of 0 itself warns again that it leaves the
document's bleed out. A row without a bleed and a row that asks for the
document's bleed write one file.