Commit Graph
1125 Commits
Author SHA1 Message Date
BFlat d48c4207f7 Merge pull request #9102 from dotCooCoo/feat/colorized-image-overprint
Images: Overprint Fill makes a colorized image's color overprint
2026-11-24 16:39:55 +07:00
BFlat c3c02f81e0 Merge pull request #9128 from dotCooCoo/fix/print-fonts-setting
Print: the Fonts setting chooses how PostScript output sends type
2026-11-24 16:06:58 +07:00
dotCooCoo 116a8c2411 Overprint: a white spot ink keeps overprinting with Discard White Overprint
With Discard White Overprint on, PDF export, Overprint Preview,
Separations Preview and printed separations took the overprint off any
white paint, including a tint above 0% of a spot swatch whose color is
white, which prints as that ink. Such a tint now keeps its overprint in
fills, strokes, character paints and a colorized image's color; process
white and a 0% tint still knock out.

DiscardWhite holds the setting and the document's spot inks, and
Document::discards_white_overprint gives the same answer for the PDF and
EPS writers.
2026-11-24 00:45:00 -08:00
dotCooCoo 1d2c274466 EPS: a colorized image in a white spot ink keeps overprinting
Discard White Overprint removed the overprint of a colorized image whose
color was white, even when that color was a tint of a spot swatch, which
the EPS writer still writes as that spot ink. A spot white now keeps its
overprint; process white still knocks out.

Document::spot_ink tells a tint above 0% of a spot swatch with a solid
color apart from paper white.
2026-11-23 04:57:10 -08:00
dotCooCoo a6572d450a Merge main into feat/colorized-image-overprint 2026-11-22 22:38:01 -08:00
dotCooCoo 5f611efdce Images: colorized image overprint skips clear rows, preview pixels and discarded white
- A fill or stroke with an opacity of 0 no longer counts as a row that draws on a
  colorized image, so it does not stop the image overprinting as a whole.
- On printed plates, an overprinting colorized image whose pixels do not take its
  color knocks out and prints as those pixels, instead of being hidden on the
  plates its color has no ink on.
- EPS export writes a white colorized image knocking out when Discard White
  Overprint is on, instead of leaving it out of the page.
2026-11-22 17:28:46 -08:00
5af36bae87 Fix #4568: PDF import keeps embedded fonts for text whose family isn't installed (#4569)
* PDF import: keep embedded fonts for text whose family isn't installed

Glyphs drawn in an embedded font whose family isn't available are gathered
during import and built into one small TrueType font per family and style,
kept with the document (font/ttf blob). Text objects record the fonts and a
hash of their text: layout and rendering draw them in the kept font until the
text is edited (undo restores it) or the family is installed. Lines are
spaced against the file's own widths with per-glyph placement (#3756).

* PDF import: satisfy crate layering constraints without format dev-dep

* FileFont: negate us_win_descent in i32 to prevent overflow on extreme negative descenders

* PDF import: a kept font carries the file font's licence flags, and the docs say what that means

Review of #4569: the fsType of the file's font is copied to the font built from its glyphs (a test pins it against Embedding), so exports honour it; the docs state the limits, that the file's font program is not parsed, and that a saved file carries third-party glyphs.

* PDF import: a glyph curve far outside any glyph is left out; docs say what the limits and the font program mean

CodeRabbit on #4569: coordinates beyond 1e6 font units are refused before the curve is subdivided. The docs say the 64-font limit is what draws one type object and that the file's font program is read only for its licence flags and metrics.

* PDF import: two programs of one font keep the stricter licence flags; the docs cite their sources

CodeRabbit on #4569: embedded programs of one family and style share one built font, which kept the first program's fsType; it now takes the stricter of the two, whichever came first. The docs entry cites the Acrobat Help pages and the OpenType fsType specification.

* fmt

* PDF import: embedded fonts are on by default, with an opt-out preference

Owner decision on #4568. Preferences > File Handling > Use fonts embedded in imported PDFs (pdfImportEmbeddedFonts, on by default) and the embeddedFonts param of document.open and file.place: off, a PDF's type in a font the machine lacks is set in the fallback font with the missing-font warning, as before. One test each for on and off, one for the preference reaching the options.

* fmt after merging main

* docs: restore the status lines damaged by merges (main's line plus this PR's note)

* PDF import: set embedded_fonts through a builder method (keeps read_opened under the complexity limit)

* PDF import: move the missing-font notes out of read_opened (complexity limit after the merge)

* #4569: isolate file-font resources and reclaim live faces (UNVERIFIED)

* Preserve carried-font ownership across placement and recovery

* Fix carried-font regression test dependencies and unwind probe

* Use explicit OS2 heights in owned-font reference regression

* Keep native font regression artwork inside document layers

* fix(engine): bind file fonts when reading document profiles

* test(engine): initialize file-font leases in new image fixtures

* test: complete file-font lease initialization in image fixtures

* docs: keep the #4568 entry in the file-format parity status line

* fix(pdf): keep a line with another glyph for the same character as outlines (review)

A font kept with the document has one glyph per character. A glyph of the file's font that
differs from the one already kept for its character (a stylistic alternate that maps to the same
Unicode scalar) marks its line, which is imported as outlines so each glyph draws as the file
does.

* docs: resolve the leftover status-line conflict

* Placed document blob: give the new ImageBlob literal its file_font

* Test: a PDF's two glyphs for one character survive a native save and reopen as the file draws them

* Test: move the native save and reopen half of the two-glyphs regression to the engine (layers: no format dev-dep in pdf)

* Fix embedded-font preference help and English fallback checks

* Format embedded-font preference help with the workspace edition

---------

Co-authored-by: FredApps <FredApps@users.noreply.github.com>
Co-authored-by: skylartaylor <hi@skylar.cc>
2026-11-22 18:18:18 -06:00
dotCooCoo f7a5e3991d Print: type left out for the page limit sends none of its glyphs
When an object passes the page body limit, the walk takes its body,
image placements and image codes back out. The glyphs it showed through
the job's fonts stayed in the page's font list, so Subset sent fonts for
type that was not printed, and Complete could send whole fonts for a face
no printed object uses. The walk now records the glyphs each object adds
and takes them back out with the rest.

Tests: the glyphs of an object left out for the limit are not in the
page's font list, and ruby readings print as outlines in place while the
base text shows through the font.
2026-11-22 11:52:43 -08:00
dotCooCoo c067c20788 Images: colorized image overprint follows every painting effect and gray ink in EPS
- Overprint Preview, Separations Preview and printed separations show a
  colorized image knocking out when it has any visible effect of its own
  that paints colors (a shadow, a glow, a raster effect, a color
  adjustment or a plug-in effect). Only the geometry effects leave it
  overprinting; a test keeps that list equal to the geometry effects of
  the effect catalog.
- EPS export writes an overprinting colorized image in a gray color as
  black ink alone (a DeviceN image at Level 3, a Separation image at
  Level 2), so it keeps the cyan, magenta and yellow below.
- On an EPS separation plate, an overprinting image without the plate's
  ink is left out only while overprints are preserved.
- Reading a legacy .ai file, a colorized image mask takes the fill
  overprint in force, as it takes the fill color: its own O, or the last
  O before it.
2026-11-22 09:38:04 -08:00
dotCooCoo e3d10ec15e Images: colorized image overprint keeps main's white rule and skips painted effects
White now follows the rule main has for white fills: with Discard White
Overprint on, PDF export, the previews and printed separations knock a
white color out, and EPS export turns overprinting on as it does for
fills and strokes. The changes to EPS output for white fills and to white
spot inks are no longer part of this change.

- The previews and printed separations treat an image with a visible
  drop shadow, outer glow or Gaussian blur of its own as knocking out, so
  the effect is not darkened or hidden with the image.
- Legacy .ai reading takes an image mask's fill overprint only from an O
  written after the previous object, not from the path before it.
- A fill of None, which takes the color off, also turns its overprint off.
- On a PostScript separation plate, an overprinting image whose color puts
  none of the plate's ink down is left out while a fill or stroke of it
  still draws, and an image that does not overprint as a whole knocks out.
- PDF export writes an overprinting gray color as an image of black ink
  alone, so the other process inks below it stay.
2026-11-22 08:48:09 -08:00
dotCooCoo 23ad161d30 Print: the Fonts setting chooses how PostScript output sends type
The Graphics section's Fonts setting was stored but no print writer read
it: PostScript output always drew type as glyph outlines.

- Subset (the default) defines, in each page's setup, Type 3 fonts drawn
  from the faces' outlines that hold only the glyphs that page shows.
- Complete defines every glyph of each face the job shows once, in the
  job's setup, and fails with an error before writing anything when the
  definitions would take more than 64 MB.
- None sends no font program: each page asks for the printer's copy by
  its PostScript name (%%DocumentNeededResources, %%IncludeResource) and
  names each glyph in an encoding, with a note naming each font.
- Type in a gradient or pattern, color glyphs, glyphs bent along a
  curved path, ruby and, under None, glyphs without names stay outlines.
  So does type in a font whose license forbids embedding, or, under
  Subset, allows only whole embedding, with a warning.
- Only the sheets the print order prints are drawn.
- PDF print still embeds font subsets; None and Complete add a note
  saying so, in the print and its preview.

Docs: docs/mcp.md, the print.setup params text, docs/target-app-parity.md.
2026-11-22 08:40:41 -08:00
dotCooCoo 100a954317 Images: an overprinting colorized image keeps the inks its color leaves out
- EPS export writes an overprinting colorized image in a CMYK color in
  only the process inks the color puts down: one DeviceN image at
  Level 3, one Separation image per ink at Level 2. A pass turned away
  at the page limit takes back the passes before it, and the encoding
  cache keeps overprinting and plain encodings apart.
- A fill or stroke of a colorized image counts as drawing only with a
  visible Convert to Shape or Outline Object (one shared list with the
  effects crate), so another effect, such as Offset Path, no longer
  keeps the image from overprinting as a whole.
- Flattening without Preserve Overprints, and clearing overprints on
  PDF import and printing, also clear the overprint an image keeps
  after its color is removed, so a color given later knocks out.

Docs: docs/mcp.md (Overprint), docs/target-app-parity.md.
2026-11-22 08:18:56 -08:00
dotCooCoo 4f73ef7fbb Images: Overprint Fill makes a colorized image's color overprint
A grayscale or 1-bit image colorized with a fill color had no way to
overprint: object.setOverprint {fill: true} changed nothing, since an
image has no fill row. The color now carries its own overprint flag
(colorize_overprint in native files).

- object.setOverprint (fill, without item) and attributes.info set and
  read it; Overprint Black and Print Ink Fixes' Remove White Overprint
  treat the color as the image's fill.
- Overprint Preview, Separations Preview and printed separations show
  the inks below the image where its color has none; on a plate the
  color puts no ink on, the image is left out.
- PDF export draws the image in an overprinting graphics state, a
  process color as an image of only the process inks it puts down.
- EPS export turns overprinting on for it, and now leaves white fills,
  strokes and colorized images knocking out with Discard White
  Overprint, as PDF export does.
- A legacy .ai file writes it as the image mask's fill overprint and
  reads it back. Warped pieces, geometry-effect copies and flattening
  keep or drop it as they do for fills.
- A white spot color is an ink: with Discard White Overprint it keeps
  overprinting in PDF and EPS export and in both previews.

Docs: docs/mcp.md (Overprint, Print Ink Fixes), docs/target-app-parity.md.
2026-11-22 06:15:41 -08:00
BFlat 1de9ad593c Merge pull request #8973 from dotCooCoo/fix/eps-freeform-plate-cells
Print: an overprinting freeform gradient leaves out the cells its plate samples write without ink
2026-11-22 10:51:19 +07:00
Dylan M. Taylor 69dc6f3097 eps: delegate AI editing-data lexer to craft_eps::ai_lex (craft-libs#790) (#9037) 2026-11-21 15:24:11 -05:00
dotCooCoo 6fb2028149 Print: classify a freeform gradient's plate cells after their opacity
A translucent cell whose samples round to ink before its opacity is
applied, such as 0.4% cyan at 25% opacity, is written with no ink once
the opacity is applied, yet it was kept and painted paper over the ink
below. The cells are now classified from the samples the image writes
after opacity, and RGB cells in CMYK output from their converted inks.
2026-11-20 23:55:44 -08:00
dotCooCoo 5ea4753750 Print: an overprinting freeform gradient leaves out the cells its plate samples write without ink
On a PostScript plate, an overprinting freeform gradient left out only the
cells whose color is paper white. A cell such as 0.1% cyan rounds to no ink
in the 8-bit samples, yet it was kept and painted paper over the ink below.
The cells are now classified from the samples the image writes.

At Level 2, a field drawn again inside the clip of its inked cells was
charged its samples a second time against the page limit, so a page with
room for a reference to the image already kept left the placement out with
the too-large warning. The check now charges the reference when the image
is already kept.

Follows #8400.
2026-11-20 22:47:38 -08:00
BFlat 4ce43b1091 Merge pull request #8532 from dotCooCoo/feat/distorted-image-commands
Links: Relink, Embed and Unembed keep a distorted image's corners
2026-11-21 11:01:53 +07:00
BFlat ada693c03c Merge pull request #8868 from dotCooCoo/perf/legacy-ai-gradient-index
Legacy .ai: gradient definitions are found by a key of their gradient
2026-11-21 10:34:44 +07:00
dotCooCoo e2d62de4fe Merge main into feat/distorted-image-commands 2026-11-20 18:54:01 -08:00
Dylan M. Taylor ef2cf470e3 eps: bound DSC header/trailer scan with craft-eps and add regressions (#8855)
* eps: delegate DSC header comments to craft-eps, pin craft-ps, and add regressions

* eps: use Document::walk and NodeKind::Image in TIFF preview round-trip test

* eps: fix readline EOF bool expectation in tests_reads

* eps: use 2x2 image in truncated currentfile filter test so EOF is hit

* eps: exercise truncated currentfile filter without panicking and assert Err on unterminated EOF

* eps: preserve last in-range header box in Dsc::read and remove pin change
2026-11-20 20:27:33 -05:00
dotCooCoo d9dba9c467 Legacy .ai: gradient definitions are found by a key of their gradient
Each gradient fill looked for its definition by comparing its gradient
with every definition written so far, so a document with thousands of
distinct gradients spent most of the export in these comparisons.

The writer now keeps each definition's place under a key made from
every field of its gradient, the same key the editing data's writer
uses, which moves to a module both writers share. Each candidate under
a key is still compared in full, and the first equal definition in
definition order is used. Spot color names, written spot colors and
fonts are also found through maps and sets, while the lists the file is
written from keep their order. The written file is unchanged, byte for
byte.

On Linux, writing 10,006 gradient fills (5,000 distinct and 5,000 of 50
others) took 79 ms of thread CPU time through the index and 291 ms
comparing each definition in turn (median of 7 runs, release build).
2026-11-20 15:02:27 -08:00
Dylan M. Taylor c43c35e8d4 eps: add smooth shading edge-case tests (#8841)
* eps: add smooth shading edge-case tests

* eps: fix hard-edge padded stop assertion in shading test
2026-11-20 12:04:13 -05:00
dotCooCoo 09e095baeb Merge main into feat/distorted-image-commands 2026-11-20 05:39:58 -08:00
Dylan M. Taylor f987648e96 eps: delegate scene-writer shading, image stream, and line style syntax to craft-ps (#8810)
* eps: delegate scene-writer shading, image stream, and line style syntax to craft-ps

* chore(eps): repin craft-ps to merged craft-libs main (cfcc86242)
2026-11-20 03:01:58 -05:00
Dylan M. Taylor 2848526796 fix: resolve two coverage test failures on main (#8813)
- eps: restore linear-time memchr::memmem::find in lex::find so
  search_in_a_loop_runs_out_of_the_budget does not hit O(N*M) under
  craft_ps::read::lex::find.
- ui-egui: wait for FontDb background scan and ensure >20 font families
  in menu_access_stationary_pointer_repeat_and_rerun_do_not_retarget_or_double_invoke
  so coverage/minimal runners do not race or fall short of 20 families.
2026-11-20 02:32:03 -05:00
Dylan M. Taylor 54f58fff31 eps: cut over PostScript scanner (lex.rs) to craft-ps (#8793)
* eps: cut over PostScript scanner (lex.rs) to craft-ps

* chore: repin craft-ps to craft-libs main
2026-11-19 21:05:18 -05:00
dotCooCoo 3f8e4b1fdc Merge main into feat/distorted-image-commands 2026-11-19 16:54:09 -08:00
BFlat 6dd1363d75 Merge pull request #8784 from storytold/cutover/eps-shared-epsi
refactor(eps): delegate EPSI preview decoding to craft-eps
2026-11-20 07:10:30 +07:00
Dylan M. Taylor 7c81cd7df8 eps: document and test shared EPSI preview compatibility 2026-11-19 17:42:11 -05:00
Dylan M. Taylor 4b1d0b257b refactor(eps): delegate EPSI preview decoding to craft-eps 2026-11-19 16:26:07 -05:00
dotCooCoo 70a36623ad Merge main into feat/distorted-image-commands 2026-11-19 11:17:21 -08:00
BFlat 9d334e90ea Merge pull request #8392 from dotCooCoo/feat/distort-images
Free Transform: Perspective Distort and Free Distort put an image's corners on the handles
2026-11-20 02:02:42 +07:00
BFlat 1c75bf4a04 Merge pull request #8747 from Silvertree2010/hand/ai-dynamic-symbols
Illustrator editing data keeps dynamic symbols and per-instance changes
2026-11-20 01:34:20 +07:00
NetterSilver f8ae50c823 AI editing data keeps dynamic symbols and their instance changes 2026-11-19 17:13:54 +00:00
dotCooCoo f8a5534abb Merge main into feat/distorted-image-commands 2026-11-19 07:42:56 -08:00
dotCooCoo 82ef5176bc Merge main into feat/distort-images 2026-11-19 06:39:02 -08:00
BFlat 16756500bf Merge pull request #8700 from dotCooCoo/fix/print-perceptual-paper-plateau
Print: a Perceptual gradient keeps the ink below across a paper-white stretch
2026-11-19 21:33:06 +07:00
dotCooCoo 55438151f3 Merge main into feat/distort-images 2026-11-19 06:08:29 -08:00
dotCooCoo 173d72a867 Merge main into feat/distorted-image-commands 2026-11-19 04:49:23 -08:00
dotCooCoo ce009c54a8 Print: a Perceptual gradient keeps the ink below across a paper-white stretch
Follow-up to #8400. A Perceptual gradient expands each segment into
stops on its OKLab curve. Between two stops of the same color the round
trip through OKLab rounded the color, so a stretch between two
paper-white stops came out as nearly white RGB. On a PostScript plate
the separator then saw ink there, and an overprinting gradient painted
over the ink below across that stretch.

Gradient::expanded now gives a stop between two stops of the same color
that color, unchanged, for every method. GradientMethod::mix and
Gradient::sample are not changed.
2026-11-19 04:48:33 -08:00
Sven Lafebre 4c20c3e21f Merge remote-tracking branch 'origin/main' into fix/8188-ai-arrowheads
# Conflicts:
#	crates/engine/src/cmd/stroke.rs
#	crates/eps/src/import/ai/read/ops.rs
#	docs/file-format-parity.md
2026-11-19 12:34:27 +01:00
bflatastic 618fb1416d Merge main into #8201
# Conflicts:
#	docs/file-format-parity.md
#	docs/roadmap.md
#	docs/target-app-parity.md
2026-11-19 15:24:38 +07:00
BFlat 38dbb7c086 Merge pull request #8643 from dotCooCoo/fix/eps-frameless-diamond-color
EPS: a diamond gradient without a frame is its color at 1
2026-11-19 15:08:29 +07:00
BFlat 462503c3f8 Merge pull request #8642 from dotCooCoo/fix/print-hard-stop-test-checks-ink
Print: the hard-stop plate test checks where each gradient puts cyan
2026-11-19 15:08:20 +07:00
BFlat 3f0707e64f Merge pull request #7103 from dotCooCoo/feat/stylus-wheel
Brushes: an airbrush pen's stylus wheel varies brush size and width
2026-11-19 14:46:40 +07:00
Juan ManuelandClaude Opus 5.5 bf3d27e2b9 .ai import: blank area type keeps its frame, blank point type is left out quietly (#8348)
* .ai import: blank area type keeps its frame, blank point type quiet

A text object whose story is blank (nothing but spaces and line ends)
was never made (`Story::node`), so its slot
was left empty and counted in the note "text objects on hidden layers
or hidden objects couldn't be read", shown or not.

A slot of a blank story that neither the text document nor the page
fills is now settled after the page is matched, so the page's type
still takes it where the page has some for it alone:

- Blank area type and type on a path come in as a text object that
  keeps its frame or path and draws nothing (`Story::blank_frame_node`),
  as VectorCraft's Type tool keeps an empty frame (#85, #154). That
  covers a frame the page's spare type went past (`Merged`) too. It is
  kept without being weighed against the page, and so are the later
  frames of its thread.
- Blank point type draws nothing and has nothing to keep, so it is left
  out without a note, as the Type tool discards empty point type.
- A blank slot takes the page's type left over only when no other open
  slot can (`readable_first`), so it no longer takes another object's
  type by painting order.
- A blank story's thread isn't held against an unread object that takes
  one of its frames, and a thread lists only the frames still there.
  Its frames are still threaded type to warps and envelopes, which
  never take the place of such a frame.

The note for text objects still left out no longer says they are
hidden: "text objects whose type couldn't be read from the file's text
document or its page are left out".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* .ai import: a blank frame an unread object leaves alone isn't threaded type

When an unread object takes one frame of a blank story's two-frame
thread with it, the other frame is no longer threaded in the document,
but warps and envelopes still treated it as threaded type and so never
weighed it against its look. They now get the frames of the threads
actually kept.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Test: the lone blank frame in a warp comes in as its look, no text left

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 00:53:38 -05:00
jmvergesandClaude Opus 5.5 dc57c26f69 Merge main (8fcadbc3c) into fix/ai-art-brush-tints-of-a-spot-color
Conflicts in docs only (status lines, changelog rows and table rows):
main's entries and this branch's are both kept, each once. Main now has
this branch's first File formats row fix (#868) itself.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 05:43:15 +00:00
dotCooCoo f4b015cf08 EPS: a diamond gradient without a frame is its color at 1
A diamond gradient whose vector has no length has no inside, and the
renderer draws it with its color at 1 everywhere. With two stops at 1,
that is the first of them, which ends the stretch before it. The EPS
writer painted the last stop instead, so such a diamond came out in the
other color, and on a PostScript plate an overprinting one whose last
stop is paper white knocked out the ink below at Level 3. The writer now
paints the color at 1, and on a plate leaves the ink below when that color
is paper white, at both levels.
2026-11-18 19:13:08 -08:00
dotCooCoo c5afb93d67 Print: the hard-stop plate test checks where each gradient puts cyan
an_overprinting_gradient_with_a_hard_stop_at_an_end_keeps_the_ink_below_on_a_postscript_plate
compared each PostScript plate with the PostScript plate of the gradient
alone, so a writer that dropped the gradient from both still passed. It
now also reads the plates at fixed points (halfway along the vector, before
its start for the linear gradient, and past its end) and checks that the
gradient's own cyan prints there, alone and over the cyan below, where the
level's painter puts some down, and that the cyan below prints elsewhere.
2026-11-18 19:12:08 -08:00