* 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>
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 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.
Part of #4934. type.retype set each line of outlined text as its own
point type object, even when the lines stack as one paragraph.
- Opaque, Normal lines with a solid fill or none and no stroke that
follow each other in paint order, with the same group, paint, font,
size, turn and tracking, each the same leading (0.25 to 3 times the
size) below the one before and lined up at their starts, ends or
centers, become one area type object. Its leading is Auto when Auto
puts the last baseline in place, else the mean distance between the
baselines, and its alignment is left, right or center. Its frame is
Convert To Area Type's, now shared through typemenu::point_to_area.
An untracked line of one or two glyphs takes the others' tracking.
- Every object is laid out and compared with the outlines first: when
area type would move a glyph the lines stay multi-line point type.
When that also moves a glyph, the block ends at that glyph's line and
the lines after it join again. Type whose bounds would reach past the
coordinate limit stays apart.
- Text Wrap objects above new area type are taken into account; when
checking them on the changed layers would copy more than 2,000,000
anchors, subpaths and shapes, the lines stay multi-line point type.
text::wrap_copy_units counts that work without copying the outlines,
and wrap_work no longer copies them to count.
- The result's fonts entries add leading and area, and texts join an
object's lines with line breaks.
These rules are VectorCraft's own. Docs: docs/mcp.md (Retype several
lines), docs/type-parity.md (Retype row), docs/target-app-parity.md,
docs/roadmap.md (M7 row).