Commit Graph
3195 Commits
Author SHA1 Message Date
dotCooCoo 74ea25cd6c File formats: HP-GL (.plt) plot files open and place
File › Open and File › Place refused plotter files: HP-GL/2 files
(.plt, .hpgl, .hgl, .hpg) were not a format VectorCraft reads.

The format table gets a read-only HP-GL format, read by a new
vectorcraft_cad::hpgl module. Each line the pen draws becomes a stroked
path in its pen's color and width, with the line type as a dash pattern
and the line attributes as caps and joins. Circles, arcs, wedges and
Bézier curves are drawn as curves. Filled and edged rectangles, wedges
and polygons (polygon mode) become filled or stroked paths, and encoded
polylines, scaling points, user units and rotation are read. Plotter
units (1016 to the inch, y up) become points, and the artboard holds
what the art paints. Place brings the art in as one group. Older HP-GL
files are read by the HP-GL/2 rules for the instructions the two share.

A file is recognized by its first instructions, after any printer
escape sequences and PJL lines, so a plot file also opens under an
extension no other format reads. VectorCraft's own rules where the
device decides: before the first SP the pen is pen 1, and the hard-clip
limits are 11 x 8.5 in, which P2 takes when the file sets no scaling
points. Labels, symbol-mode symbols and raster images are not drawn,
the input window does not clip, hatched fills are filled solid, and
later pages are drawn over the first; the warnings list each. Objects,
path points and pen widths are capped, and the import fuzzer covers
random, mutated and garbage plot files.

An importer plug-in that lists .plt, .hpgl, .hgl or .hpg now opens
those files only when document.open names it with `importer`.

Docs: docs/mcp.md, docs/file-format-parity.md,
docs/target-app-parity.md, docs/releasing.md.
2026-11-11 16:03:41 -08:00
BFlat dd6b00c228 Merge pull request #6653 from dotCooCoo/fix/script-throw-site-through-finally
Scripts: an uncaught error that passes through a finally block is reported where it was thrown
2026-11-12 02:53:22 +07:00
BFlat f9ff1caf54 Merge pull request #6648 from dotCooCoo/feat/dynamic-text-on-path
Type: Dynamic Text sizes type on a path to fill its brackets
2026-11-12 02:45:39 +07:00
BFlat e0779c6266 Merge pull request #6646 from dotCooCoo/fix/plugin-fuzz-fuel-slice
Plug-ins: the fuzz test reads the runtime's fuel slice instead of a copy
2026-11-12 02:28:28 +07:00
BFlat 541f8beae7 Merge pull request #6643 from dotCooCoo/feat/pdf-large-pages-in-points
PDF: an option writes pages longer than 200 in at full size in points
2026-11-12 02:05:54 +07:00
BFlat c6580dbda0 Merge pull request #6636 from dotCooCoo/fix/plugin-folder-tests-take-turns
Tests: plug-in folder tests take turns on the folder last loaded
2026-11-12 01:56:39 +07:00
BFlat 3dda59ce95 Merge pull request #6640 from dotCooCoo/fix/ids-null-takes-selection
Commands: ids null acts on the selection instead of being refused
2026-11-12 01:56:30 +07:00
BFlat d0bb662aa2 Merge pull request #6641 from dotCooCoo/fix/scriptcheck-identifier-chars
Script checker: names follow Unicode ID_Start and ID_Continue
2026-11-12 01:52:02 +07:00
dotCooCoo 1f835d94c4 Merge main into fix/script-throw-site-through-finally 2026-11-11 10:44:55 -08:00
dotCooCoo 8d094fc811 Scripts: an uncaught error that passes through a finally block is reported where it was thrown
An error a finally block passed on unchanged was reported at the end of
that block, in script.run's report and in the Script Console, because the
block's end raised the error again at a new site. The interpreter now keeps
the site of the exception each finally block runs for, keyed by the stack
slot that holds it, and the block's end throws the exception on from that
site. This holds through nested finally blocks, called functions, resumed
runs and marked host errors. An error the finally block throws is reported
at that throw, and one its return, break or continue discards is not
reported.
2026-11-11 10:44:16 -08:00
BFlat 6a4ef12091 Merge pull request #6603 from Messhias/feat/g5-brush-lib-energy-beams
G5: built-in Energy Beams brush library
2026-11-12 01:43:54 +07:00
dotCooCoo 2606b70604 Type: Dynamic Text sizes type on a path to fill its brackets
Type › Dynamic Text (`type.dynamicText`, also on the Contextual Task Bar
for type on a path) scales the text by one factor so it fills the span
between its start and end brackets, and the layout fits it again after
each edit to the text, the path or a bracket. The first character's
size moves in 0.1 pt steps within 0.1 to 1,296 pt. Turning it off, or
threading the type, keeps the sizes it was drawn at.

- The model saves `dynamicText` only when on.
- SVG, the legacy .ai writer and the .ai editing data write the drawn
  sizes through `vectorcraft_text::drawn`; the editing data warns that
  the setting is not written.
- Shrink Text to Fit and Dynamic Text step the size the Character panel
  shows when a size measures the cap height, x-height or ICF box.

Docs: docs/mcp.md, docs/type-parity.md, docs/target-app-parity.md.
Part of #4134.
2026-11-11 10:42:49 -08:00
BFlat 1e76791ae1 Merge pull request #6615 from dotCooCoo/feat/script-file-folder
Scripts: File and Folder read files in the script's own folder
2026-11-12 01:35:45 +07:00
dotCooCoo 3fba3a440c Merge main into fix/plugin-fuzz-fuel-slice 2026-11-11 10:32:47 -08:00
BFlat f83d916d8a Merge pull request #6631 from Hassan1305/docs-6340-rotation-direction
Commands: every angle and rotation param says which way it turns (#6340)
2026-11-12 01:32:17 +07:00
BFlat 210e9ad7d0 Merge pull request #6632 from dotCooCoo/feat/ruler-guides-as-objects
Guides: ruler guides are document objects on their layers
2026-11-12 01:32:07 +07:00
dotCooCoo ae5bb7b26e Plug-ins: the fuzz test reads the runtime's fuel slice instead of a copy
vectorcraft_plugins exports FUEL_SLICE and BYTES_COPIED_PER_FUEL (hidden
from the docs), and the bulk memory fuzz cases use them for the passes
around one slice, the lengths around one unit of fuel and the fuel
estimate, in place of the copied 20,000,000 and 64.
2026-11-11 10:29:22 -08:00
dotCooCoo 3074560b07 PDF: an option writes pages longer than 200 in at full size in points
The Save PDF dialog's General section gets "Write pages longer than 200 in
at full size in points" (longPagesInPoints in document.exportPdf,
document.export, presets and document.pdfSettings), off by default. When it
is on, a page with a side longer than 14,400 pt is written with its media
box in points and no /UserUnit at every PDF version, and a PDF 1.5 file
stays PDF 1.5. The export's warning for such a page then says it is written
in points. With the option off, and for pages of 14,400 pt or less, the
file is the same as before.

Docs: docs/mcp.md, docs/target-app-parity.md. The new label has a row in
every catalog that lists the dialog's other options.
2026-11-11 10:17:24 -08:00
dotCooCoo 1643ab52a9 Commands: ids null acts on the selection instead of being refused
The 27 commands that act on `ids` or else the selection (Apply as
Filter, Print Ink Fixes, the Arrange, Cleanup and Path Tools plug-in
commands, Smooth, Text Wrap, variable.bind and variable.unbind among them)
refused `ids: null` with "ids must be an array of non-negative integer
object ids". They now read null as `ids` left out, as the other commands
that take `ids` do. Remove Breaks also reads null as left out when it
decides whether to act on the characters the Type tool selected.
2026-11-11 10:10:46 -08:00
Fabio William Conceição 72c7cb5a73 G5: built-in Energy Beams brush library
Six brush libraries; MCP docs list Energy Beams with the other generated brush libraries.
2026-11-11 18:07:54 +00:00
dotCooCoo 5ac7d97d85 Guides: ruler guides are document objects on their layers
Ruler guides were a list kept beside the layers. Each guide is now an
object of its layer or sublayer, always directly in it and above the
layer's art. These behave as on main:

- Guides draw on screen only. Exports (SVG, PDF, PNG, PSD), Fit All,
  Select All, the art bounds, clicks and marquees, and a layer's
  Pathfinder and Transform effects leave them out. The Layers panel
  lists them as guide rows of their layer, the highest guide.list
  index first.
- Deleting a layer deletes its guides, and merging layers keeps their
  guides in the merged layer.
- The guide commands number guides as guide.list does, in the order
  they were made.

New: each guide takes an id from the document's object ids. An object
command given a guide's id fails with an error, and node.move cannot
put a guide into a group or out of its layers. A guide made while an
opacity mask, a symbol or a pattern is edited moves to the top
visible, unlocked layer when editing ends.

File format: native files still save the guides in the document's
guides list, in every file version, so older builds read them. Each
entry may now also carry the guide's id, name, locked and hidden
flags; older builds ignore those fields. Opening a file puts each
saved guide on its layer (on the top visible, unlocked layer when the
file names none or a layer it does not have), and each saved guide
counts against the object limit for opening a file. A ruler guide node
that a file holds below a layer's art moves up to the layer's guides,
and one anywhere else (in a group or another object, beside the
layers, or in a symbol) is removed. Ruler guides read from an .ai file
become guide objects on the layer they were on, numbered in the order
the file lists them.
2026-11-11 09:52:28 -08:00
BFlat ad70adf96e Merge pull request #6624 from Messhias/feat/g5-symbol-lib-skill-icons
G5: built-in Skill Icons symbol library
2026-11-12 00:50:41 +07:00
dotCooCoo 8269e140ce Scripts: the backslash path test expects no lookups on Windows only
Outside Windows, `\\host\s\x.txt`, `\\?\C:\x.txt` and `\\.\pipe\x` are
relative file names in the script's folder, so `exists`, `open` and
`getFiles` look them up. The test now expects no lookups for them on
Windows only, and on macOS and Linux checks `//host/s/x.txt`, an absolute
path outside the folder, alone. The returned values are the same on every
platform.
2026-11-11 09:46:57 -08:00
BFlat 25433ede65 Merge pull request #6619 from jmverges/fix/6610-aligned-lines-trailing-tracking
Type: aligned lines leave the tracking after their last character out
2026-11-12 00:39:30 +07:00
dotCooCoo 949cbe7bea Tests: plug-in folder tests take turns on the folder last loaded
The folder the Additional Plug-ins Folder preference or plugin.reload last loaded is kept for the
whole process. The six engine tests that set the preference or run plugin.reload now hold one lock,
so another test loading its own folder between two steps cannot change what the next step loads or
lists.
2026-11-11 09:37:01 -08:00
BFlat 61acb79de3 Merge pull request #6620 from storytold/fix/sec-links-shared-reads
Links: groups of one file share one decoded image per operation
2026-11-12 00:21:59 +07:00
Fabio William Conceição f07c2f7e9c G5: built-in Skill Icons symbol library
Five symbol libraries; MCP docs list Skill Icons with the other generated symbol libraries.
2026-11-11 17:08:39 +00:00
BFlat 29207e507d Merge pull request #6611 from dotCooCoo/fix/plugins-folder-cleared-forgets-folder
Plug-ins: setting the plug-ins folder again after clearing it installs its plug-ins
2026-11-11 23:46:01 +07:00
Dylan M. Taylor ec9169591a Links: groups of one file share one decoded image per operation 2026-11-11 16:42:19 +00:00
HassanKhan b3860bf7d0 Commands: every angle and rotation param says which way it turns (#6340)
The params docs now state the direction (and the zero) of each angle or
rotation a command takes; behaviour is unchanged. Shape creation, text.create,
the grids, add-on shapes, saved views, Liquify, Puppet Warp pins, Mirror and
Radial Repeat and Vector Halftone turn clockwise; text character rotation,
gradients, the eraser tip and print screen angles turn counter-clockwise.

view.saved.new's rotation note changes its schema, so the API level goes to 3.

A test walks every command's params doc and fails when a param named like an
angle or rotation doesn't say clockwise or counter-clockwise.
2026-11-11 21:40:27 +05:00
jmverges 352b488b12 Merge remote-tracking branch 'upstream/main' into fix/aligned-lines-trailing-tracking
# Conflicts:
#	docs/file-format-parity.md
2026-11-11 16:38:59 +00:00
dotCooCoo ced8c1bb39 Merge main into fix/scriptcheck-identifier-chars 2026-11-11 08:36:00 -08:00
dotCooCoo 289401343c Script checker: names follow Unicode ID_Start and ID_Continue
Check Script read names with Rust's alphabetic and alphanumeric tests, so it
split names at U+2118, U+203F, U+00B7 and the zero width non-joiner and joiner,
and took U+00B2 and U+2E2F into names. It now uses the Unicode 16.0 ID_Start
and ID_Continue rule that vectorcraft-js uses, with `$` and `_`
(https://www.unicode.org/reports/tr31/,
https://tc39.es/ecma262/#sec-names-and-keywords).

A `\uXXXX` escape is part of a name only when it stands for a character the
name may hold where it is: `\u0030abc` no longer becomes `0abc`, and malformed
escapes end the name.

The engine's lexer comparison test now checks that both crates take the same
characters into names, written out and as escapes.
2026-11-11 08:35:19 -08:00
BFlat caaf261e9f Merge pull request #6605 from dotCooCoo/fix/gradient-stop-symbol-part
Gradients: picking a part of a symbol instance leaves no gradient stop selected
2026-11-11 23:25:06 +07:00
jmvergesandClaude Opus 5.5 9f80b4daae Type: aligned lines leave the tracking after their last character out (#6610)
A centred or right-aligned line of tracked type was measured with the
tracking after its last character, so it sat half that tracking
(centred) or the whole tracking (right-aligned) left of where the page
of users' .ai files draws it. That page aligns a line as wide as its
characters without that tracking.

Shaping now records the tracking each glyph's advance holds
(SGlyph::tracking), and a line that isn't justified leaves its last
character's out of the width it is aligned by. The last character is
the last one the line draws before a paragraph's end, a forced line
break or the spaces a wrap leaves; spaces or a tab typed before a
paragraph's end or a forced line break keep the letter's tracking, as
the page does. Forced line breaks and wraps aren't in the files: they
follow the rule so that turning a wrap into a paragraph or a forced line
break keeps the line in place. Hyphenated lines, lines whose last
character hangs, vertical and right-to-left lines and type on a path
keep it. The tracking stays in the glyph's advance, so the caret,
selections, line breaking and Fit Headline are unchanged.
LineInfo::trailing gives the amount. Right-aligned area type sets the
text after its last tab the same way.

What aligns by line widths follows. Convert To Area Type makes its
frame end where the lines are aligned, with room for the tracking, so
tracked type converted either way stays in place. Affinity import lines
up differently aligned paragraphs of artistic text by the aligned
widths. SVG import moves a centred or right-aligned letter-spaced line
back by its share of the last letter spacing, so it stays where a reader
draws it and SVG export, which anchors lines at the end of their
advances, reads back unchanged.

Centred and right-aligned tracked type lays out differently than before
in every document.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 16:07:40 +00:00
dotCooCoo 8eb3788eba Plug-ins: setting the plug-ins folder again after clearing it installs its plug-ins
Clearing Preferences > Plug-ins & Scratch Disks > Additional Plug-ins Folder
left the folder recorded as the one last loaded. Setting the same folder
again then matched that record, and nothing in it was installed, so a
plug-in removed in the meantime stayed removed. Clearing the preference now
forgets the folder when it is the one last loaded.
2026-11-11 08:07:27 -08:00
dotCooCoo ba05554c64 Merge main into feat/script-file-folder 2026-11-11 07:47:42 -08:00
dotCooCoo b7a6196994 Scripts: File and Folder read files in the script's own folder
Scripts get the File and Folder classes as built-ins of the script
engine. A script run from a file can test whether files exist, read
their properties, list folders with getFiles (a mask or a function),
and open files to read them with read, readln, readch, seek and tell.

- Reads stay inside the script's folder and, when automation read
  roots are set, inside them too. A script given as text reads no
  files. Network and device paths, and paths outside the folder by
  their names, are refused before anything is looked up. Links and
  junctions that lead out are refused, and getFiles leaves them out.
- The encoding comes from the byte order mark, then the encoding the
  script set, then UTF-8 when the bytes are valid, then CP1252.
- Limits: 8 MiB a file, 32 MiB a run, 256 files open at once, 2,048
  getFiles entries and 65,536 names looked at, and paths of at most
  32,767 characters.
- Writing, the file dialogs and execute are not available yet: they
  return false or null and set error.

The report's hostCallCounts gains fileCalls and fileExecutes.
Docs: docs/mcp.md, docs/target-app-parity.md.
2026-11-11 07:46:33 -08:00
dotCooCoo b44cbdb048 Gradients: picking a part of a symbol instance leaves no gradient stop selected
A stop selected on a whole dynamic symbol instance's gradient stayed
selected after Direct Selection picked an object of that instance's art,
because the instance stayed the first selected object. The Gradient panel
kept the stop highlighted and the Gradient tool took Delete and the arrow
keys for it, while every gradient edit is refused for a picked object.

The stop's owner now records whether a part is picked, so the stop is not
selected while one is, and is selected again when the whole instance is.
2026-11-11 07:39:47 -08:00
dotCooCoo ac8e39fa2e Effects: a pasted SVG filter also takes a free punctuation character when no letter or digit is free
A filter's id can be any character, so when every letter and digit is in
use a pasted filter at the size limit with a one-letter name now tries the
other printable ASCII characters (`!` to `~`) before the paste is refused.
2026-11-11 07:26:02 -08:00
dotCooCoo f60da17d39 Effects: a pasted SVG filter also takes a free capital letter when no lowercase name is free
Filter names are case-sensitive, but a pasted filter at the size limit with a
one-letter name only tried the letters a to z and the digits 0 to 9 as a new
name. A paste was refused while every capital letter was still free. It now
also tries A to Z.
2026-11-11 07:26:02 -08:00
BFlat 9fc43f2a35 Merge pull request #6598 from dotCooCoo/fix/pasted-svg-filter-brush-names
Effects: a pasted SVG filter avoids brush effect names and is refused with no free name
2026-11-11 22:10:15 +07:00
dotCooCoo e0e361a834 Effects: a pasted SVG filter avoids brush effect names and is refused with no free name
Follows #6592. Paste now also skips the names that effects in the
document's brush art use when it picks a free name for a pasted SVG
filter. When no free name keeps the filter within the 64 KB limit (a
one-letter name at the limit with every free letter and digit taken),
the paste is refused instead of keeping the name of the document's
filter. Clipboard::import_into and import_text_styles return a Result,
and their callers pass the error on before the document changes.
2026-11-11 06:08:58 -08:00
dotCooCoo 48e342f03b Merge main into feat/script-dollar-object 2026-11-11 05:55:39 -08:00
BFlat 2d90cda199 Merge pull request #5493 from storytold/fix/sec-effects-paint-dash-budget
Effects: bound 3D paint copies, dash restarts and trap candidate pairs
2026-11-11 20:36:20 +07:00
BFlat 8353e8fdd3 Merge pull request #6562 from dotCooCoo/fix/script-console-report-text
Script Console: report lines match script.console, counts of one are singular, every run ends
2026-11-11 20:36:11 +07:00
BFlat c064ded1d1 Merge pull request #6592 from dotCooCoo/fix/pasted-svg-filter-free-name
Effects: a pasted SVG filter is not renamed to a name the document's effects use
2026-11-11 20:28:20 +07:00
BFlat 3f8b10afdf Merge pull request #6588 from dotCooCoo/fix/rasterize-side-rounding
Rasterize: art that rounds to 32,768 pixels a side is no longer refused
2026-11-11 20:13:57 +07:00
BFlat f242b0752f Merge pull request #6590 from dotCooCoo/fix/text-style-leading-strict
Type: text.setStyle refuses a leading with trailing text
2026-11-11 20:08:46 +07:00
dotCooCoo f77fe0423f Merge main into fix/script-console-report-text 2026-11-11 04:58:29 -08:00