Commit Graph
7289 Commits
Author SHA1 Message Date
dotCooCoo 100730d4d3 .ai import: a file whose PDF part can't be read opens from its editing data
Squashed from #5051 onto main.
2026-11-02 12:04:04 +07:00
dotCooCoo 54436b0aa2 i18n: open, save and recovery messages name their counts in the singular or the plural
The status bar said "Opened with 1 note(s)", "Saved <path> with 1 note(s)",
"Discarded 1 recovered document(s)" and "Restored 1 recovered document(s)",
and the Global Edit options showed "Result(s): 1". They now use the singular
for 1 and the plural otherwise, in English through i18n::msg_n and in every
catalog through @msgplural rows (the Results line through an @plural row).

The engine's warnings for linked images and placed documents output as their
previews, and its errors for a page past a placed file's last page or
artboard, also name their counts in the singular or the plural.

The catalogs drop the rows no message reads any more: the plain "(s)" rows
of the changed messages and the @msg row for "Packaged {n} file(s){note}".

Follows #5002.
2026-11-02 12:04:04 +07:00
dotCooCoo 5e3a0090a2 Swatch libraries: test that a pattern library adds only the picked pattern
Reading a pattern library adds no pattern or swatch to the document. A
pattern added from it undoes and redoes with its swatch, and both are
kept after a save and reopen.
2026-11-02 12:04:03 +07:00
dotCooCoo 284b5b45b6 Swatch libraries: only a built-in pattern library's own swatches draw its pattern tiles 2026-11-02 12:04:03 +07:00
dotCooCoo 6b7513c0a0 Swatch libraries: a pattern swatch is found without copying the document
swatch.library.add looks for the library's pattern among the document's
patterns of that name or a numbered copy of it, instead of importing it
into a copy of the document. Only a swatch that paints with the pattern
unmoved counts as the pattern's swatch, so a swatch whose pattern was
moved in its space is not reused and applied in its place.
2026-11-02 12:04:02 +07:00
dotCooCoo cb7df83217 Swatch libraries: Patterns › Geometric Patterns adds a pattern with its swatch
Window › Swatch Libraries and the Swatches panel's library menu get a
Patterns submenu with Geometric Patterns, a built-in library of eleven
black pattern swatches drawn in code (dots, stripes, a checkerboard, a
grid, diamonds, triangles, crosses and a zigzag).

- Clicking a pattern in its library panel adds the pattern and its
  swatch to the document and applies it to the active fill or stroke
  (Alt: the other one), as one undo step. A second click reuses the
  swatch; a different pattern under the same name keeps its name and
  the library's pattern comes in numbered.
- swatch.library.list lists the pattern libraries after the gradient
  libraries (category "patterns"), and swatch.library.add brings a
  pattern swatch's pattern as pasting art painted with it does.
- The library panel draws each pattern tile from the library's pattern.
- "Geometric Patterns" is translated in every catalog.
2026-11-02 12:04:02 +07:00
dotCooCoo 65dcc83bf1 Actions: the panel menu's Duplicate copies the selected action or set
The Actions panel menu has Duplicate, between New Set… and Delete. With
an action selected it copies that action to right after it in the same
set; otherwise it copies the current set, with all its actions, to right
after that set. The copy is named after the original with " copy" added
and is selected, and a copied set gets an id of its own. Copies are
saved with the other sets.

ui.actionSet.duplicate {set?: index, action?: index} does the copy and
returns {set, action?}. An index past the last set or action is an
error. A recording into a later set and an open Set Options or Batch
dialog stay on their own set and action.
2026-11-02 12:04:01 +07:00
dotCooCoo 775effdbb3 Live Paint: the Live Paint Bucket highlights an edge thinner than a face
The bucket outlines the face under the pointer at its Width setting and an
edge at half of it (4 px and 2 px by default), as the help page says faces
are highlighted with a thick line and edges with a thin line. The Live
Paint Selection tool keeps one width for faces and edges.
2026-11-02 12:04:00 +07:00
dotCooCoo 11adb715b5 Place: a Word .doc document with too many property runs, paragraphs or properties is refused
A bin table that lists more than 100,000 runs of character or of paragraph
properties is refused while its pages are read. Every paragraph now counts
against the 100,000-paragraph limit, hidden and deleted ones and those in
field instructions included, and so does every line break. The properties
of the styles and of the property runs are read from one budget of 16 MiB,
and a document with more is refused.

Text inside a field's instructions is found with a count of the fields
open in their instructions instead of a search of the open fields for each
character.
2026-11-02 12:03:59 +07:00
dotCooCoo a6db4c9112 Place: a Word .doc style sheet that holds fewer styles than it counts is refused
Stshif.cstd counts the LPStd records of the style sheet and must be less than
0x0FFE. A sheet that ended before cstd records was read as far as it went, and
paragraphs in the missing styles were placed with the document defaults; a
cstd of 0x0FFE or more was cut to 0x0FFE. Both are now refused as a damaged
style sheet.
2026-11-02 12:03:58 +07:00
dotCooCoo 22218e9097 Place: a Word .doc paragraph's own indent holds over its style's
A paragraph style can set a logical start or end indent and the paragraph
itself only a physical left or right one, or the other way round. The
indent applied last now holds, after the sides are mapped for the
paragraph's direction; before, the logical indent always held, so a
paragraph's own indent was lost under its style's.
2026-11-02 12:03:58 +07:00
dotCooCoo ecd184510c Place: Word .doc styles are resolved once and damaged property tables are refused
Each style's formatting is now worked out once, on top of the style it
is based on, and each property run's formatting once, so a document with
many hidden paragraphs or long style chains no longer resolves the
chains again for every paragraph and run. Character styles are applied
as a change to the paragraph's formatting.

A bin table whose file positions do not rise, a property page listed
twice, pages whose runs overlap, and styles based on each other in a
loop are refused as damaged, as MS-DOC requires (PlcBteChpx, ChpxFkp,
StdfBase). Property runs refer to their page instead of copying it.
2026-11-02 12:03:57 +07:00
dotCooCoo b4c01e3120 Tests: move the repeated-records timing test next to the other objects-on-path record tests 2026-11-02 12:03:57 +07:00
dotCooCoo 9596130be4 .ai import: Objects on Path records measure each group once
Each Objects on Path record measured the bounds of every object it names,
and checked its path, before it was turned down. A thousand copies of a
record whose object is a group of 20,000 paths took 5.6 s to open instead
of about 50 ms. A record now checks its group and ids first, and the path
and objects of a group are measured for one record at most.
2026-11-02 12:03:56 +07:00
dotCooCoo bb354fc92a .ai import: page art moved to its artboard takes its pattern tiles along
Art taken from a `.ai`'s PDF part on a later page is moved to where the
editing data puts that artboard. The move left pattern fills and strokes
where they were, so their tiles no longer lined up with the art. This
happened in three places: the page art that stands in for an unread
object (#5050), the page's type given to text objects, and the art on
each page when the file comes in as its PDF part with the artboard
layout kept. Each move now transforms the pattern tiles too.
2026-11-02 12:03:56 +07:00
dotCooCoo cbd4dd5599 Docs: list every case where an unread .ai object still sends the file to its page
The file-format and progress docs named three of the cases in which an
unread object's page art is not used and the file comes in as its page.
The import also does this when the object lies on an artboard that has
no page, when no page art lies inside its box, when that page art is
inside a page group with a clip, mask, transparency or appearance, when
the object holds a frame of threaded type, and when the page art uses a
pattern, image or swatch that the page lacks or that differs from the
editing data's (`replace_unread` and `copy_page_resources` in
`crates/eps/src/import/native/build.rs`).
2026-11-02 12:03:56 +07:00
dotCooCoo afeb4a8574 Docs: the .ai issue counts in G9 and the file-exchange discount are dated
Both passages still name guides among the open .ai issues. They now say the
counts were measured on 2026-10-10, before #779 closed.
2026-11-02 12:03:55 +07:00
dotCooCoo 6bf2941f28 Docs: .ai guides are no longer listed as lost
#5057 opens ruler guides and guide objects from a .ai's editing data and
closed #779. The File formats row of docs/target-app-parity.md, the known
failures in docs/file-format-parity.md, G9 in docs/gaps.md and
docs/roadmap.md still listed guides as lost.
2026-11-02 12:03:55 +07:00
bflatastic 54b79c02b0 .ai import: Convert to Shape records string entries through the shared dictionary parser 2026-11-02 12:03:54 +07:00
dotCooCoo e130cf3e0c .ai import: Convert to Shape opens live on paths and type
Squashed from #5142 onto main.
2026-11-02 12:03:54 +07:00
dotCooCoo 664fe8a12b .ai import: Stylize effects open with their saved settings
An object whose art style holds Drop Shadow, Inner Glow, Outer Glow,
Feather, Round Corners or Scribble now opens as itself with those
effects live, in their order. Feather is read under the name and key
the files use (`Adobe Fuzzy Mask`, `Radius`).

Each setting is read only when it is written as its kind (`/Int`,
`/Real`, a fill style for a color) with a value in range. An unknown
key or choice, a missing setting, or a Scribble with a color of its own
keeps the drawn look, where the reader used to cast, clamp or default
the value.
2026-11-02 12:03:53 +07:00
dotCooCoo f024f5a5f2 Variables: Export Data Sets marks visibility and image columns with # and @
Squashed from #5141 onto main.
2026-11-02 12:03:52 +07:00
bflatastic 78014a1b43 Variables: Import Data Sets and Load Variable Library record their step through edit_variables 2026-11-02 12:03:49 +07:00
dotCooCoo a6ce22da5c Variables: an import or library load that changes nothing adds no undo step
dataset.import and variable.loadLibrary added an undo step, cleared Redo
and marked a saved document modified even when the variables and data
sets came out as they were, such as the same CSV or library loaded
again. Both now build the new variables on a copy and record a step only
when it differs. variable.loadLibrary's params text and docs/mcp.md say
so.
2026-11-02 12:03:45 +07:00
dotCooCoo d0749dde41 Variables: Update Data Set keeps a row's values when every bound object is locked
Squashed from #5126 onto main.
2026-11-02 12:03:41 +07:00
dotCooCoo d9024f9c31 Variables: a command that changes nothing adds no undo step
Squashed from #5130 onto main.
2026-11-02 12:03:41 +07:00
dotCooCoo 06221ce545 Variables: a CSV header that names one variable twice is refused
dataset.import read two header cells that named one variable (City
and City, or Shown and #Shown) into the same column, so each row kept
only the last non-blank cell and the other value was dropped without a
word. The import is now refused with the two column numbers, and the
message has a row in every complete-message catalog.
2026-11-02 12:03:40 +07:00
dotCooCoo 386bfc881e Docs: move the import value error note next to the data set warning 2026-11-02 12:03:39 +07:00
dotCooCoo 660102064f Variables: Import Data Sets reports why a cell was refused
dataset.import replaced the reason for a refused cell with "value for
`X` must match its variable kind", so a visibility value such as
maybe and a graph value over 262,144 bytes gave the same message. The
error now keeps the line and gives the reason, and both messages have
a row in every complete-message catalog.
2026-11-02 12:03:38 +07:00
dotCooCoo 1be658c88c Variables: Export Data Sets refuses more data sets or variables than Import Data Sets reads
dataset.export checked only the 1 MiB size, so a document with more than
1000 data sets or 256 variables exported a CSV that dataset.import then
refused. Export now refuses such a document with a message naming the
limit, and the messages have rows in every complete-message catalog.
2026-11-02 12:03:37 +07:00
dotCooCoo adb446049b Variables: Undo and Redo clear a highlight that names no variable
Undo, Redo and a canceled undo group put back an earlier document but
left the Variables panel highlight as it was. After renaming the
highlighted variable and undoing, the highlight still named the new
name: a variable defined later under that name showed highlighted
without a click, and Delete removed it.

Each of these paths now clears a highlight whose variable the restored
document does not define, as Delete Variables and Load Variable Library
already did.
2026-11-02 12:03:36 +07:00
dotCooCoo 0ccc6d9df5 .ai import: paths keep their notes and Show Center
Squashed from #5129 onto main.
2026-11-02 12:03:35 +07:00
dotCooCoo c21ff5698e Tests: move the legacy type tests next to the text object tests
The legacy type helpers and tests move from the end of crates/eps/src/import/ai/tests.rs to after text_objects_are_slots_named_after_their_story, and the helper stream7 is renamed type_stream7.
2026-11-02 12:03:33 +07:00
dotCooCoo db11446502 .ai import: legacy type keeps its spacing, hanging punctuation and hyphenation
Legacy type (`To` ... `TO`) now reads `min opt max TC` and `min opt max TW`
into the paragraph's letter and word spacing, `hangingQuotes Tq` into Roman
hanging punctuation, and `hyphenate limit lead tail max Th` into hyphenation
on or off, After First, Before Last and the Hyphen Limit (0 when the limit
flag is 0). Values are kept to the ranges the Justification and Hyphenation
options take, and a spacing triple out of order goes back to its default.

Operands of the legacy type attributes are read by their place: an attribute
whose operands are missing, are not numbers, or are flags other than 0 and 1
stays as it was. Before, a value that was not a number shifted the later
operands (`5 /x 7 Ti` set indents of 5, 7 and 0), and a bad `TA` or `Ta`
turned kerning on or set the alignment to left. One long `Tx` no longer goes
past the reader's limit on characters.
2026-11-02 12:03:33 +07:00
dotCooCoo 06d037c1b2 .ai import: a clipping path keeps its stroke
A clipping path painted with a stroke (`W S`, `W B`) lost the stroke when
a .ai file opened from its editing data. The clipping path now keeps it,
and it paints over the clipped art as a clipping path's stroke does in
VectorCraft. A gradient-filled clipping path stroked with `1 BB` or `2 BB`
put the stroke on the painted copy of its fill, under the clipped art; it
now goes on the clipping path too. Several clipping paths in one group
make one compound path, which keeps their stroke, opacity and blend mode
when they all have the same ones.
2026-11-02 12:03:31 +07:00
dotCooCoo fa8d3b8de4 Fix #3797: documents open in Preview, and Outline is a setting of each document
View > Outline was one app-wide flag saved in the interface preferences,
so after Cmd+Y every later launch drew every opened or new document as
outlines, with no fills. The flag is now part of each document's view:
a document opens in Preview, each tab shows its own Outline or Preview,
and the setting is not saved at launch. An older preferences file that
holds the flag still loads, and its value is ignored.

The Outline command and ui.set's outline act on the active document and
are an error without one.
2026-11-02 12:03:30 +07:00
dotCooCoo 43b2733fc9 Tests: move the empty text value test next to the new data set test 2026-11-02 12:03:28 +07:00
dotCooCoo 9dbbe52a3c Variables: Edit Data Set keeps an empty text value when OK changes nothing
A row's empty text value fills its field with nothing, the same as a row without a value
for that variable, and OK left every empty field out of dataset.set. An untouched OK
therefore removed the empty value, and selecting the row afterward left the previous row's
text on the art.

Edit Data Set now marks the fields that hold the row's empty text value and keeps those
values on OK. Typing in such a field, or setting it with ui.dialog.set, removes the mark, so
emptying it still unsets the variable.
2026-11-02 12:03:24 +07:00
Brandon Thomas b676c626e0 Merge pull request #5186 from dotCooCoo/fix/legacy-ai-character-rotation
Legacy .ai: type with rotated characters is written as outlines that keep the rotation
2026-11-01 23:45:34 -05:00
Brandon Thomas 9d2d633bc3 Merge pull request #5184 from dotCooCoo/fix/eps-spot-reserved-colorant-names
EPS: spot inks named All or None print as spot inks
2026-11-01 23:45:30 -05:00
Brandon Thomas d3ef9a6aae Merge pull request #5183 from dotCooCoo/fix/replace-symbol-clears-overrides
Symbols: Replace Symbol clears the old symbol's dynamic overrides
2026-11-01 23:45:26 -05:00
Brandon Thomas 01d371b744 Merge pull request #5182 from dotCooCoo/fix/pdf-spot-gradient-white-process-stop
PDF export: a white stop linked to a process swatch keeps a spot gradient on its ink
2026-11-01 23:45:21 -05:00
Brandon Thomas ff3b00e832 Merge pull request #5178 from dotCooCoo/fix/issue-3437
Fix #3437: Spiral segments follow the spiral
2026-11-01 23:45:17 -05:00
Brandon Thomas af7fb8c43f Merge pull request #5171 from dotCooCoo/fix/issue-2089
Fix #2089: Affinity strokes keep their Width tool profile
2026-11-01 23:45:14 -05:00
Brandon Thomas d58114bea8 Merge pull request #5164 from dotCooCoo/fix/issue-3818
Fix #3818: the chosen brightness holds when the system theme differs
2026-11-01 23:45:09 -05:00
.CooCoo 890c27ccb2 Native format: take the .vectorcraft envelope from craft-vectorcraft-format (#5146)
* Native format: the .vectorcraft envelope comes from craft-vectorcraft-format

vectorcraft-format reads and writes the file's envelope through the
craft-vectorcraft-format crate in craft-libs: Head and Image, the version
and size constants, the format and version check, Tail for the data after
the JSON, split_tail and entry, and base64. The constants, is_compressed,
json_part, base64_encode and base64_decode are re-exported from
vectorcraft_format, so callers do not change. load_file reads the members
it uses with Image entries and skips the preview and PDF data. The
document, its migrations, the version 1 writer, gzip writing, sniff and
the limits on decompression stay here.

A preview or pdf member of the wrong shape now reads as missing on its
own, so pdf_content still returns a file's PDF when its preview is
damaged.

A new test saves a document in every version, compressed and pretty,
with a preview, profiles and a PDF, reads it back, saves it again and
compares the bytes; it also reads each uncompressed file as the crate's
File. Another reads the PDF of a file whose preview is damaged.

* Native format: sniff from craft-vectorcraft-format, pinned at #408's head

- craft-vectorcraft-format moves to craft-libs 0fd7e75fe6, the head of
  storytold/craft-libs#408.
- `sniff` is the crate's: a file is native when its top-level `format`
  member, within the first 256 bytes after decompression, is
  `vectorcraft` or `drawcraft`, read with JSON escapes decoded. The word
  elsewhere in the head no longer counts. All 192 corpus files and
  their resaved copies get the same answer as before.
- Envelope errors other than the format and the version keep the
  crate's message instead of reading as a compressed file that unpacks
  to too much.
- A test checks that a repeated `generator`, `preview` or `pdf` opens
  and any other repeated member is refused, by `load_file` and by the
  crate's `Contents` alike.

* Native format: read through the crate's Contents and Entries

Pins craft-vectorcraft-format at 420a27f18f, the current head of
craft-libs#408, and replaces VectorCraft's own copies with the crate's:

- load_file reads the JSON through Contents::read, which also refuses
  another format or a newer version. Opened is removed. Messages are
  those of main: serde names the struct File, as main's reader did.
- In-memory data after the JSON (uncompressed files, and compressed
  files unpacked whole) is read through the crate's Entries.
  entries_within keeps its streaming reader for compressed files, whose
  data is unpacked entry by entry and is never one slice in memory.
- The streaming reader finds the marker through the crate's marker_at.
- MAX_BLOB is the crate's MAX_ENTRY (1 GiB).

save_to still writes the envelope member by member: it streams the
document into the output and looks for the images it uses as it
writes, and File would need the images before the document. A new test
checks that its output, compact, pretty and compressed, for versions 1
to 4, equals serde_json::to_vec or to_vec_pretty of the crate's File
holding the same members followed by the crate's Tail, so a change to
either side fails.

* Native format: pin craft-vectorcraft-format at craft-libs main

craft-libs#408 merged as 14d5dbb50c; the crate is unchanged from
420a27f18f. A test checks that the crate's sniff takes every layout
VectorCraft has written: the version 1 and 2 files from before the
rename, compact and pretty, and each version save_with writes.
2026-11-01 23:30:54 -05:00
Brandon ThomasandClaude Opus 5.5 bce3de36ca Legacy .ai: docs say when the rotated-type warning shows, and record the change
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 23:27:52 -05:00
dotCooCoo 1186d1f712 Affinity: pressure curves that can't be read count against the document's limit
A curve rejected for having more than 256 segments now counts the most points a curve may have against the document's pressure points, so linking it from many strokes reads it a bounded number of times. Once the points are used up, later strokes import as plain strokes with a warning.
2026-11-01 18:09:53 -08:00
dotCooCoo 880a078053 Legacy .ai: type with rotated characters is written as outlines that keep the rotation
A version 7 text object has no arbitrary-angle character rotation: its
character attributes include baseline shift (Ts), scaling (Tz) and
tracking (Tt), Tv only turns Roman characters 90 degrees in vertical
text, and the positioning operators such as Tm are ignored on reading.
Type with Character Rotation was written as editable text with the
rotation left out, so rotated characters opened upright.

Such type is now written as its glyphs' outlines, the way type 8-bit text
can't hold already is, with the warning "type with rotated characters is
written as outlines, which keep the rotation, and is no longer editable
text". The outlines keep each character's rotation, baseline shift and
scale. Type without rotated characters, and type turned a whole number of
times, is still written as text.

Docs: docs/file-format-parity.md, docs/mcp.md, docs/target-app-parity.md.
2026-11-01 16:35:49 -08:00
dotCooCoo 7984606471 EPS: spot inks named All or None print as spot inks
A Separation space whose colorant is named All paints every plate, and
one named None paints nothing (ISO 32000-1:2008, 8.6.6.4). EPS export
wrote a spot swatch's name as its colorant, so a spot color named All
printed on every plate and one named None did not print.

Such an ink is now written as All Spot or None Spot, numbered All Spot 2
and on when a spot swatch already has that name, in its Separation
space, DeviceN spaces and the %%DocumentCustomColors and
%%CMYKCustomColor comments. At PostScript Level 3, a gradient that mixes
one of these inks with another spot ink or with process or gray stops is
now a DeviceN shading instead of process colors. Registration still
writes All.
2026-11-01 16:32:41 -08:00