Commit Graph
527 Commits
Author SHA1 Message Date
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 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 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 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 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
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
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
FredApps d2b8ebfd95 Merge origin/main into feat/cutover-remaining-codecs 2026-11-16 01:57:11 +01:00
BFlat bf7fefd89e Merge pull request #7954 from dotCooCoo/feat/file-info-templates
File Info: the menu saves, imports and lists metadata templates
2026-11-16 06:55:33 +07:00
dotCooCoo 846d000486 Merge main into fix/pdf-preserve-numbers-tagged-images 2026-11-15 13:58:49 -08:00
dotCooCoo 4a816d626f Merge main into fix/emf-svg-symbol-art-live-effects 2026-11-15 13:42:39 -08:00
BFlat d87cc85a90 Merge pull request #7917 from dotCooCoo/fix/pdf-trim-artboards-keep-bleed
Import PDF: artboards on trim boxes keep the bleed between them
2026-11-16 04:29:59 +07:00
BFlat 58cb42509e Merge pull request #7805 from dotCooCoo/fix/an-image-whose-recode-fails-is-written-without
PDF export: an image whose colors can't be converted is left out with a warning
2026-11-16 04:28:53 +07:00
dotCooCoo 02f8e55c5c Merge main into feat/file-info-templates 2026-11-15 12:21:52 -08:00
dotCooCoo 0b1b948f55 Merge main into fix/pdf-preserve-numbers-tagged-images 2026-11-15 12:15:12 -08:00
dotCooCoo 1c5d5ea4ba Merge main into fix/pdf-preserve-numbers-tagged-images 2026-11-15 12:15:12 -08:00
FredApps caa62aa79f Merge remote-tracking branch 'origin/main' into work7669 2026-11-15 21:06:46 +01:00
FredApps 33b5706c7a Merge pull request #7664 from storytold/fix/restore-codec-cutover-ci
Restore shared codec cutover with CI compatibility fixes
2026-11-15 21:05:52 +01:00
dotCooCoo 329aebc68c Merge main into feat/file-info-templates 2026-11-15 11:06:12 -08:00
dotCooCoo a670cd1102 File Info: metadata templates save, import and list from the File Info menu
File Info's menu saves the fields as an XMP metadata template (into the
Metadata Templates folder next to the preferences, or any file), imports
one with a choice of three merges, lists the saved templates and opens
the folder. The import is one undo step and records nothing when no
field changes.

- file.info.saveTemplate writes the title (when it is not the
  document's name), author, author title, description, keywords,
  rating, copyright status, notice and URL that have a value.
- file.info.applyTemplate reads a file, a saved template or XMP text
  (at most 8 MB) and merges it: replace clears the fields first, keep
  takes each field the template has, append adds keywords and fills
  only empty fields. apply: false returns the merged fields without
  changing the document.
- file.info.templates lists the folder's .xmp files.
- A PDF or .ai also opens with the rating and author title its XMP
  packet gives.

Docs: docs/mcp.md, docs/target-app-parity.md.
2026-11-15 11:05:55 -08:00
dotCooCoo 3a00d5d154 Merge main into fix/emf-svg-symbol-art-live-effects 2026-11-15 10:57:59 -08:00
dotCooCoo d4bbacc3eb Export: live effects in symbol art apply in EMF, WMF and SVG
EMF, WMF and SVG wrote a symbol instance from its symbol's art as stored,
so live effects inside that art were missing: a square moved 100 pt by a
Transform effect stayed in place in the file while the canvas drew it
moved. Art whose own place is off the artboard was left out even when
the effect moved it onto it.

These exports now call bake_document_placing_symbols, as PDF, print, EPS
and DXF do: each instance of a symbol whose art needs baking is written
as that art placed by the instance and then baked, so an instance that
scales or turns its art does not scale what its effects do. EMF and SVG
clip 9-slice cells and WMF does not, as each places other instances. In
SVG those instances are written as groups; instances of symbols without
such effects still share one <symbol>. Preserve Editing still embeds the
document with its live effects.

WrittenLayers gains hidden_objects. SVG sets it with Hidden Layers on,
since it then writes hidden objects too, so a hidden instance is written
hidden with its effects applied. The other exporters leave it off.

An SVG instance nested in another instance's art was shared through
<use> when the def allowed its own transform, while the <use> writes
that transform after the outer instances'. A stroked symbol nested in a
scaled instance then drew its stroke at double weight. The check now
uses the transform the <use> writes.
2026-11-15 10:57:09 -08:00
dotCooCoo f1507ccec3 Merge main into fix/an-image-whose-recode-fails-is-written-without 2026-11-15 10:54:25 -08:00
dotCooCoo a6d9dd2881 Import PDF: artboards on trim boxes keep the bleed between them
Opening a PDF with Crop To Trim Box put each artboard 36 pt after the
one before, while the bleed boxes round the trim boxes became the
document's bleed. With a bleed over 18 pt, one page's bleed reached
into the next artboard, and a page exported with its bleed showed part
of its neighbor. The document's bleed is now read from every picked
page first, and the artboards are 36 pt apart plus that bleed on both
sides, as linked pages on their trim boxes are laid out since #7723.
2026-11-15 10:34:12 -08:00
BFlat b759c9e369 Merge pull request #7874 from dotCooCoo/fix/pdf-dont-include-profiles-removes-image-profiles
PDF export: a set Don't Include Profiles removes image color profiles
2026-11-16 01:33:00 +07:00
FredApps b652c6697c fix(codecs): keep main's behaviour where the cutover changed it
- EPS CCITTFaxDecode goes back to hayro-ccitt (main's filters.rs and data.rs):
  craft-stream-codecs decodes /K -1 /Columns 70 data to other rows
  (eps import::tests_images::ccitt_fax_images_draw). DCTDecode is main's again.
- The AI editing writer decodes through the image crate again: going through
  RGBA8 lost 16-bit sources, so their 8-bit warning disappeared
  (ai_editing::tests::sixteen_bit_images_are_written_at_eight_bits).
- Crop Image refuses an image over its allowance by header size again, with
  main's "an image of W × H pixels is too large to draw" message.
- Test fixes: colorized_images writes its gray PNGs gray again, and the PDF
  16→8-bit test expects rounding, as the 8-bit copy is made.
2026-11-15 19:01:25 +01:00
FredApps 31658546a8 fix(codecs): build the cutover against craft-libs d6cd7836d
- Test files whose image→craft-image-codecs rewrites didn't compile against
  main's newer tests go back to main's versions (engine fileio/tests.rs,
  tests_tiffbmp.rs, tests/menucmds.rs, eps tests.rs); they still use the image
  crate, which keeps its format features.
- craft_jxl::encode, craft_image_codecs::encode and Image::icc at d6cd7836d.
- jp2read and pdf export pass DecodeOptions, not Limits.
- EPS DCTDecode: grey JPEGs no longer use the image after moving it, and keep
  main's one-channel output.
- svg keeps its direct usvg dependency for main's image href code; pdf keeps
  jpeg-encoder for CMYK JPEGs.
- clippy -D warnings and rustfmt clean.
2026-11-15 18:05:45 +01:00
dotCooCoo be2f993c4b PDF export: Preserve Numbers keeps a gray image's profile when RGB is tagged as sRGB
With Preserve Numbers, a non-sRGB RGB destination and RGB colors
ICC-tagged as sRGB (the `all` profiles setting, PDF/A-2b, PDF/X-3 and
PDF/X-4), a gray image that carries an ICC profile was converted to sRGB
grays and lost its profile. It now keeps its profile there, as in the
other destinations other than sRGB.
2026-11-15 08:56:03 -08:00
FredApps 5d492ebad2 Merge #7664 (fix/restore-codec-cutover-ci) into feat/cutover-remaining-codecs
Conflicts resolved in favour of main/#7664 in the 13 source files both touched
(doc/cmyk.rs, metafile/dib.rs, pdf images, svg import/files.rs, render paint and
encode tests, trace, engine load.rs), keeping main's newer TIFF/CMYK, DIB and PDF
image fixes. vectorcraft-doc stays on main's version until its CMYK reader moves
to craft-tiff. The image crate keeps its format features, and usvg, tiff,
zune-jpeg, hayro-ccitt and jpeg-encoder stay for the readers not yet moved.
Codec crates pinned to craft-libs d6cd7836d364177661b0ae17f48a0805e83a5f32.

Also fixes the compile errors CodeRabbit flagged (jp2read DecodeOptions,
filters.rs use-after-move) and the encode() arity at d6cd7836d.
2026-11-15 17:35:43 +01:00
dotCooCoo 411310a757 PDF export: Preserve Numbers converts tagged images from their profile
With Output › Convert to Destination (Preserve Numbers), and in PDF/X-1a,
which converts the same way, a gray or RGB image that carries an ICC
profile had its numbers read as sRGB: converted as sRGB to a CMYK
destination, and kept as they were in an RGB one. Preserve Numbers keeps
the numbers of untagged content only, so such an image is now converted
from its profile to sRGB with the color settings' intent, and then to a
CMYK or other RGB destination, the document's own RGB profile included.

- An untagged RGB image keeps its numbers in an RGB destination and
  converts from sRGB to a CMYK one, as before.
- A gray image is converted to sRGB grays in an sRGB destination and
  keeps its profile in the others.
- With RGB colors ICC-tagged as sRGB, the image is written as sRGB.
- A profile the color engine can't read leaves the image as it is in an
  RGB destination, and its numbers read as sRGB in a CMYK one, with a
  warning each.
- The table for an RGB destination is built only when the first tagged
  image needs it.
2026-11-15 07:28:29 -08:00
dotCooCoo ec4a1ac25d PDF export: a set Don't Include Profiles removes image color profiles
When Profile inclusion is set to Don't Include Profiles (`profiles:
"none"`), gray, RGB and CMYK images are written in device color spaces
without their ICC profiles, and a JPEG that is kept as is loses its
APP2 ICC_PROFILE segments. PDF/A-2b, PDF/X-3 and PDF/X-4 keep tagging
their images.

Leaving the setting out keeps the earlier output. `profiles` now
serializes as null when not set, `"default"` clears a preset's value,
and Save PDF > Output lists Default first. Presets and stored settings
saved earlier hold `"profiles": "none"`, so exports from them now drop
image profiles.
2026-11-15 07:27:08 -08:00
dotCooCoo 0f7c46b04f PDF export: an image whose pixel data can't be read still warns that it couldn't be decoded
When the Output settings convert colors, a color image whose pixel data
can't be read was left out with the "couldn't be converted" warning, as
if it could have been written in its own colors. Such an image can't be
written at all, so it is again left out with the "couldn't be decoded"
warning, as every other PDF export does. Only an image beyond the decode
allowance, or one whose header can't be read, is left out as
unconverted.
2026-11-15 07:20:32 -08:00
dotCooCoo 9d9b69a544 PDF import: an isolated group with overprinting art inside stays isolated
The importer kept a group's isolation only when something inside it
blended, so an isolated group or knockout group whose objects only
overprint read back without isolation. Written out again, it lost its
/I true and its overprinting objects then kept the inks of the art below
the group that they had covered. Isolation is now also kept when a
visible fill or stroke inside, or characters' fill or stroke, overprints,
directly or through children that do not isolate.
2026-11-15 06:46:56 -08:00
FredApps c9cad8d017 Merge main into fix/restore-codec-cutover-ci
Port main's new variable-library parsing (variable kinds, image, visibility
and graph values) from roxmltree to craft-xml with the branch's strict
options and attribute validation. Keep both sides' variable tests.
Drop the stale docx::nesting doc link.
2026-11-15 15:43:44 +01:00
dotCooCoo 5ce407dfbf Merge main into fix/an-image-whose-recode-fails-is-written-without 2026-11-15 06:17:33 -08:00