vectorcraft/crates/pdf/src
dotCooCoo d9bd9b134d Symbols: instances of imported symbols are measured by their art
Every symbol instance was measured as its transform applied to the
20 × 20 square around the origin, which symbols made in the app keep
their art in. The SVG and DXF importers keep symbol art as drawn, so
the box of an instance of an imported symbol did not match its art.
The SVG Star instance at x 20, y 30 draws from (20, 30) to (40, 50)
and was measured from (10, 20) to (30, 40). Align moved such an
instance by the wrong amount, clicks and marquees beside its art
selected it, and the canvas, exports and prints left it out when its
art reached the view or the page and the square did not.

An instance is now measured by its symbol's art, which
Document::symbol_boxes looks up in the document each time
(Node::geometric_bounds_with, visual_bounds_with and
reach_bounds_with). With Use Preview Bounds on, the strokes in the art
count at their own weight, as the canvas draws them, and
object.setBounds counts them at that weight when it sizes an instance
or an object that holds one. When strokes do not scale and a width or
height of 0 or more is smaller than what a path's stroke adds,
object.setBounds now gives the path no width or height, as it does
for an instance whose art has strokes; before, it mirrored the path.
With Use Preview Bounds on, object.setBounds now measures the margins
that strokes add object by object, the members of groups and the
objects in symbol instances' art included, and solves for the width,
height and reference point asked for when the width and height are 0
or more. Before, it measured the margins of the whole selection and
could miss the size or the reference point asked for when strokes did
not scale and the objects' strokes added different margins, and when
strokes scaled and the width and height were out of proportion, even
for one path. A clip group, a Shaper Group, a compound path, type, and
a group or instance with effects or an opacity mask of its own are each
measured as one object, and so is an instance in perspective or one
turned or slanted relative to the bounding box, other than by quarter
turns. When the selection holds more than 4,096 objects to measure this
way, each selected object is measured as one. Instances inside symbol
art are measured by their own symbol's art. An instance is measured as
the square when its symbol is missing, when its symbol or a symbol
nested in its art holds an instance of itself, and when symbols nest 32
deep in its art.

Align and Distribute, the Transform panel, the bounding box and the
selection outline, clicks, the marquee, document.inspect and
document.node, Fit to Artwork Bounds and Fit to Selected Art, canvas
culling, thumbnails, the SVG filter region of an instance with a
raster effect, raster effect images, Export Selection, the SVG of an
artboard, printing, and the PDF, EPS, EMF/WMF and DXF writers use the
new box. The renderer also culls an instance by the effects and
brushed strokes in its art, and it culls a blend, envelope or repeat
by the brush art of what it holds and the effects in the art of the
instances in it. It culls an instance with geometry effects of its own
by the effects in its art after those geometry effects reshape the art.
It measures the effects in a symbol's art once for each symbol and
linear part of the transform that places it. For symbols whose art
holds instances, it measures at most 4,096 placements a frame, and at
most 4,096 more for each pattern tile it rasterizes and each placed
document it draws. Past that, it estimates the reach from the symbol's
reach with no transform, which it measures once. When the drawn
document's symbols change, the renderer drops the cached bounds of the
instances and of the objects that hold them.

The PDF and EPS writers, the SVG of an artboard and Skip Blank
Artboards grow the box of an instance whose art holds brushed strokes
by 16 times the widest stroke (at least 1 pt) of the objects in that
art that have a brushed stroke, plus 8 pt, as the renderer grows the
cull bounds of a brushed path. They keep an instance whose brush art
reaches the page. The SVG of an artboard also keeps an object that
holds an instance when what the canvas paints for it, the effects in
the symbol's art and the instance's own included, reaches the artboard.

Not yet: other commands that measure objects, such as Select › All on
Active Artboard, Transform Each and Convert to Artboards, still measure
an instance by the square.

Docs: docs/mcp.md, docs/target-app-parity.md.
2026-10-14 04:56:30 +07:00
..
print Symbols: instances of imported symbols are measured by their art 2026-10-14 04:56:30 +07:00
editing.rs Search each shared name tree node once when finding the editing file (#1702) 2026-10-13 18:22:14 +02:00
encrypt.rs Lint: as_chunks for constant chunk sizes, as clippy 1.99 asks 2026-10-05 12:14:56 -07:00
export.rs Symbols: instances of imported symbols are measured by their art 2026-10-14 04:56:30 +07:00
forms.rs Part of #372: .ai files write layers and sublayers as PDF layers, hidden ones kept 2026-10-09 04:40:30 +07:00
images.rs Fix #320: CMYK images stay CMYK from PDF import to PDF export 2026-10-08 06:04:07 +07:00
import.rs PDF import: a held glyph stroke takes its turn in the page's overprint list 2026-10-13 11:53:38 +07:00
import_color.rs PDF import: an editor's .ai keeps its RGB numbers, and a fill faded or masked by its group keeps its stroke apart 2026-10-12 23:06:19 +07:00
import_image.rs PDF import: masked CMYK images stay CMYK, their mask an opacity mask 2026-10-09 17:11:34 +13:00
import_lines.rs #1244: smaller objects: Node 352 -> 152 bytes, NodeKind 200 -> 80, and a cheaper undo estimate 2026-10-12 11:02:32 +07:00
import_mask.rs #1244: smaller objects: Node 352 -> 152 bytes, NodeKind 200 -> 80, and a cheaper undo estimate 2026-10-12 11:02:32 +07:00
import_scan.rs Fix #1388: PDF import keeps overprint 2026-10-12 19:50:53 +07:00
import_shading.rs PDF import: gradient-filled shapes open as one path, not a clipped rectangle (#1304) 2026-10-12 14:49:59 +07:00
import_text.rs PDF/.ai import: type stroked glyph by glyph stays one object 2026-10-13 11:53:38 +07:00
lab_spot.rs M4.73: PDF colour conversion, ICC profiles and output intent 2026-10-05 16:25:20 +07:00
lib.rs PDF import: an editor's .ai keeps its RGB numbers, and a fill faded or masked by its group keeps its stroke apart 2026-10-12 23:06:19 +07:00
linearize.rs M4.86: PDF page thumbnails and fast web view (linearised files) 2026-10-05 18:05:36 +07:00
marks.rs M4.75: File → Print writes the job as a print-ready PDF: paper, scale, tiles, marks and bleed, separations 2026-10-05 15:13:10 +07:00
output.rs Colour: ICC CMYK converts straight into the RGB profile, with black-point compensation 2026-10-09 17:11:34 +13:00
pages.rs Fix #1387: a .ai whose PDF part is only text opens from it 2026-10-12 19:50:53 +07:00
patch.rs M4.86: PDF page thumbnails and fast web view (linearised files) 2026-10-05 18:05:36 +07:00
pdfx.rs M4.87: PDF 1.3 compatibility: transparency flattened with the chosen preset 2026-10-05 18:05:36 +07:00
post.rs M4.87: PDF 1.3 compatibility: transparency flattened with the chosen preset 2026-10-05 18:05:36 +07:00
presets.rs M4.87: PDF 1.3 compatibility: transparency flattened with the chosen preset 2026-10-05 18:05:36 +07:00
settings.rs Fix #733: PDF export keeps type as text in embedded subset fonts 2026-10-09 18:06:38 +07:00
syntax.rs M4.86: PDF page thumbnails and fast web view (linearised files) 2026-10-05 18:05:36 +07:00
tests.rs Symbols: instances of imported symbols are measured by their art 2026-10-14 04:56:30 +07:00
tests_blend.rs M4.31: Save PDF dialog and document.exportPdf with PDF settings 2026-10-05 07:22:27 +07:00
tests_charstroke.rs M3.40: stroke on type — the Stroke panel edits the characters' stroke 2026-10-05 01:09:55 +07:00
tests_cmykblend.rs Part of #1286: constant alpha masks are drawn white, so the page shows where soft masks are read by luminosity 2026-10-12 14:00:37 +07:00
tests_cmykimages.rs #1244: smaller objects: Node 352 -> 152 bytes, NodeKind 200 -> 80, and a cheaper undo estimate 2026-10-12 11:02:32 +07:00
tests_compression.rs #1244: smaller objects: Node 352 -> 152 bytes, NodeKind 200 -> 80, and a cheaper undo estimate 2026-10-12 11:02:32 +07:00
tests_dashalign.rs M3.68: groups, layers and type have their own fills, strokes and effects, with Contents and Characters rows 2026-10-05 00:59:34 +07:00
tests_editing.rs Search each shared name tree node once when finding the editing file (#1702) 2026-10-13 18:22:14 +02:00
tests_encrypt.rs M4.84: PDF/X-1a, PDF/X-3 and PDF/X-4 files written as their standards say 2026-10-05 17:19:11 +07:00
tests_focal.rs M3.98: radial annotator extent ellipse, aspect handle and off-centre focal point 2026-10-05 04:43:43 +07:00
tests_fx.rs M3.43: effects render on type, placed images, symbol instances, blends, envelopes, meshes and repeats; a fill or stroke's own raster effects render and export as SVG filters on that element 2026-10-04 23:15:13 +07:00
tests_import_color.rs PDF import: an editor's .ai keeps its RGB numbers, and a fill faded or masked by its group keeps its stroke apart 2026-10-12 23:06:19 +07:00
tests_import_fidelity.rs PDF/EPS import: a clip only counts as covering the page when it does 2026-10-13 08:51:40 +07:00
tests_import_layers.rs Part of #868: PDFs saved with the reference app's editing data open from it, as .ai files do 2026-10-12 14:50:00 +07:00
tests_import_lines.rs PDF/.ai import: type stroked glyph by glyph stays one object 2026-10-13 11:53:38 +07:00
tests_import_options.rs .ai import: a page's art past its artboard no longer lies over the page before it 2026-10-13 06:56:37 +07:00
tests_import_overprint.rs Fix #1388: PDF import keeps overprint 2026-10-12 19:50:53 +07:00
tests_layers.rs Fix #733: PDF export keeps type as text in embedded subset fonts 2026-10-09 18:06:38 +07:00
tests_live_text.rs Fix #1388: PDF import keeps overprint 2026-10-12 19:50:53 +07:00
tests_marks.rs M4.72: PDF export draws printer's marks in Registration around each page 2026-10-05 13:05:20 +07:00
tests_output.rs #1244: smaller objects: Node 352 -> 152 bytes, NodeKind 200 -> 80, and a cheaper undo estimate 2026-10-12 11:02:32 +07:00
tests_pdf13.rs M4.87: PDF 1.3 compatibility: transparency flattened with the chosen preset 2026-10-05 18:05:36 +07:00
tests_pdfx.rs #1244: smaller objects: Node 352 -> 152 bytes, NodeKind 200 -> 80, and a cheaper undo estimate 2026-10-12 11:02:32 +07:00
tests_presets.rs M4.84: PDF/X-1a, PDF/X-3 and PDF/X-4 files written as their standards say 2026-10-05 17:19:11 +07:00
tests_print.rs Symbols: instances of imported symbols are measured by their art 2026-10-14 04:56:30 +07:00
tests_printadvanced.rs M4.83: overprinting fills and strokes overprint in PDF 2026-10-05 17:39:28 +07:00
tests_realtext.rs PDF/.ai import: evenly tracked type on a path keeps its length 2026-10-13 11:53:38 +07:00
tests_settings.rs Fix #733: PDF export keeps type as text in embedded subset fonts 2026-10-09 18:06:38 +07:00
tests_stroke.rs M3.68: groups, layers and type have their own fills, strokes and effects, with Contents and Characters rows 2026-10-05 00:59:34 +07:00
tests_strokeout.rs M3.68: groups, layers and type have their own fills, strokes and effects, with Contents and Characters rows 2026-10-05 00:59:34 +07:00
tests_textstroke.rs M4.59: pattern strokes and freeform gradients keep their look in PDF 2026-10-05 11:52:35 +07:00
tests_webview.rs #1244: smaller objects: Node 352 -> 152 bytes, NodeKind 200 -> 80, and a cheaper undo estimate 2026-10-12 11:02:32 +07:00