FontLikeness::distance left out every number either face does not give,
so a family whose faces give none of them (static faces with no OS/2 or
post table) was 0 from every family, and Show Similar Fonts could list
it right after the chosen family, as an exact match. Faces that share
no number to compare are now f32::INFINITY apart, so such a family
comes after every family of its script group that shares one, and
families equally far keep their order. The order of measured families
does not change. This is VectorCraft's own rule.
Builds on #7983, which added Show Similar Fonts.
path.split (Scissors) and path.cutAtAnchors (Cut Path at Selected
Anchor Points) keep the source path's fill and stroke settings on the
paths they make, and now set every stroke's alignment to Center in the
same undo step, as the help page describes:
https://helpx.adobe.com/illustrator/desktop/draw-shapes-and-paths/modify-paths/split-paths.html
Every stroke row is reset, hidden ones included. A path of several
subpaths has one appearance, so its other subpaths' strokes are
centered too, and a cut member of a compound path centers the compound
path's strokes. An appearance whose strokes are already centered is
left shared. Knife, the erasers and Divide are unchanged.
File > Place with Link (the default) now places an EPS file, a PostScript file or a PostScript .ai from a path as one locked placed document instead of an embedded group. It shows the art that placing without Link gives (clipped to the bounding box, or the art's bounds with crop: "bounding"). Links check, update and relink it, Break Link and Object > Expand give the Link-false group, a save keeps its preview, every output draws its vectors, and Package copies the file, also from the bytes the document holds when the file is gone. Links lists it as EPS or PostScript, also after a save that kept only its preview. A DCS file stays a linked image; Link off and dataBase64 still embed.
A line graph whose style record draws its lines as shapes now opens as a
live graph with Draw Filled Lines on, and its lineShapeWidth becomes the
Line Width (3 pt reads as the default). The flag is ignored when the
points are not connected, as the published file format specification
says (printed pp. 147-148). Saving writes both values in the Gy record.
- Widths from 0.01 to 100 pt are kept. A wider Line Width, a width under
0.01 pt with filled lines, and filled lines without connected points
are saved as the graph's art with the existing warning.
- In a filled-line series, a filled path with the thin black band
outline is read as a band and does not set the series stroke. A
filled path with another outline must be a square marker or legend
swatch; otherwise the graph keeps its art as plain objects.
- The reader in crates/eps/src/import/ai/read/graph.rs reads each value
the writer in crates/eps/src/ai_graph.rs writes; the save-then-open
tests cover the default, 8 pt and 150 pt widths in both .ai forms.
Pathfinder collected a clip group's members as if it were a plain group, so
Divide cut the hidden art too and the result lost the mask. Each member is
now cut to the group's clipping region first (nested clip groups by each
region in turn): its area is intersected with the region, and Divide's
cutting lines keep only their parts inside it. A member the mask hides gives
no piece, a group among other objects takes the style of its top member that
shows, and a selection the masks hide altogether is refused with a reason.
This applies to every object.pathfinder.* operation, which also covers Merge
on masked art (#3367).
A spiral dragged out with the Spiral tool now turns about its center so
that its outer end is at the pointer, so dragging around the center turns
it. A pointer within 0.01 pt of the center keeps the last direction. Alt,
Ctrl/Cmd, Up/Down, Space and Escape work as before, and Shift does not
change the direction.
With General > Constrain Angle other than 0 degrees or a whole turn, a
spiral placed from the Spiral dialog starts along the turned x axis, with
its bounding box turned.
shape.spiral takes an optional rotation (degrees clockwise about cx, cy).
Without it, or at 0 or a whole turn, spirals are drawn as before; a
rotation that is not a number is an error and adds nothing.
Expand Appearance expanded a group's or layer's evaluated members, and the
object of a Crop Marks effect, before giving them new ids. When the raster
budget refused the image for such a member that held a random Transform
effect, the member stayed unexpanded, but its new id gave that effect a new
seed, so the member moved while its effects stayed live.
The group, layer or Crop Marks object now stays as it is in that case, as
it does when its own raster effects go past the budget. The rollback also
removes the images its other members added to the document and gives their
charge back to the budget.
brush_targets checked each brushable node against every target it had
already collected, so P targets cost about P^2/2 comparisons. It now
keeps a HashSet of the ids it has pushed. The output vector is unchanged:
the same ids in the same walk order, each kept where it is first reached.
brush.apply, brush.remove, Expand on brushed paths and the brush library's
apply all collect their targets through it.
A unit test checks the exact result for guides, clipping paths, compound
members, nested compounds, repeated and overlapping roots and a missing
id, and compares it with a copy of the old collector.
Preferences > Plug-ins & Scratch Disks > Plug-in Instruction Budget
(`pluginInstructionBudget`) is a VectorCraft setting. Normal, the default,
keeps the limits a filter run has today. Large gives each object filter run
250 M instructions plus 4,000 per input byte, with the 60 s time budget, Cancel
and the other limits unchanged. An approved heavy filter keeps its 1 G and
300 s with either value; live effects, exporters and importers keep their own
budgets. The next run of an installed filter uses the value in force when the
run is prepared.
prefs.set refuses any value but normal or large; a saved preferences file
with another value reads as Normal and the other preferences load as saved.
Docs: docs/plugins.md, docs/mcp.md, docs/target-app-parity.md.
- With art in some of the group's colors, a second Save Changes after
another edit of a row kept the color the first save gave that row's
swatch, and OK gave the group's colors by row order, which could
overwrite a swatch no row lists. Both now match each swatch to its row,
also through the color that row listed when an earlier save gave the
swatch its color.
- An excluded row leaves its swatch its own color at Save Changes and at
OK, with or without art. `recolor.apply` takes "keep" in `groupColors`
for a swatch that keeps its color without the Global Adjust.
- `swatch.editGroup` given the color keys of the group's own colors keeps
those colors unrounded and records no undo step.
Object › Plug-ins › Packaging Tools › Check Fold Lines, and the Fold Lines
panel's Check button, check the fold lines of the selection, or of the
document while nothing is selected (`addon.packaging.check`).
- Cut lines bound the material: each connected piece that encloses an
area is one blank, its largest closed cut line is the outline, and a
closed cut line inside it is a hole. A slot drawn as a rectangle across
the outline leaves the same material as a notch drawn in it, and an
outline drawn as several open cut lines works too.
- Creases, partial cuts and perforations divide a blank into panels; the
pieces between the same two panels form one hinge.
- 15 issue codes, errors and warnings, each naming its lines; cut line
ends within a tolerance (0.1 pt, 0.01 to 10) are joined and reported as
a gap. With `select`, the lines the issues name are selected.
- The panel lists the issues in the interface language, with a summary
line; clicking an issue or its Select button selects its lines. The
list is kept until the document changes.
`vectorcraft_pathops::adjacency` maps paths as live_paint does and keeps,
for each edge, every input it lies on and the faces on both sides; the
blank model is `vectorcraft_three_d::fold::blanks`. The engine now depends
on vectorcraft-three-d directly.
Docs: docs/mcp.md (Check Fold Lines), crates/pathops/README.md, ROADMAP.
- 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 Group Selection marquee selected the anchor points inside it, as a
Direct Selection marquee does, so a path it crossed was only partly
selected. The Selection tool hides its bounding box while anchors are
picked, so after switching to it no box appeared around the objects.
The marquee now selects every object it touches, whole (members of
groups too, and with Shift it toggles them), as an Alt-drag marquee
with Direct Selection already does; a compound path it touches is
selected whole, as that marquee selects it. E during the drag still
selects only the objects entirely inside the marquee.
Fixes#8047
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.
Preferences › Performance › Low-Latency Drawing (lowLatencyDrawing, off by
default) is read when the app starts and asks for wgpu's AutoNoVsync. The
present mode comes from --present-mode, then VECTORCRAFT_PRESENT_MODE, then
the preference, then the default; with the preference off and no override
the window surface is unchanged. The startup log names "(preference)" or
"(override)" after the mode.
Whenever the window presents without vsync, from the preference or an
override, main-window frames start at most 240 times a second (about
4.17 ms apart). The wait comes before egui reads the frame's input, and
the frame's time moves on by it. With vsync the display paces the frames
and no cap applies.
The checkbox shows on the desktop with the note that it applies the next
time VectorCraft starts. A value that is not a boolean is an error.
Fixes#6013
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.
The art that clicks and marquees test leaves 3D effects unprojected again.
The faces of a layer's 3D effect carry the layer's id, which a click
cannot select, so a click on a member of such a layer selected nothing.
Use Preview Bounds still measures the projected art.
Save Changes now gives the group the same colors OK would: a color removed
with the Remove Color tool removes its swatch, and a color added with the
Add Color tool joins the group after its other colors, also when the art
holds colors of the group. `swatch.editGroup` takes `null` in `colors` to
remove the swatch at that place.
After the save, the rows follow the saved group, so a later edit or OK does
not remove or add a color a second time.
The Character Set menu of Text Import Options now lists Shift JIS, GB2312,
Chinese Big 5, Cyrillic, GB18030, Greek, Turkish, Baltic and Central European
beside Unicode and ANSI, and `file.place {text: {characterSet}}` takes
"shiftJis", "gb2312", "chineseBig5", "cyrillic", "gb18030", "greek",
"turkish", "baltic" and "centralEuropean". Each set decodes with its WHATWG
Encoding Standard decoder from encoding_rs, which the workspace already
locks: GB2312 reads as GBK, Cyrillic as windows-1251 (x-mac-cyrillic with
platform "mac"), and Greek, Turkish, Baltic and Central European as
windows-1253, 1254, 1257 and 1250 on both platforms. A byte-order mark is
read as ordinary bytes and a malformed sequence as U+FFFD. Unicode and ANSI
read as before.
An unknown character set is an error that lists the sets, and nothing is
placed. A `text` option of the wrong type (`characterSet: 3`,
`removeLineReturns: "yes"`) is now an error instead of the default. The
dialog remembers the last set confirmed, and Show Import Options off places
with it.
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.
layer.selectAll {id, add: true} checked each of the row's K objects with
a scan of the S selected objects, then removed or added them one id at a
time, each removal rebuilding the selection and each addition scanning
it again, so a Shift-click on a large layer took O(K*S + K^2). It now checks
the row's art against a set of the selected objects and calls
Selection::remove_all or Selection::add_all once. The resulting
selection, its order, the reply and the highlighted rows are the same
as before.
crates/engine/examples/layer_select_bench.rs times the old loop against
the new command in one process. On a layer of 50,000 objects the whole
command took a median of 733 ms before and 6.9 ms after with all of the
layer's art selected, and 369 ms before and 24 ms after with every other
object selected (7 runs, wall clock on Linux while other builds were
running).
An Intertwine group's row in the Layers panel now takes dragged rows and
selected art inside it, as a group's row does, and an object dropped
beside one of its members joins the group too. The new member has no
arranged areas and is drawn in its row's order; the other members keep
theirs. Alt-drag adds copies. layer.move and node.move refuse an object
that is or holds an Intertwine group, a Repeat, a graph or a Live Paint
group with the reason Make gives. For such an object the panel shows no
inside box on the group's row and no drop line beside a member's row.
A member moved out of the group, by a drag, node.move or Send to Current
Layer, drops its arranged areas. A group left with one member is
replaced by that member, or becomes a plain group of it when the group
has an opacity, blending, appearance, mask, lock or hidden state of its
own; a group left with none is removed. Each move is one undo step.
With a Constrain Angle other than 0° or a whole turn, an arc dragged out
with the Arc tool or placed from the Arc Segment Tool Options click dialog
is drawn along the turned x and y axes, with its bounding box turned. The
drag's box and Shift's equal lengths are measured along those axes, the
reference point stays at the drag's corner or the click, and F, C and
Up/Down keep the turn. At 0° and whole turns arcs are drawn as before.
shape.arc takes an optional rotation (degrees clockwise, about x1, y1 or
about the reference point x, y); a rotation that is not a number is an
error and adds nothing.
Expand Appearance gave each copy of a group's or layer's Transform effect
new ids after expanding it. When the raster budget refused the image for a
copy that held a random Transform effect, the copy stayed unexpanded, but
its new ids gave that effect a new seed, so the copy moved.
The group or layer now stays as it is in that case, as it does when its
own raster effects go past the budget. That rollback also removes the
images its earlier copies added to the document and gives their charge
back to the budget, so later objects in the same command can still use it.
A journal entry or action step recorded before the preference existed has
no `interpolate` key. On replay it now moves the handles as it did when it
was recorded, instead of following the live preference. A command run
directly still defaults to the preference, and an explicit value is still
used as given.
With Use Preview Bounds on, Align, Distribute, Distribute Spacing, the
Transform panel and the bounding box measured a 3D object by its flat
source path, so the drawn surface stuck out past the box and aligned
edges did not touch. They now measure the projected vector art the
renderer draws, built with the document's symbols as the renderer builds
it: effects on single fills and strokes, group and symbol members, a
symbol instance with its own 3D effect, appearance overrides on dynamic
symbols, and geometry effects after the 3D effect. An instance with its
own 3D effect counts toward the 4,096-instance limit. Raster effects are
still not measured, and with the preference off the geometric bounds
are unchanged.
Docs: params text of object.align, object.distribute and
object.distributeSpacing, docs/mcp.md, docs/target-app-parity.md.
A stored texture longer than the codec's default 2^18-pixel side still
reads back, and a gray PNG is not expanded to RGBA just to get its
levels. The AI writer and the EPS scene refuse an oversized image from
its header, then decode within MAX_IMAGE_PIXELS, keeping the pixels at
their stored depth. Flatten's see-through check uses ImageBlob's
allowance, and links.unembed decodes within MAX_RASTER_ALLOC.
A Shift-drag marquee sends every object it reaches as one select.toggle
{ids}. Each id used to scan and rebuild the selected objects, so K ids
against S selected objects took O(K*(S+K)). Selection::toggle_all and
Selection::add_all now handle the ids in one pass with a map of each id's
current slot, and the commands use them. The result is the same as
toggling or adding each id in order: an id toggled twice is selected
again at the end, and a removal clears that id's anchors, segments, key
and key anchor.
Select > Inverse looks each selectable object up in a set of the
selected ones instead of scanning the selection for each.
Selection::toggle_target, set_slices and set_guides use the same set
lookups.
crates/engine/examples/selection_bench.rs times the old per-id loops
against the new ones in one process. With 50,000 objects, toggling every
object off took 528 to 655 ms before and 2.5 to 4.6 ms after in 7 runs
(wall clock on a machine that was running other builds).
The new General preference Interpolate Control Points When Moving
Anchors (`interpolateControlPoints`, off by default) is the default of a
new `interpolate` param of path.moveAnchors (a Direct Selection drag),
object.nudge (the arrow keys), object.move, object.transform and
object.transformAgain. With it on, a move of direct-selected anchors
re-maps both handles of each segment with one moved end by the turn,
uniform scale and move that take the segment's old ends to its new
ends, so a segment between two corner anchors keeps its shape relative
to its ends.
- A segment with both ends moved, or with its ends at the same place
before or after the move, moves as it does with the preference off.
Only an exact move re-maps handles; any other transform of the anchors
is applied as before.
- A smooth anchor keeps its handles in line: its re-mapped handle takes
the new length and stays in line with the other handle, and when both
of its handles were re-mapped they point along the mean of their
directions. When the two point the same way, both move with the
anchor as with the preference off.
- The value used joins the command's journal entry and Transform
Again's options, so a replay or a repeat re-maps the handles alike
whatever the preference is then. A non-boolean value is an error.
- A retracted handle stays retracted, each drag or nudge is one undo
step, and a nudge of 0 still records none. Align and Distribute, and
the anchors of type paths and area type frames, move as before.
With the preference off, moves give the same result as before. The
label has a row in every catalog. The hook in transform_anchors follows
the patch bentschener attached to #7832; the handle math differs.
Fixes#7832
Docs: docs/mcp.md, docs/target-app-parity.md.
Co-authored-by: bentschener <353895224+bentschener@users.noreply.github.com>
The bridge module defined a second Circle with the same fields and derives as tangent_circle::Circle, and pathtools re-exported the tangent one as TangentCircle. The bridge now imports the existing type, pt::Circle names it again as on main, and the tangent circle command's annotation is back to pt::Circle.
path.eraseSegments checked only that `width` was a positive number, so a
width such as 1e300 erased every selected path and a width such as 1e-300
sampled the path too coarsely to find the band. It now refuses a width
outside 0.001 to 1000 pt with "`width` must be from 0.001 to 1000" before
reading the document; nothing changes and no undo step is recorded. Left
out or null, the width is still 8 pt. The range is VectorCraft's own: it
holds every width the Path Eraser tool sends across the view zoom and UI
Scaling limits, and its top matches the Eraser's largest Size.