Stroke: custom arrowheads cap subpaths, file size and preview size

- A custom arrowhead path allows at most 4,096 subpaths; stroke.set
  refuses a longer one and reading drops it.
- A symbol whose shapes cannot be united or clipped is listed in
  skipped instead of becoming a head that misses part of its art.
- The arrowheads file is refused when its document unpacks to more
  than 64 MB.
- Edit Arrowheads creates the starter file only when none exists and
  otherwise opens the file unchanged.
- After a save to the arrowheads file, the heads are read back from
  the written file.
- The plug-in argument check accepts path under startArrow.Custom and
  endArrow.Custom in stroke.set.
- A custom head's menu preview is scaled to fit its box, and rows
  outside the visible part of the menu do not render previews.
This commit is contained in:
dotCooCoo
2026-11-12 05:00:15 -08:00
parent b42a3d4869
commit 0a3abb8534
12 changed files with 310 additions and 62 deletions
+6 -5
View File
@@ -3960,17 +3960,18 @@ right, the symbol's registration point is its tip, and the art's height is drawn
head weights). The visible fills and the outlined visible strokes of its paths, compound paths and groups, and its
gradient meshes, make the head, with geometry effects applied and clip groups clipped, and the line stops halfway along its length. A head is
one solid shape in the stroke's paint: art at 0 % opacity is left out, and other opacities, blend modes and opacity
masks do not change the shape. The file is read when the app starts and again each time VectorCraft saves it;
`stroke.arrowheads.reload` reads it again. A file larger than 64 MB is not read, at most 256 symbols are read, and a
symbol that paints nothing, reaches more than 64 head weights from its tip, has more than 65,536 anchors in its art or
in the shapes it paints, or has more than 4,096 anchors once united is listed in `skipped`. `stroke.arrowheads.list` returns each head's `name`, `reach` and `halfWidth`, the `file`
masks do not change the shape. The file is read when the app starts and again from disk each time VectorCraft saves it;
`stroke.arrowheads.reload` reads it again. A file larger than 64 MB, or whose document or images unpack to more than 64 MB, is
not read, at most 256 symbols are read, and a symbol that paints nothing, reaches more than 64 head weights from its
tip, has more than 65,536 anchors in its art or in the shapes it paints, has shapes that cannot be combined into one,
or has more than 4,096 anchors once united is listed in `skipped`. `stroke.arrowheads.list` returns each head's `name`, `reach` and `halfWidth`, the `file`
path, the `skipped` symbols and any read `error`.
`stroke.set {endArrow: {"custom": name}}` puts a custom head on a stroke. The stroke keeps a copy of the head's art,
so the document draws it, saves it and exports it to SVG and PDF the same way without the arrowheads file.
`document.inspect` reports such a head as `{"Custom": {name, path}}`, which `stroke.set` takes back unchanged. It
refuses a `path` that fills no area (non-zero rule; parts thinner than a millionth of a head unit count as none) or
has more than 4,096 anchors or a point more than 64 head units from the tip. The help page
has more than 4,096 anchors, more than 4,096 subpaths or a point more than 64 head units from the tip. The help page
[Apply stroke on an object](https://helpx.adobe.com/illustrator/using/stroke-object.html) describes defining custom
arrowheads in a separate arrowheads file.