Commit Graph
19723 Commits
Author SHA1 Message Date
dotCooCoo a6572d450a Merge main into feat/colorized-image-overprint 2026-11-22 22:38:01 -08:00
FredApps cd13884448 Merge pull request #9144 from FredApps/imo778-metafile-unit-facts
metafile: take WMF and EMF unit facts from craft-metafile (craft-libs#778)
2026-11-23 13:33:44 +07:00
FredApps a238c434ac Merge branch 'main' into imo778-metafile-unit-facts
Bring in the 205042e Rule-10 pin (#9160) and the #9157 Sonar note so
this branch contains current main.

# Conflicts:
#	Cargo.lock
#	Cargo.toml
#	apps/vectorcraft-web/Cargo.toml
#	crates/text/Cargo.toml
#	xtask/src/pdf_deps.rs
2026-11-23 13:03:29 +07:00
FredApps 0b25f2ab6f Merge pull request #9160 from FredApps/imo778-craft-libs-pin-205042e
deps: pin all craft-libs crates to 205042e (craft-libs#778)
2026-11-23 13:02:13 +07:00
FredApps 4811e6d414 Merge branch 'main' into imo778-craft-libs-pin-205042e
Bring in #9157 (SonarCloud archive job-cap note) so this Rule-10 pin
contains current main before landing.
2026-11-23 11:45:17 +07:00
dotCooCoo 94c4bfba7a Tests: a linked image inside a placed document follows this document's outline setting
A placed file whose own Show Images in Outline Mode is off shows its linked
image's pixels in grayscale, uncrossed, when this document's setting is on.
2026-11-22 20:33:43 -08:00
dotCooCoo edadc82827 Plug-ins: state what a compound path's reshape resets, and test an unflagged flatten of a guide member
docs/plugins.md now says that each new member keeps only the id of the
old member in its place, with its name, live shape, opacity, blending
mode, appearance, opacity mask and other settings of its own reset, and
that `guide: false` on a compound path makes each guide member an
ordinary path.

The compound path test also checks that `type: "path"` without `guide`
is refused for a compound path with a guide member and leaves the member
a guide, and its doc comment names members that are not paths.
2026-11-22 19:59:44 -08:00
FredApps 3e3d1d1386 Merge pull request #9157 from storytold/ci/sonar-archive-build-jobs-note
ci: note the shared SonarCloud archive job cap
2026-11-23 10:58:37 +07:00
dotCooCoo 97ac3c8c8b Outline view: linked images and placed documents show their box with an X
In Outline mode, with File > Document Setup > Show Images in Outline Mode
off, a linked image's frame is crossed from corner to corner, following
the corners of a turned or distorted image. A placed document shows its
box crossed, and its file's art no longer draws in Outline mode unless
the option is on. Embedded images keep a plain frame, and so do the
pieces that an envelope cuts an image into.

A placed document with raster effects or color adjustments stays
crossed. One with an effect that changes geometry, its own or its
group's, still draws its file's art reshaped and is not crossed yet.

With the option on, images show their pixels in gray and placed
documents show their art. The art inside a placed document now follows
the option of the document it is placed in rather than the placed
file's own setting.

Linked files showing as a box with an X in Outline mode is described at
https://helpx.adobe.com/illustrator/using/viewing-artwork.html; the
other rules are VectorCraft's own.

Docs: docs/ui-parity.md, docs/mcp.md; document.setup params text for
outlineImages.
2026-11-22 19:49:08 -08:00
FredApps c9c2d711d1 xtask: keep pdf-deps aligned with the 205042e craft-libs pin (craft-libs#778)
Shard 5 (Checks) failed because cargo xtask pdf-deps still expected
craft-pdf and the hayro/krilla backends at d7c9632, and hayro-jbig2 at
the leftover stream-codec pin. All of those crates now resolve at the
shared 205042e revision.
2026-11-23 04:26:33 +01:00
dotCooCoo 2fbe099c48 Plug-ins: refuse replacing a compound path's members when one isn't a path
A member that is not a path (a compound path inside a compound path) is
not in the input's `path`, so a changed `path` or `type: "path"` deleted
it, together with any hidden or locked members it held. The host now
refuses such an output with an error naming the compound path. A
compound handed back as it was still keeps the member.

docs/plugins.md also says that new members keep the old ids by position
but not their names or live shapes. The test covers a nested compound
member and turning a compound with a guide member into a guide path.
2026-11-22 19:15:57 -08:00
FredApps a3b0b3dec0 deps: pin all craft-libs crates to 205042e (craft-libs#778)
Rule 10: every storytold/craft-libs crate is at the same rev, now
205042e406b630cda653990649264a78fea6296b, the merge of #3136 on
craft-libs main. That rev still skips a form already on the drawing
stack (ISO 32000-2 §8.10.1) but no longer reports it as
ContentTruncated, so a 200-shape knockout-mask PDF imports completely.

Also moves the leftover per-crate pins of craft-font-catalog and
craft-web-api onto the same rev.
2026-11-23 03:59:59 +01:00
FredApps 5022ba5593 ci: note the shared SonarCloud archive job cap
The reusable workflow now defaults build-jobs to 2 so a cold instrumented
archive stays within hosted-runner memory (craft-common-actions#333).
2026-11-23 03:21:18 +01:00
dotCooCoo e4ce03a906 Plug-ins: a filter keeps a compound path's hidden and locked members
A filter that handed a compound path back rebuilt every member from the
returned path, even when the path was unchanged, so its hidden members
were shown and its locked members unlocked after any run.

- A compound path whose path comes back as it was, or is left out, keeps
  its members as they are.
- While a member is hidden, locked or a guide, a changed path or
  `type: "path"` is refused with an error naming the compound path. A
  guide member is allowed when the output also sets `guide`.
- A changed path still replaces the members, one per subpath, keeping
  the old members' ids by position.

Docs: docs/plugins.md.
2026-11-22 17:58:55 -08:00
dotCooCoo 54b9504cb5 JavaScript: a function body reserves room for its arguments object
The call reserves room for the declarations and the arguments object
before the body's let and const environment takes some of it. The body
then reserved room for its declarations again, but not for the
arguments object, so making the object could take the heap estimate
past the limit until the next check. The body now reserves both, with
the arguments size from one helper that the call also uses.
2026-11-22 17:52:55 -08:00
FredApps 53f5e552f8 Merge remote-tracking branch 'origin/main' into imo778-metafile-unit-facts
# Conflicts:
#	Cargo.lock
#	Cargo.toml
2026-11-23 08:38:58 +07: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
FredApps 15001f7dfc Merge pull request #9123 from ruchirguitar/refactor/metafile-pict-shared
metafile: delegate QuickDraw PICT parsing to craft-metafile
2026-11-23 08:24:58 +07:00
dotCooCoo 723e52c5ec Merge #9079 into feat/js-es2020-optional-chaining-nullish 2026-11-22 17:15:41 -08:00
dotCooCoo 0b8dae1401 Delete: removing objects one at a time keeps the id lookup cache
Every Document::remove_many cleared the id lookup cache, and the next
lookup with no cache walked the tree once to answer and again to
rebuild it. Deleting objects one by id at a time with edit.clear walked
the whole tree twice per Delete: 20,005 walks for 10,000 objects.

- remove_many keeps the cache and records which children it took out
  of each parent. A cached path then counts a node's index among its
  siblings less the removed siblings before it, so the nodes left are
  found without a walk whichever objects were removed (top, bottom,
  middle, or the art below a layer's ruler guides). The cache has no
  path for a removed node or a node inside one. The cache is still
  dropped once the removed nodes are half of its entries, and when it
  does not have a listed node where it is.
- index_path with no cache builds the cache and answers from it, in
  one walk. An id that appears more than once is still walked to, so
  the first in tree order is returned as before.

Release build, deleting each object of one layer by id with nothing
selected. Walks for 1,000 objects went from 2,005 to 14 in each order.
For 10,000 objects, median of three runs:

  from the top:     20,005 walks, 5.53 s  -> 15 walks, 4.28 s
  from the bottom:  20,005 walks, 11.24 s -> 15 walks, 10.87 s
  from the middle:  20,005 walks, 10.62 s -> 15 walks, 8.62 s

Each Delete is still one undo step. The time left still grows with the
square of the count: each Delete rebuilds the parent's child list and
keeps a copy of the document for undo, and this change does not touch
either.
2026-11-22 17:06:53 -08:00
FredApps f4cac4f30f Merge remote-tracking branch 'origin/main' into imo778-metafile-unit-facts 2026-11-23 08:01:38 +07:00
FredApps 110094fe7e Merge branch 'main' into refactor/metafile-pict-shared
Pin craft-metafile to craft-libs main 8f6ad14b, which includes the
merged PICT reader (storytold/craft-libs#3073), drop the craft-codepage
dependency the removed reader used, and update the PICT detection
comments for version 1 pictures.

Signed-off-by: FredApps <153173854+FredApps@users.noreply.github.com>
2026-11-23 07:20:25 +07: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 d61d494bea JavaScript: declarations and spread checks stay within the heap and fuel limits
- A function body, after default parameters or plain ones, and eval code
  check the heap for their function declarations and variables after
  their `let` and `const` environment is made, so the estimate stays
  within the limit while the declarations are bound.
- Looking for an index getter before spreading a long array takes a unit
  of fuel for each property it inspects, as well as for each object.
- An index accessor with only a setter no longer delays the check of an
  array of length 4294967295 when spread begins, since reading the
  elements does not run it.
- The eval test with `with` now gives the `with` object an `x`, and the
  function case declares its own `var x`, so a function closing over
  the wrong environment fails it.
2026-11-22 16:09:51 -08:00
FredApps 2ce595e4da Merge remote-tracking branch 'origin/main' into imo778-metafile-unit-facts
# Conflicts:
#	Cargo.lock
#	Cargo.toml
#	xtask/src/pdf_deps.rs
2026-11-23 07:03:03 +07:00
FredApps cde70af446 metafile: take WMF and EMF unit facts from craft-metafile (craft-libs#778)
Use craft_metafile::unit_facts from craft-libs#3071 for the placeable
frame, metric map-mode scan and EMF calibration; the fallback scales
stay VectorCraft's policy.
2026-11-23 06:58:44 +07:00
FredApps 369b8bfc09 Merge pull request #9014 from Terra854/deps/craft-libs-runlength
deps: pin shared EPS prefix decoders
2026-11-23 06:56:33 +07:00
FredApps e563e271a0 build: pin craft-libs to main 33be356 (craft-libs#778)
Move every craft-libs crate to one rev merged on craft-libs main, so the
metafile unit facts from craft-libs#3071 are available.
2026-11-23 06:55:39 +07:00
FredApps 5065041fb1 Merge branch 'main' into deps/craft-libs-runlength
Signed-off-by: FredApps <153173854+FredApps@users.noreply.github.com>
2026-11-23 05:54:55 +07:00
Dylan M. Taylor 409d821751 Use the shared EMF and WMF EOF diagnostic (#9125) 2026-11-22 17:21:09 -05:00
FredApps 62ccdea828 Merge branch 'main' into deps/craft-libs-runlength 2026-11-23 05:14:11 +07:00
Terra854andFredApps 76b8839448 SVG: share XML attribute escaping (#9030)
Co-authored-by: FredApps <153173854+FredApps@users.noreply.github.com>
2026-11-23 05:13:39 +07:00
Terra854 eb3a9ba335 Import: share Mac Roman decoding across legacy formats (#9042) 2026-11-23 03:37:59 +07:00
dotCooCoo e37b052028 Print: the PDF fonts note names the fonts drawn as outlines
PDF print embeds subsets only of the fonts whose licenses allow it and
draws the others as outlines. The note that None and Complete add now
says so, as do the Fonts params text, docs/mcp.md and the progress line.
2026-11-22 12:12:38 -08: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
ruchirguitar 2cc47a707e vectorcraft-metafile: format picture.rs 2026-11-23 00:44:19 +05:30
ruchirguitar edf449c379 chore: update craft-metafile rev to 6d02a9d79 2026-11-23 00:37:02 +05:30
dotCooCoo 2f465a09c3 Docs: ES2015 test262 counts include the tests that do not tokenize
The ES2015 subset now runs the tests whose sources the token reader
rejects, 151 more runs, so the evidence line gives 533 of 708 other runs
and lists the forms that the runs that do not parse use.
2026-11-22 11:03:57 -08:00
ruchirguitar e4df00ed5e Merge origin/main into refactor/metafile-pict-shared 2026-11-23 00:32:03 +05:30
dotCooCoo 6b8c10999d JavaScript: spread and default parameters stay within the heap limit
- Spreading an array checks the room in the result as each element is
  read, so a getter that shrinks an array of length 4294967295 gives the
  elements it reads. An array no getter reads, and any other object, is
  still checked against its length when spread begins.
- Spread counts each element's index name, and each character of a
  string, against the heap as it reads them.
- A function with default or rest parameters checks the heap again before
  its body's environment and declarations are made, since the parameters'
  values may have used the room the call reserved.
- Without the ES2015 option, a function that eval code declares on the
  global object closes over the global scope, so it sees the scripts'
  `let` and `const` names, as functions of global code do.
- With the ES2015 option, a global `var` whose name the global object
  only inherits gets its own property.
- The test262 ES2015 subset runs a test whose source does not tokenize,
  so the error counts as a failure instead of a skip.
2026-11-22 11:00:34 -08:00
dotCooCoo 1596380f23 Merge #9079 into feat/js-es2020-optional-chaining-nullish 2026-11-22 10:48:32 -08:00
ruchirguitar 946f33c878 metafile: address CodeRabbit feedback on truncation warnings, patterns, and region shapes 2026-11-23 00:00:42 +05:30
Dylan M. Taylor bcaeb29737 Merge pull request #9112 from storytold/feat/778-use-shared-metafile-writers
metafile: use shared EMF and WMF writers
2026-11-22 13:16:18 -05:00
ruchirguitar e3c874b13f metafile: delegate QuickDraw PICT parsing to craft-metafile
Replaces local pict.rs with craft_metafile::parse_pict, aligning with craft-libs#3073 and AGENTS.md Rule 9.
2026-11-22 23:28:27 +05:30
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 15fefc9930 JavaScript: block functions, spread and global declarations follow ECMAScript 2015
- A block function whose name a function of an enclosing block declares is
  not assigned to the variable of that name.
- A labelled function in a block is made when the block is entered, and the
  parser checks it against the `let` and `const` names of its statement list.
- A function standing alone as an `if` branch gets a block of its own.
- Spread reads a `String` object by code point, and reads an array's length
  again before each element.
- A `var` or function declared on the global object stops a later `let` or
  `const` of its name until its property is deleted, and a `var` the global
  object cannot take is a `TypeError` before anything is declared.
- A call keeps its callee, receiver and arguments reachable until its frame
  holds them, and global and eval code keep their environment and their heap
  charge until their frame is pushed.
- Template objects are released when no code that can run holds their sites,
  even when one code has several sites.
- `Realm::set_es2015` during a run applies once the run ends.
- A template piece that spans lines does not let a preprocessor line start
  after it on its last line.
2026-11-22 08:21:30 -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
Dylan M. Taylor a65bcb99bd metafile: use shared EMF and WMF writers (#778) 2026-11-22 11:05:07 -05:00