Commit Graph
572 Commits
Author SHA1 Message Date
BFlat 79afbedc40 Merge pull request #7818 from dotCooCoo/fix/painted-type-used-as-a-clipping-path-loses-its
Clipping: a stroked clipping type no longer moves a clip group's fill, knockout or bounds
2026-11-18 13:00:23 +07:00
BFlat 827c80416c Merge pull request #8491 from dotCooCoo/perf/pdf-patch-offset-search
PDF export: Patch::apply finds where each object moved with a binary search
2026-11-18 12:59:26 +07:00
BFlat 10b2d14d1b Merge pull request #8342 from dotCooCoo/fix/issue-1954
Fix #1954: PDF/X CMYK in the output intent's profile is written as DeviceCMYK
2026-11-18 12:57:50 +07:00
BFlat 2d5f988caf Merge pull request #8375 from dotCooCoo/perf/pdf-type3-color-scan-once
PDF import: a Type 3 font's glyph procedures are checked for color once per document
2026-11-18 12:57:14 +07:00
dotCooCoo de501d73f2 PDF export: Patch::apply finds where each object moved with a binary search
Patch::apply wrote each cross-reference entry by walking every edit, so a
pass with many edits took time in proportion to objects times edits. It
now keeps the running total of the length changes and finds, by binary
search over the edits' ends, how far each object moved. For every edit
set that apply still accepts, the written file is byte for byte the same.

An offset that no longer fits the ten digits of a cross-reference entry
(ISO 32000-1, 7.5.4) is now refused with an error instead of writing an
eleven-digit entry that breaks the table. A change in length too large
for an isize is refused with an error instead of wrapping.
2026-11-17 16:24:59 -08:00
dotCooCoo 2bc8a8f9da Merge main into fix/print-near-black-missing-swatch 2026-11-17 13:26:00 -08:00
dotCooCoo 513b4aefaa Merge main into fix/issue-1954 2026-11-17 13:17:24 -08:00
dotCooCoo 3a64d72a64 Merge main into fix/painted-type-used-as-a-clipping-path-loses-its 2026-11-17 13:15:58 -08:00
BFlat 1f84febb08 Merge pull request #8169 from dotCooCoo/fix/symbol-lookup-index
Symbols: render and SVG/PDF export find each instance's symbol in one index
2026-11-18 03:23:44 +07:00
dotCooCoo 76078f1991 PDF import: a DeviceCMYK image in a PDF/X file opens with the output intent's profile
A file whose catalog has a CMYK /GTS_PDFX output intent describes its
DeviceCMYK colors with that intent's profile. A DeviceCMYK image in
such a file now opens tagged with that profile, so a CMYK image that a
PDF/X export writes as DeviceCMYK opens with its profile again.

An image drawn where a /DefaultCMYK is in scope keeps no profile, since
the default replaces DeviceCMYK there. The scope is read per image from
the resources it is drawn with, and the image cache keeps the tagged and
untagged reads apart.
2026-11-17 10:44:47 -08:00
dotCooCoo 6007ea7b06 PDF import: a Type 3 font's glyph procedures are checked for color once per document
The scan that looks for d0 glyph procedures ran every time a page or a
form listed a Type 3 font in a font dictionary of its own, and its result
was dropped once the font had been noted. It now runs when the font is
first noted for the document. Each page still maps the font's glyphs,
and the note the import keeps for the font is unchanged.
2026-11-17 10:11:06 -08:00
dotCooCoo 2559231664 Print: a near black linked to a missing swatch keeps its faint ink off PostScript plates
On PostScript separations, up to half a percent of another ink in a color
that counts as 100% black is left off that ink's plate, so an overprinting
near black does not knock out the ink below it. A color linked to a swatch
the document does not have was left out of that rule, although it separates
from its own values like an unlinked color and Overprint Black marks it to
overprint. A 100% K with 0.4% cyan linked to such a name then stayed on the
cyan plate and knocked out the cyan under it.

A link to a missing swatch now counts as unlinked for this rule, on solid
fills, strokes, character fills and gradient stops. Spot swatches and
Registration are still excluded, and PDF plates still draw the faint ink.
2026-11-17 09:49:50 -08:00
dotCooCoo 12977ec543 Fix #1954: PDF/X CMYK in the output intent's profile is written as DeviceCMYK
A PDF/X-3 or PDF/X-4 export tagged every CMYK color with an ICC-based
space of the same profile that the output intent embeds. In PDF/X-3 and PDF/X-4, CMYK colors in the
profile of a CMYK output intent are now DeviceCMYK, and the profile is
written once, as the output intent's DestOutputProfile (ISO 32000-1,
14.11.5:
https://opensource.adobe.com/dc-acrobat-sdk-docs/pdfstandards/PDF32000_2008.pdf#page=641).

- With output.profiles none and a CMYK output intent, PDF/X-3 and PDF/X-4
  write every CMYK color as DeviceCMYK, unless colors are converted to a
  CMYK destination of another profile, which keeps its tag. Before, those
  standards tagged every color whatever profiles said.
- RGB and gray colors stay tagged, and so do CMYK colors and images in
  another profile.
- A CMYK image that carries the output intent's profile is DeviceCMYK,
  and so is every CMYK image when none makes CMYK colors DeviceCMYK. A
  CMYK JPEG then loses its ICC_PROFILE segments.
- Transparency groups blend in DeviceCMYK when CMYK colors are
  DeviceCMYK, also when the file has no ICC-based CMYK space.
- Files without a standard keep the tags that profiles asks for.
- The Save PDF dialog's note for PDF/X-3 and PDF/X-4 says that CMYK
  colors in the output intent's profile are written as DeviceCMYK.

Docs: docs/mcp.md, docs/target-app-parity.md and the document.exportPdf
params text.
2026-11-17 07:30:22 -08:00
dotCooCoo 4c47558d9a Merge main into fix/pdf-large-images-64-bit 2026-11-17 07:06:24 -08:00
BFlat c4147826a3 Merge pull request #7353 from dotCooCoo/fix/i18n-adjacent-placeholders
i18n: messages with values side by side can be translated
2026-11-17 21:32:55 +07:00
BFlat c4163015d9 Merge pull request #8311 from Hassan1305/fix-8300-pdf-fill-only-after-stroke
PDF import: a glyph filled only after one filled and stroked stays unstroked
2026-11-17 19:51:28 +07:00
BFlat 9908e10781 Merge pull request #8299 from dotCooCoo/fix/pdfx-xmp-metadata-date
PDF/X: PDF/X-4 files carry xmp:MetadataDate, equal to xmp:ModifyDate
2026-11-17 18:49:07 +07:00
HassanKhan 007180e2f3 PDF import: a glyph filled only after one filled and stroked stays unstroked (#8300)
Look::takes let a glyph filled only join a run whose glyphs were also
stroked, so after mode 2 text a mode 0 glyph took the run's stroke:
`2 Tr (B) Tj 0 Tr (C) Tj` came in as "BC" stroked throughout. A glyph
now joins only a run drawn alike (fill, stroke, overprints), so a glyph
filled only starts a run of its own and takes a stroke only when the
matched-stroke path (#8039) strokes it.

flush_stroke no longer strokes a whole run in place: a whole run goes
through the split and join code, so fill and stroke rendering glyph by
glyph still builds one stroked run.
2026-11-17 15:59:49 +05:00
BFlat 567485aa12 Merge pull request #8263 from dotCooCoo/feat/print-ink-spot-to-process
Print: Document Ink Options converts one chosen spot ink to process
2026-11-17 17:28:34 +07:00
dotCooCoo 30693f211b PDF/X: PDF/X-4 files carry xmp:MetadataDate, equal to xmp:ModifyDate
A PDF/X-4 export wrote xmp:ModifyDate and xmp:CreateDate in its XMP
metadata but no xmp:MetadataDate. The PDF/X-4 metadata edit now adds
xmp:MetadataDate next to xmp:ModifyDate, with the same value, and grows
the stream's /Length to match. When the export dates the file as modified
later, post::modification_date already rewrites every xmp:MetadataDate,
so the two dates stay equal.

PDF/X-1a, PDF/X-3, PDF/A and plain PDF exports are unchanged.
2026-11-16 23:41:52 -08:00
HassanKhan 971b13843b PDF import: translucent fill-and-stroke type stays two objects (#8015)
A fill and a stroke at the same opacity below 1 were joined into one
type object whose opacity then applies to both together, losing the
darker overlap the file composites. stroke_filled now takes a stroke
only when the fill and the stroke are opaque.

An upright glyph filled and stroked was kept as an outline for the
reshaped-outline fallback while upright glyphs filled only were not;
it is no longer kept either, so such a line can't come in as the
outlines of its stroked glyphs alone.

Docs: the #8015 entries say what is left (translucent type, and a TJ
that starts a new line part way through).
2026-11-17 11:59:20 +05:00
HassanKhan d3640da834 Merge remote-tracking branch 'upstream/main' into fix-8015-pdf-text-fill-stroke
# Conflicts:
#	docs/roadmap.md
#	docs/target-app-parity.md
2026-11-17 11:33:21 +05:00
dotCooCoo a4faf28146 Merge main into feat/print-ink-spot-to-process 2026-11-16 22:16:20 -08:00
dotCooCoo 5d57d83a7c PDF import: test opaque and masked images and the image pixel limit
- New tests: small opaque RGB and gray images are stored as RGB PNGs and an
  image with a soft mask as RGBA; an image with one row more than the
  pixel limit's square is left out with a warning.
- Gray images stay RGB on import, and a comment says why: a gray PNG
  would make the image one that a fill color colorizes.
- Doc comments and the docs line give the limits in GiB, the line moves
  next to the line about refused PDF parts, and it no longer gives a
  timing.
2026-11-16 21:02:47 -08:00
dotCooCoo 977024a4e9 PDF import: 64-bit desktop builds open images up to 4 GB and 2^30 pixels
A PDF, or a `.ai` read through its PDF part, was refused when one image
would decode to more than 1 GB, and the shared reader skipped images of
more than 2^28 pixels. On a 64-bit desktop build both limits are now 4 GB
and 2^30 pixels (`image_limits`), which `MAX_IMAGE_DECODED` and
`open_options()` share; 32-bit and web builds keep 1 GB and 2^28 pixels.
An image past the limit is refused with the same message.

An opaque image is encoded as an RGB PNG from its decoded samples instead
of building an alpha channel and an RGBA copy first.

Docs: docs/target-app-parity.md.

Part of #4366.
2026-11-16 20:16:38 -08:00
dotCooCoo 7ce855ce97 Merge main into feat/print-overprint-black 2026-11-16 19:56:05 -08:00
BFlat 685e77af6b Merge pull request #8236 from dotCooCoo/feat/print-custom-scale-link
Print: a link button keeps Custom Scale W and H equal
2026-11-17 09:49:36 +07:00
el-j a0edcf73c4 Merge remote-tracking branch 'upstream/main' into fix/pdfx-transparency-reduction-6861 2026-11-17 00:42:30 +01:00
dotCooCoo 79fdf113a5 Print: faint ink on paints marked to overprint is kept on PostScript plates
A PostScript plate drew an overprinting fill, stroke or character as
nothing when it put up to half a percent of that plate's ink down, so a
faint ink was lost from the plate. Now only a paint with no ink on the
plate is drawn as nothing, on PostScript and PDF plates alike. The one
exception is a color that counts as 100% black and is not linked to a
spot swatch or Registration: on a PostScript plate, up to half a percent
of another ink in it still counts as none, so a near black set to
overprint keeps the ink below it.
2026-11-16 15:38:42 -08:00
dotCooCoo 97a1a363b8 Merge main into feat/print-overprint-black 2026-11-16 15:09:39 -08:00
dotCooCoo 757b4f7b8f Print: Document Ink Options converts one chosen spot ink to process
Each spot ink in the Output section's Document Ink Options list now has
an icon before its name. Clicking it prints that ink as process: its art
separates onto the process plates and it gets no plate of its own, while
the other spot inks keep theirs. Clicking again keeps it as a spot ink.
While Convert All Spot Colors to Process is on, every spot ink converts
and the icons are dimmed; each ink keeps its own choice for when the
option is turned off. A converted ink's Print box, frequency and angle
are dimmed.

file.print and print.preview take convertToProcess on an output.inks
entry, and print.preview lists every document ink, converted ones
included, in documentInks.
2026-11-16 14:36:05 -08:00
dotCooCoo 7036cfb67c Merge main into feat/print-custom-scale-link 2026-11-16 12:16:47 -08:00
dotCooCoo bd624ac39f Merge feat/print-overprint-black into feat/print-custom-scale-link 2026-11-16 11:41:11 -08:00
dotCooCoo 54d33bd965 Merge main into fix/i18n-adjacent-placeholders 2026-11-16 10:35:25 -08:00
dotCooCoo 22fd959cdd Print: keep faint overprint ink on PDF plates and follow inline graphics
- A PDF plate no longer drops an overprinting paint whose ink on that
  plate is under half a percent: it draws with Darken. PostScript plates,
  which have no blending modes, still draw such a paint as nothing.
- With Overprint Black on, the art of a symbol that type shows as an
  inline graphic has its repainting instances placed too, so their own
  fill and stroke changes decide whether they overprint.
2026-11-16 10:12:41 -08:00
dotCooCoo 49240f08e1 Print: Overprint Black follows instance paints and drawn gradient colors
- A gradient's freeform points count only when its kind is Freeform, in
  the Overprint Black check and in the plate separator. A gradient of
  another kind is checked by its stops.
- Characters inside opacity mask art no longer draw with Darken on
  separations, as the mask art's fills and strokes already do not.
- With Overprint Black on, a symbol instance whose own fill or stroke
  changes or fill stain repaint its art, or whose symbol holds such an
  instance, prints as its placed art and is checked with the paints it
  prints with. Placement stays within the symbol object limit and the
  drawn depth limit, and skips hidden objects and template layers.
2026-11-16 09:54:37 -08:00
dotCooCoo b2a1e86fe9 Print: a link button keeps Custom Scale W and H equal
The Print dialog's General section (and the print preset editor) gets a
link button after Scale W and H. While it is on, typing either percentage
sets the other, and turning it on sets H to W. It is on for new settings,
dimmed with the fields unless Scaling is Custom or a tiling choice,
toggled with a click, Space or Enter, and screen readers hear its name
and on or off state. W and H now take 1 to 1000 %.

The link is saved as scale.linked with the other print settings, in the
document and in print presets. A scale saved without it reads as unlinked,
so earlier settings print as they did. print.setup, print.preview,
file.print and print.presets.save apply the same rules: one percentage
sets the other while linked, a different width and height without a
linked key turn the link off, and with linked: true (or linked: null over
a linked scale) they are an error.
2026-11-16 09:27:38 -08:00
dotCooCoo 1143546a0a Symbols: keep per-object measuring in the export walks; live walks and SVG import use the index
The export walks for type and fonts and the artboard crop shared one
SymbolBoxes for every object. A SymbolBoxes also holds measuring budgets
(effect reaches, 9-slice placements), so in a large document objects late
in a walk could be measured by estimates where main measured them exactly.
SymbolBoxes::unmeasured makes new boxes that share the name index, and each
object is measured in boxes of its own again.

- The live-object walk (render/src/live.rs) finds symbols through the
  frame's SymbolBoxes.
- SVG export's filter regions measure each object in unmeasured boxes, and
  the region boxes share the writer's index.
- SVG import keeps each imported symbol's index, so a symbol whose art
  holds instances no longer scans or indexes the list again.
- Object › Rasterize's clipping mask is left as it is on main, with
  drawn_outline_with removed.
- The symbol-read-count feature of vectorcraft-doc gives other crates'
  tests vectorcraft_doc::symbols_read. New tests check that a frame, an SVG
  export, a PDF export, the type walk and the artboard crop read the symbol
  list once among 2,000 symbols and 300 instances with drop shadows.
2026-11-16 09:07:50 -08:00
dotCooCoo 139f881f81 .ai import: a refused PDF part's error says why the editing data couldn't be read
When the import refuses a file's PDF part and its editing data can't be
read either, the error named only the PDF part. It now adds "its editing
data couldn't be read either (<why>)", as layers already do
(crates/eps/src/import.rs). The reasons come from the editing data
reader (a size limit, damaged compression) and from the private data
streams (larger than 256 MB, another filter or decode parameters,
damaged zlib data). A file without editing data, and an open with pages
picked, layers off or the editing data off, keep the PDF part's error.

Part of #4366.
2026-11-16 07:56:57 -08:00
dotCooCoo 60ae8985fc Print: Overprint Black overprints solid black art on separations
The Print dialog's Output section has an Overprint Black checkbox under
Convert All Spot Colors to Process, off by default and available with
Separations (print.setup output.overprintBlack, kept with the document
and in print presets). With it on, solid 100% process K or 100% gray
fills, strokes and characters, and gradients whose every stop (or every
freeform point) is, overprint in the printed copy, so the inks under them
stay on the other plates. Rich, RGB, Lab, spot-linked and lighter blacks
knock out. The document and its own overprint settings do not change, and
composite output ignores the option.

Plates draw an overprinting paint that puts no ink on them as nothing, so
PostScript separations keep the inks below it too. Overprinting character
fills and strokes now darken on PDF plates like fills and strokes, a type
object's own fill in a PDF is drawn with its blending mode, and Edit >
Edit Colors > Overprint Black counts a gradient with a spot-linked stop as
a spot black and a freeform gradient by its color points.
2026-11-16 07:33:12 -08:00
dotCooCoo 52b4b03920 Symbols: render and SVG/PDF export find each instance's symbol in one index
Drawing or exporting a symbol instance looked its symbol up by scanning
the document's symbol list, so a document with many instances and many
symbols spent most of a frame or an export on name comparisons. The
renderer, the SVG and PDF writers and the export walks now find symbols
through SymbolBoxes::symbol, which builds the name index once per frame,
export or walk and returns the first symbol of a name as before.

- Renderer: plain instances, inline graphics, instances with object
  effects (their art and the symbol budget) and the effect bounds.
- SVG export: instance art, symbol defs and their reuse check, and the
  paint reach of filter regions.
- PDF export: instance art, inline graphics and the brush search of
  knockout masks.
- Export warnings and artboard crops measured what each object paints
  with new symbol boxes per object, which built the name index again for
  every instance. painted_bounds_with and drawn_outline_with take the
  boxes once; Object › Rasterize's clipping mask uses them too.
2026-11-16 07:24:45 -08:00
el-j 9b80bb7807 Automated transparency reduction for PDF/X and PDF 1.3 (#6861) 2026-11-16 10:58:05 +01:00
HassanKhan cec81c81f3 PDF import: a stroke of another glyph never joins the glyph just filled (#8015) 2026-11-16 12:00:35 +05:00
HassanKhan 6f35a12cc7 PDF import: a stroke at another opacity never joins the glyph just filled (#8015) 2026-11-16 11:40:03 +05:00
HassanKhan 836d8d4a1c PDF import: a stroke matches only a glyph placed alike, and strokes only it (#8015)
Match a stroke to a filled glyph by its whole placement (origin, size,
horizontal scale, slant and direction), not just its origin, so a stroke
drawn at another size over a filled word stays type of its own. Restyle
only the matched glyphs' text instead of the rest of their run: strokes
over neighbouring glyphs gather and restyle once, so a word filled and
stroked whole stays one run, while a stroke over one glyph of a filled
word strokes that glyph alone.
2026-11-16 11:24:49 +05:00
dotCooCoo c9fcfe9006 Merge main into fix/i18n-adjacent-placeholders 2026-11-15 22:14:56 -08:00
HassanKhan f17a218cfc PDF import: text filled and stroked in one operator is one Type object (#8015)
With text rendering modes 2 and 6 the reader fills every glyph of a
text-showing operator before stroking them, but the importer only joined
a stroke to the glyph filled last, so a word shown in one Tj came in as
a stroke-only Type over a fill-only one. TextLine now records the glyphs
it fills and stroke_filled matches each stroke to its filled glyph in
order, splitting a run where the stroke differs.
2026-11-16 10:51:59 +05:00
FredApps bfe5c253f4 Merge remote-tracking branch 'origin/main' into feat/cutover-remaining-codecs
# Conflicts:
#	crates/engine/src/cmd/menucmds.rs
2026-11-16 06:35:17 +01:00
BFlat 9db3bc5ba4 Merge pull request #7952 from dotCooCoo/fix/emf-svg-symbol-art-live-effects
Export: live effects in symbol art apply in EMF, WMF and SVG
2026-11-16 08:11:28 +07:00
BFlat f15f711280 Merge pull request #7870 from dotCooCoo/fix/pdf-preserve-numbers-tagged-images
PDF export: Preserve Numbers converts tagged images from their profile
2026-11-16 08:11:02 +07:00