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.
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.
A linked image whose file is missing shows its full-color preview as it
is, without its colorize paint, and separations and PDF export already
print it that way. Overprint Preview and simulated overprints in
composite output still darkened the whole image. darken_overprints and
image_overprints_whole now take the document's images and leave such an
image at its own blend mode, and the helpers that find the pixels a
colorized image shows move from the separations code to
vectorcraft_doc::overprint so both use them. The preview's cached art is
made again when the document's images change.
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.
- 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.
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.
* 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>
- 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.
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.
- 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.
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.
The outline of a dynamic instance's part walked the art of an instance
nested in the part, drawn with that instance's fill and stroke effects,
and outlined its hidden objects as well. It now skips a hidden object and
what it holds, as the part pick does.
A symbol instance nested in a dynamic symbol's art was picked and outlined
where its art is drawn only when the shapes its fill and stroke paint were
non-empty. Those shapes leave out clip groups and type, so a nested
instance whose art is a clip group was picked at its plain place although
the canvas draws its members moved by the outer instance's fill or stroke
effects.
The test is now whether the nested instance's active fill or stroke has a
visible geometry effect, which the engine registers with
set_instance_reshapes. Picks and outlines no longer evaluate those shapes
for each nested instance they visit.
Outlining a part of a dynamic symbol's instance expanded every nested
instance whose fill or stroke effects reshape its art, at every level, with
no limit, so art that nests many such instances a few levels deep took work
that grew with each level. A part pick charged each object it tested but
copied each nested instance's art before charging anything for it.
The part outline now shares the object limit a click has, and each object
it outlines takes one object of it. The art of a nested instance takes its
size from the limit before it is copied, and the art an object's own
effects draw takes its size once evaluated; nothing more is copied or
evaluated once the limit is used up. The art of the instance itself is
charged by its walk, as before.
A geometry effect on a dynamic symbol instance's fill or stroke moves or
reshapes the art the canvas draws, and a click there already selects the
instance. Direct Selection still picked a part of the art at its plain
shape and outlined that shape, so a click on the drawn result picked
nothing and a click where the part no longer paints picked it.
symbol_part_at and symbol_part_outline_in_view now test and outline the
instance's art with the effects of its active fill and stroke added, as
the canvas adds them. Live objects in the art keep their place, so the
child-index path still leads to the part. A nested instance is picked
and outlined where its reshaped art is drawn, type with a fill or stroke
of its own where its reshaped glyphs are drawn (Type Object Selection by
Path Only still takes the type path), and an image's outline includes
the shapes its own fills and strokes paint. A clipping path is still
picked and outlined by its own geometry. Outline view and layers with
Preview off keep the plain shapes; blends, envelopes and repeats in the
art are picked without the instance's effects.
A dimension of a whole path whose line lay across the path, made vertical
or horizontal with dimension.update, now goes as far past the path as it
lay from its first point. Before, its line landed on the path's edge. A
line on the edge to within rounding still counts as outside the path.
When the new place would be more than 1,000,000 pt from the first point,
the update is an error unless it also gives offset, and the dimension is
left as it was. A dimension whose measured node is missing or is not a
path, as in a file that names a node it does not hold, is unlinked at the
next edit.
Tests: a dimension of a whole path saved in a native file and opened
again still follows the path, and one that names a missing node is
unlinked at the next edit; past a corner of the path the side the
pointer is farther out on decides; after the first point Alt picks a
point; a hovered segment's length stays by the pointer at a high zoom.
The line in docs/target-app-parity.md now attributes only the Alt hover
over a path to the linear dimensions help page. Docs: docs/dimensions.md
and dimension.update's params text.
With the Linear Dimension tool and Alt (Option on macOS) held, hovering a
path shows a box through its outermost points (a Smart Guide when Smart
Guides are on), with its width and height beside the pointer when
Measurement Labels are on. A click on the path, then a placing click, or a
drag out from it, places a dimension of the whole path. With the pointer
above or below the path it measures the width, between the leftmost and
rightmost points; beside the path it measures the height, between the
topmost and bottommost points. The linear dimensions help page describes
the Alt hover; which side gives which measure is VectorCraft's own rule.
dimension.create takes a new source, {kind: extent, node}, for linear
dimensions. Its points are the outermost points of the segments the path
draws, curves included, and are read again whenever the path changes, so a
turned path shows its new overall width or height. The line keeps its
distance from the whole path when the path changes or is reflected, and
when dimension.update changes the orientation, which now reads the other
pair of points. When the box through the path's outermost points stays
where it was, as after Reverse Path Direction, the line stays on its side.
A version without the extent source does not open a file that holds one.
The measurement label beside the pointer while two points are picked now
keeps its distance in screen pixels at any zoom.
The Help Bar hint names Alt+Click. Docs: docs/dimensions.md and
docs/target-app-parity.md.
A native file whose `image_quad` held an entry that was not a point among
its first four failed to open: `image_corners` read each entry as a
`Point` and returned the error. Such corners, and an `image_quad` that is
not a list, are now dropped as the file is read, and the image opens
placed by its transform, as a list of other than four points already did.
A point is `[x, y]` or `{"x": x, "y": y}`; values that are not taken are
skipped without being kept in memory.
Follows #8392.
The walk of a symbol instance's art switched to outline for a layer of
the art whose Preview is off without checking ignore_layer_preview, so
with the option set a press on the art's stroke past the instance's box
missed. FindPart::find now checks the option, as the other point hit
paths do.
With no points or lines picked, a press within 8 pixels of what a
visible, unlocked dimension draws (its lines, arrowheads and label),
where it is the topmost object that can be edited, followed by a drag
moves that dimension as one undo step. A segment of the art as near
the press as the dimension's lines and label, or nearer, takes the
press instead, and a click there without a drag still picks a point.
The part grabbed follows the pointer: a linear dimension's line moves
as far across as the pointer moves, an angular arc moves as far as the
pointer moves away from or toward the vertex, and a radius or diameter
line turns about the center as the pointer turns, or toward the
pointer when grabbed at the center. The dimension keeps what it
measures and its link to the art. With Smart Guides on, a linear
dimension's line lands on the level of a parallel dimension line, as
when it is placed, and of two lines on one level the one nearer the
pointer along it wins. Isolation mode, clipping masks and locked artboards
apply as they do to a click; with a part of a dimension isolated, the
dimension is not dragged. A dimension that a geometry effect on it, on
one of its parts or on a group around it draws elsewhere is not
dragged, except in Outline view and on a layer whose Preview is off.
dimension.update takes `at: [x,y]`, which puts a linear dimension's
line through the point, gives an angular arc a radius of the point's
distance from the vertex (at least 12 pt), or turns a radius or
diameter line toward it. With Real-time Drawing off, a dimension.update
preview that names its dimensions outlines only those dimensions.
A dimension pasted into a document that had none now marks the
document as holding dimensions (Document::insert), so the Dimension
tool drags it like one drawn there and edits refresh it. Opening a
native file sets the flag from the objects it holds, which covers files
saved after such a paste.
Docs: docs/dimensions.md, docs/target-app-parity.md.
In Draw Behind, an Alt-drag of whole objects with the Selection or Direct
Selection tool now puts each copy directly below its own original, in the
original's group or layer, and selects the copies, as the drawing modes help
page lists duplicating by Alt-drag among the actions Draw Behind applies to
(https://helpx.adobe.com/illustrator/desktop/draw-shapes-and-paths/learn-drawing-basics/drawing-modes-overview.html).
The copy of a clip group's or clipping layer's clipping path goes directly
above it, so the clipping path stays the bottom object.
- object.transform takes drawBehind (with copy); the tools send it while Alt
is held. A value that is not true or false is refused.
- Draw Normal, Draw Inside, object.move, the transform dialogs' Copy,
Duplicate and Transform Again keep putting copies above.
- Document::insert_below puts nodes directly below their anchors in one pass.
Docs: docs/mcp.md, docs/target-app-parity.md.
The check for whether the pointer is still on the object hit the object's
painted art with outline off, but the hit test turned outline back on for
a layer with Preview off, so a move onto the stroke past the fill ended
the line. A new HitOptions field, ignore_layer_preview, keeps the point
hit tests from switching to outline for such layers, and the freeform
check sets it. the_stroke_counts_as_the_object now runs with the layer's
Preview on and off.
The type, pie, side count and corner widgets, the Objects on Path, Mirror,
Grid and Radial Repeat controls, the Image Trace Split divider and the
center point now check that a selected object is of a kind that has the
widget before asking whether it is editable. With an artboard locked, the
editability check measures the art of the layer object holding the object,
so a large selected group of another kind was measured on every repaint and
pointer move. The widgets shown are the same.
A test-only counter (vectorcraft-doc feature locked-artboard-count) counts
those measurements; widget_order_tests checks that objects of other kinds
are not measured, compares every widget with the editability-first result
on a mixed document, and holds an ignored timing test, widget_order_perf.