Commit Graph
355 Commits
Author SHA1 Message Date
jmvergesandClaude Opus 5.5 ae9ab1bc06 PDF import: DeviceN images of one ink or of process plates keep their inks (#6348)
An image in a DeviceN color space opened as an RGB image, losing its inks.

One of one colorant now opens as a Separation image does since #6347: a
grayscale image of its tints colorized by its ink. One of two to 32
colorants that are all process plates (the ink None may be among them)
opens as a CMYK image, each colorant's tint in its plate, its Decode array
applied (8 or 16 bits a sample). A DeviceN image that mixes a spot ink
with other colorants, such as a duotone, still opens as RGB.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 03:09:42 +00:00
jmvergesandClaude Opus 5.5 0aeb8e8792 .ai import: images in a spot ink's Separation space keep their ink (#6350)
An image whose color space XC sets to one ink (n [c m y k /DeviceCMYK
(name) /Separation] XC) opened as a gray RGB image: its samples, the ink's
tints (255 at 100 %), were read as gray levels, so the tints drew inverted
and the ink was lost.

It now opens as a grayscale image of the tints, black at 100 %, colorized
by the ink at 100 %: its spot swatch, a process plate's CMYK color, or
Registration. Its alpha channel becomes its opacity mask, a reduced large
image's too (a colorized image reduced to fit the limits no longer keeps
its alpha in its pixels). 8-bit and 1-bit samples, binary or in hex
comment lines. A device space and the ink None change nothing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 02:07:53 +00:00
Ahmed Gomaa 323b3385bc Merge remote-tracking branch 'upstream/main' into fix/pdf-import-actualtext 2026-11-09 22:42:50 +02:00
Ahmed Gomaa 9fda083329 Merge remote-tracking branch 'upstream/main' into fix/pdf-import-actualtext 2026-11-09 20:49:32 +02:00
jmvergesandClaude Opus 5.5 ca59598cd7 PDF import: Separation images keep their ink (#6314)
An image in a Separation color space opened as an RGB image: its spot ink
was lost (no plate in Separations Preview), and Fill and Recolor Artwork
didn't reach its color.

It now opens as a grayscale image of its tints (white where it lays no
ink, black at 100 %, its Decode array applied; 1 to 16 bits a sample, or
one gray channel from its JPEG, CCITT, JBIG2 or JPEG 2000 decoder),
colorized by its ink at 100 %: the spot swatch, a process plate's CMYK
color, or Registration. Its mask becomes its opacity mask, as a CMYK
image's does. The ink is found by the image's color space among those the
file defines, once per image. The ink None, an ink whose color can't be
told, images inside an alpha soft mask, inline images and DeviceN images
open as before; samples that can't be read open in RGB with a warning, and
the ink gets no swatch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 18:39:46 +00:00
Ahmed Gomaa 9ffea06f82 Merge remote-tracking branch 'upstream/main' into fix/pdf-export-mark-text 2026-11-09 19:12:24 +02:00
Ahmed Gomaa f2c4743072 Merge remote-tracking branch 'upstream/main' into fix/pdf-import-actualtext 2026-11-09 19:12:14 +02:00
Ahmed Gomaa 9b797c06d1 PDF export: letters with marks are written once in the text layer
A mark glyph's vertical translation started a new draw_glyphs batch, so
krilla received the cluster's source range again and mapped its
characters twice. Copying or searching the exported PDF then found
doubled letters for Arabic harakat in any font, and for every dotted
letter in fonts that draw dots as zero-advance mark glyphs (Noto Sans,
Naskh and Kufi Arabic).

Keep compatible glyphs on the same layout line in one batch and carry
their relative vertical placement as per-glyph y_offset; horizontal
placement is unchanged (next_x - x advances). Font, size, linear
transform, line/column, paint run, list marker and hyphen boundaries
still split batches. Krilla keeps owning cluster mappings and
ActualText. No importer change.

Regressions decode the content stream and ToUnicode maps: one batch per
layout line, no duplicated cluster assignment, one ActualText per
multi-glyph cluster, contours within 0.05 pt of outline export; mixed
scripts, vertical columns, path rotations and PDF/X variants covered.
The reader round-trip stays an ignored test until the importer consumes
ActualText (#6165).

Addresses #6309.
2026-11-09 18:13:14 +02:00
Ahmed Gomaa 6e71211a16 PDF import: preserve authored text in ActualText spans
Editable PDF import derived characters from glyph Unicode/CID mappings
even when the enclosing marked-content sequence supplied /ActualText.
A span that paints "xy" but says "AB", followed by "C", imported "xyC".

Track the outermost replacement owner per span (absent, explicitly
empty, consumed), decode it with the existing PDF text-string decoder,
emit it once at the first placeable glyph, and let the remaining glyphs
of the span advance the pen without phantom character slots or
inferred spaces. Authored stretches keep their logical order while
adjacent ordinary text still goes through visual-to-logical
reconstruction. Glyph identity still drives font matching. Depth and
size are bounded; oversized or unbalanced spans fall back to glyph
mappings with a warning.

Outlines mode and PDF export are unchanged. Parity docs updated,
scores unchanged.

Fixes #6165.
2026-11-09 17:43:28 +02:00
jmvergesandClaude Opus 5.5 def928c0dc PDF import: image masks open colorized by the color they are painted in (#6313)
A PDF image mask (`/ImageMask true`) painted in a solid color opened as an
RGB image with the color in its pixels: Fill and Recolor Artwork didn't
reach the color, a spot color lost its ink, and the same mask painted again
in another color took the first one, because the painted image was cached
by the mask alone, and so did an uncolored pattern whose cell draws a mask.

It now opens as a grayscale image of what it paints, colorized by that
color, as the .ai reader opens a 1-bit image mask (#5790). A spot color
keeps its swatch and tint. The page's walk counts paths, not images, so the
ink is found from the color space. Readings of a pattern cell are told
apart by colorized images' colors too. Inside an alpha soft mask, or
painted with a pattern, a mask opens as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 14:43:13 +00:00
Don Omondi 9d23da0c41 EPS/.ai editing data: a ligature glyph named by a private-use character matches its text object
When the page's type is matched with the text objects, page words are also
split at private-use characters (from uniXXXX ligature glyph names such as
/uniE028 for a "ti" ligature) and each piece is matched as its own word, so
"Quality" set with that ligature matches its text object and the layers are
read without a false note.
2026-11-09 04:43:53 -05:00
Don Omondi f71c6aaf5b EPS import: CIDFonts only named, over a Unicode CMap, set their characters as live type
A CMap name of the public Unicode CMap form (UniJIS-UCS2-H, UniGB-UTF16-H
and similar) is understood without being defined in the file, so type in a
CIDFont the file only names decodes to its Unicode characters and is set as
live type.
2026-11-09 03:48:35 -05:00
Don Omondi dc00c31a24 EPS import: CMap mappings to base fonts' codes and glyph names draw their glyphs
bfchar and bfrange mappings are kept in the CMap and carried over by
usecmap. A code mapped to a character code draws that code in the base font
usefont named; a code mapped to a glyph name draws that glyph.
2026-11-09 03:48:35 -05:00
Don Omondi 6854529b83 EPS import: CID-keyed fonts in a FontSet's CFF data draw their glyphs
Each CID-keyed font in a FontSet's CFF data is defined as a CIDFont named by
the CFF Name INDEX, with its glyphs found by CID through the charset and
FDSelect, so a composefont over it draws its type.
2026-11-09 03:48:35 -05:00
Don Omondi eb8b8b2850 EPS import: kshow runs its procedure between the characters of live type
Between each two characters the kshow procedure runs with the two codes and
the current point after the first, in any font, not only Type 3 fonts. Where
it moves the current point the next character follows, kept as tracking.
2026-11-09 03:48:35 -05:00
Don Omondi 1b7c648da6 EPS import: embedded Type 1 fonts draw and space their type with their own glyphs
An embedded Type 1 font's eexec part is decrypted and its charstrings read,
so its glyphs and widths are used instead of the installed or fallback
font's. Codes are decoded through the font's Encoding, so fonts that place
glyphs at low codes no longer lose their type.
2026-11-09 03:48:35 -05:00
Don Omondi fde5a5fbef EPS import: CID-keyed fonts draw the glyphs of the CIDFonts the file carries
Adds composefont, the CIDInit and FontSetInit procedure sets and the CMap
operators, so EPS with CID-keyed fonts (as pdftops -level3 writes) opens.
Type 0 fonts with FMapType 9 decode their codes through the CMap's codespace
ranges and CID mappings, and the Identity CMaps are predefined.
2026-11-09 03:48:35 -05:00
Don Omondi 7a25b86a75 EPS import: Type 42 fonts take their characters and widths from the font they carry; show spacing kept as tracking
A plain Type 42 font now maps each code to its character through its glyph
names, or through the glyph its CharStrings give it in the font's own
character map or post names, instead of reading the code as Latin-1. The
font's own widths move the current point, charpath outlines its glyphs, and
the show operators' spacing and the embedded widths are kept on live type as
tracking. Type shown under nulldevice no longer appears.
2026-11-09 03:48:35 -05:00
Don Omondi 1d9833f7de Merge remote-tracking branch 'upstream/main' into fix/eps-memory-cap
# Conflicts:
#	docs/file-format-parity.md
2026-11-09 01:53:05 -05:00
BFlat 977ce06c10 Merge pull request #6018 from mockydevs/fix/eps-sampled-function-shading
EPS import: sampled functions interpolate between their samples (function shadings no longer come in as flat blocks)
2026-11-09 14:45:38 +08:00
Don Omondi 2aa23047fb Merge remote-tracking branch 'upstream/main' into fix/eps-memory-cap
# Conflicts:
#	docs/file-format-parity.md
2026-11-09 00:54:37 -05:00
BFlat fbf43fccf0 Merge pull request #5200 from dotCooCoo/fix/ai-os23-3678
.ai import: objects with a centered variable-width stroke come in as their drawn outline
2026-11-09 13:48:39 +08:00
Don Omondi a27bd53a39 Merge remote-tracking branch 'upstream/main' into fix/eps-sampled-function-shading
# Conflicts:
#	docs/file-format-parity.md
2026-11-09 00:32:17 -05:00
BFlat d90cc305fa Merge pull request #6148 from magyarb/fix/ai-right-aligned-tabs
.ai/EPS import: type keeps its tab stops, and right-aligned lines with tabs lay out as the file's page
2026-11-09 13:18:23 +08:00
Don Omondi 086b67e93f Merge remote-tracking branch 'upstream/main' into fix/eps-sampled-function-shading 2026-11-09 00:01:46 -05:00
dotCooCoo d3d56f01ce Merge main into fix/ai-os23-3678 2026-11-08 20:58:09 -08:00
BFlat baa7248e76 Merge pull request #5158 from dotCooCoo/fix/ai-os23-2831
.ai import: names that aren't UTF-8 can be read in a legacy code page
2026-11-09 12:46:30 +08:00
M Balazs PC 68133cc731 Merge remote-tracking branch 'origin/main' into fix/ai-right-aligned-tabs
# Conflicts:
#	docs/file-format-parity.md
2026-11-09 05:45:48 +01:00
dotCooCoo 09cbf2b8f9 Merge main into fix/ai-os23-3678 2026-11-08 20:24:23 -08:00
Don Omondi 6199fcccf3 Merge remote-tracking branch 'upstream/main' into fix/eps-sampled-function-shading
# Conflicts:
#	docs/file-format-parity.md
2026-11-08 23:15:30 -05:00
M Balazs PC b64cfed610 Merge remote-tracking branch 'origin/main' into fix/ai-right-aligned-tabs
# Conflicts:
#	crates/text/src/layout/flow.rs
#	docs/file-format-parity.md
#	docs/roadmap.md
#	docs/target-app-parity.md
2026-11-09 04:48:48 +01:00
dotCooCoo 3258785476 Merge main into fix/ai-os23-2831 2026-11-08 19:44:24 -08:00
dotCooCoo 89b61de7f1 Merge main into fix/ai-os23-3678 2026-11-08 19:39:45 -08:00
dotCooCoo df100e978f Merge main into fix/ai-os23-3678
Only a Stroke Style filter's widths written as one centered array come in as the drawn look. A Stroke Offset stroke and widths written for each side stay live with their profile.
2026-11-08 19:39:44 -08:00
Don Omondi 534c44a871 Merge remote-tracking branch 'upstream/main' into fix/eps-sampled-function-shading
# Conflicts:
#	docs/file-format-parity.md
2026-11-08 22:34:40 -05:00
Don Omondi d15f7fbfba Merge remote-tracking branch 'upstream/main' into feat/ai-import-stacked-fills 2026-11-08 22:02:57 -05:00
dotCooCoo d3a323284c Merge main into fix/ai-os23-2831 2026-11-08 18:52:59 -08:00
Don Omondi 8c8d88e286 Merge remote-tracking branch 'upstream/main' into feat/ai-import-stacked-fills
# Conflicts:
#	crates/eps/src/import/ai/tests.rs
#	docs/file-format-parity.md
2026-11-08 21:08:47 -05:00
dotCooCoo 0fc62c2cf3 Merge main into feat/jxl-import 2026-11-08 18:04:51 -08:00
dotCooCoo aa74ee433c Merge main into feat/jxl-import 2026-11-08 16:52:56 -08:00
Don Omondi 499a78b0bf Merge remote-tracking branch 'upstream/main' into fix/ai-import-brushes
# Conflicts:
#	docs/file-format-parity.md
#	docs/target-app-parity.md
2026-11-08 19:21:57 -05:00
BFlat 7724463e00 Merge pull request #5991 from mockydevs/fix/eps01-editing-overlay
EPS import: gradients drawn as abutting strips come in as one gradient, without seams
2026-11-09 07:57:02 +08:00
BFlat 22f5ede66f Merge pull request #6161 from dotCooCoo/feat/ai-editing-data-s6b2
.ai save: the editing copy keeps graphic styles and links to them
2026-11-09 07:52:12 +08:00
Don Omondi abeb7e3167 Merge remote-tracking branch 'upstream/main' into fix/ai-import-brushes
# Conflicts:
#	docs/file-format-parity.md
#	docs/target-app-parity.md
2026-11-08 18:18:16 -05:00
dotCooCoo 230fbb96a3 Merge main into feat/ai-editing-data-s6b2 2026-11-08 15:00:10 -08:00
dotCooCoo b8ab981058 Merge main into feat/ai-symbol-libraries 2026-11-08 14:56:51 -08:00
Don Omondi 8383b2af6d Merge remote-tracking branch 'upstream/main' into fix/eps01-editing-overlay
# Conflicts:
#	docs/file-format-parity.md
#	docs/gaps.md
2026-11-08 17:39:34 -05:00
M Balazs PC b3fb745575 Merge remote-tracking branch 'origin/main' into fix/ai-right-aligned-tabs
# Conflicts:
#	crates/text/src/layout/flow.rs
2026-11-08 22:25:23 +01:00
dotCooCoo c4de0035b2 .ai import: the editing-copy paragraph in the file-format doc appears once again
docs/file-format-parity.md held 35 copies of the paragraph under
"Illustrator's private editing data" after #6202 left one, each copy
carrying a different set of the changes merged since. The section now
holds one copy with every clause from the others: placed PDF and .ai
pages as placed documents, Bas Relief among the single-effect art
styles, Bas Relief's settings block in type's art style, the fill a
clipping path keeps with its exceptions, paths with an Art brush, the
spot colors in brush art, symbols defined before the art styles
section, the Type on a Path options, and the artboards the type of a
PDF's later pages goes to.
2026-11-09 03:14:41 +07:00
dotCooCoo 11f1d228de Type: Align to Path moves each character by its own font's metrics
Align to Path moved the whole line by the largest ascent and descent
among its characters. Each character now moves by its own font, size
and vertical scale. Ascender runs the top of the font's em box along
the path: the ideographic em box that the font's BASE table gives, or
in a Chinese, Japanese or Korean font the one that its typographic or
hhea box, a one-em box-drawing cross or its ideographs give; else an
em box centered on the cap height. Descender runs the bottom of the font's
bounding box along the path, and Center runs a line at half the height
of the top of the font's H along it. In vertical type, Ascender and
Descender move the characters half an em, and Center leaves them on
the path.

Existing documents with Align to Path set to Ascender, Descender or
Center lay their type out at a new distance from the path.
2026-11-09 03:14:41 +07:00