.ai import: version 7 palettes keep their swatches without names

Version 7 files write each palette swatch as its paint and `Pc`, with no
name. The reader only kept a swatch with a name before `Pc`, so such a
palette gave no swatches and the document got the default set.

A swatch without a name is now named by its spot color, gradient or
pattern, or by its values in the format the swatch import already uses
for unnamed colors ("Gray K=25", "C=25 M=0 Y=0 K=0"). `Pn` and a `Pc`
with no paint before it add nothing. Named swatches keep their names.

An operator the reader does not know, or a `Pg`, now ends the paint
before it, so a later `(name) Pc` no longer takes that paint. The
swatch limit is kept with a running count instead of summing every
group at each `Pc`.
This commit is contained in:
dotCooCoo
2026-11-01 06:55:53 -08:00
parent 05d5f99fd7
commit f1fd255120
4 changed files with 149 additions and 25 deletions
+2
View File
@@ -49,6 +49,8 @@ private editing data. VectorCraft:
A PDF-compatible `.ai` opens on its PDF part's trim boxes (its artboards), the bleed boxes round them
becoming the document's bleed, so art in the bleed shows outside the artboard, within the bleed guide (#1266).
A PDF saved with its editing data (`AIPDFPrivateData`) opens the same way.
The swatches of a version 7 `.ai` palette, which carry no names, come in named by their spot color, gradient or
values.
- **Writes** a PDF-compatible `.ai` (Save As › `ai`): Illustrator opens it as plain art. It never writes
Illustrator's private editing data, which is undocumented.
- **Writes** a legacy `.ai` of version 7 (Save As › `ai` › Version: Legacy (version 7), `aiVersion: "7"`): the