Skip to content

.ai import and .ai save: type painted with a spot colour comes in as RGB and goes back out as RGB #9768

Backlog

Description

@koolbrand

What happens

When a .ai opens from its editing data, a character's fill (key 53) is a CAITextPaint whose key 0 holds a colour and whose key 5 names an art style in %AI9_BeginArtStyles. For type painted with a spot swatch, Illustrator writes an RGB proxy under key 0 (kind 1), and the spot colour itself lives only in the named art style:

/53 << /99 /CAITextPaint /5 (Anon 1) /0 << /0 1 /1 [ 1.0 0.0 .18431 .52941 ] >> >>

/KnownStyle : (Anon 1) /Name ,
/SimpleStyle : 0 O
1 0.832394897937775 0.274601370096207 0.08960098028183 20.7842998504639 13 -56 (PANTONE 287 C) 0 2 Xx
0 1 0 0 0 Xy ... /Paint ; /Def ;

import/ate.rs already follows key 5, but only into self.patterns (#6856 / #6864). A style that paints with Xx is not looked up, so the type comes in with the RGB proxy instead of the swatch. Paths painted with the same swatch keep it.

On save to .ai, ai_editing/writer/texts.rs writes the run's fill as a SimplePaint without the swatch link (as TYPE_ATTRIBUTES says), and writes the swatch's Lab colour as RGB. Illustrator then converts that RGB with its own colour settings.

Steps (synthetic, as in the import tests)

  1. In the art styles, add a style (Anon 1) whose /SimpleStyle paints with a spot colour: 1 0.83 0.27 0.09 20.78 13 -56 (PANTONE 287 C) 0 2 Xx. The swatch is also in the palette.
  2. Give point type "ab" the fill /53 << /99 /CAITextPaint /5 (Anon 1) /0 << /0 1 /1 [ 1.0 0.0 .18431 .52941 ] >> >>.
  3. Open the file. Then save it as .ai and open that in Illustrator.

Expected: "ab" is filled with the swatch PANTONE 287 C at 100 %. It keeps its own separation and exports as that spot colour. Saved back to .ai, it is still linked to the swatch in Illustrator.

Actual (measured with a real Illustrator 2026 file, VectorCraft 0.24.1, macOS):

  • On import, the type's fill is RGB (0, 0.184, 0.529), unlinked.
  • In a PDF/X-4 export, it prints as process CMYK 100/95/7/0. No PANTONE 287 C separation for that type.
  • Saved as .ai and reopened in Illustrator, it is process CMYK 100/86.3/22.6/4.9. Illustrator's own CMYK alternate for that swatch is 100/83.2/27.5/9.0.

So one swatch ends up as three different process colours, and the spot plate loses the type.

Possible fix: resolve a key-5 style that paints with Xx the same way #6864 resolves patterns (swatch name and tint). On save, write the CAITextPaint with key 5 and a /KnownStyle for runs linked to a spot or global swatch.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions