.ai import: legacy type used as a mask clips its clipping group

In the legacy format, `Tr` sets the rendering mode of the type that
follows. Section 5.7 of the version 7 specification says that modes 4 to
7 make the text object a mask: 4, 5 and 6 also fill, stroke, or fill and
stroke it, and 7 paints nothing. Sections 15.3.2 and 15.4.5.1 add that
these modes are used in pattern definitions, and the reader does not
read type in a pattern. The reader painted 4 to 6 like 0 to 2 and never
clipped, so the art a text mask clips showed whole.

A text object with characters in modes 4 to 7 is now a clipping path of
its clipping group (`q` ... `Q`, or the layer), as a path painted with
`W` is, and the whole object is the mask. Beside other clipping paths it
nests as they do, and the mode lasts into later text objects. Area type
with linked areas (threaded frames, also when the reader's limits keep
one frame), and type in wraparound text or in a compound path, a group
inside them included, doesn't clip, with a warning.

A `Tr` operand that is not a whole number from 0 to 9 now leaves the
mode as it was; before, 4.5 read as 4 and -4 hid the type.

The new warning and the reader's warning about linked type areas left
out get rows in every catalog.
This commit is contained in:
dotCooCoo
2026-11-05 21:18:44 +07:00
committed by bflatastic
parent cbb09c70d2
commit 6e2a32c2a0
30 changed files with 272 additions and 4 deletions
+4
View File
@@ -131,6 +131,10 @@ private editing data. VectorCraft:
with a fill's offset, scale, rotation, reflection and shear applied before its matrix.
Its area type with several linked areas opens as threaded frames, one for each area with its own matrix,
and the story flows through them.
Legacy `.ai` type set in rendering modes 4 to 7 (`Tr`, text used as a mask) is a clipping path of its
clipping group, as a `W` path is, and the mode lasts into later text objects. Type in linked areas, in
wraparound text or in a compound path doesn't clip, with a warning. A `Tr` operand that is not a whole number
from 0 to 9 leaves the mode as it was.
with a fill's offset, scale, rotation, reflection and shear applied before its matrix. Its linked images in
the version 7 form (`(path) modified XG`, then `XF` with no samples) come in as linked images of their files,
showing a placeholder where the image goes until the file is relinked in the Links panel.