Include the PDF export warnings in the package result and report. Cover
shadow and feather output in packaged PDFs with a synthetic regression test.
Preserve frame and text-range hyperlinks on rasterized frames, including
inside groups, at their original source bounds.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Frames holding pasted-in images are hit inside the frame, take a placed graphic; documents open on a usable layer
A frame with items pasted into it (how a document from InDesign keeps a cropped photo) was hit
through its children like a group, so the whole uncropped image counted: a click on the empty
page beside such a photo selected it, and nothing could be deselected there. It is now hit by
its own area, as it is drawn clipped. Such a frame holding only graphics also takes a placed or
dropped graphic (Item::takes_graphic), which fills it as an empty or graphic frame is filled.
A document opened with new objects going to its top layer even when that layer was hidden and
locked (a dieline), so a placed graphic showed as an empty frame outline. It now opens on the
topmost layer that is shown and unlocked (Document::working_layer).
* Place: a graphic replacing the one a frame shows keeps the frame's crop and zoom
Placing or dropping into a frame that shows a graphic (in it, or as the one graphic pasted into
it) filled the frame afresh, so the crop and zoom chosen for the old picture were lost. The new
graphic now covers the old one's area, centred on it: an edited copy of the same picture lands
exactly where the old one was.
* Move the replace-keeps-crop and open-on-a-usable-layer changes to their own PRs
Review asked for them to be checked against reference app behaviour on their own. This PR keeps
the frame hit area and Item::takes_graphic. Reverts 8ea0bc16 and drops Document::working_layer.
* Move Document::working_layer and its test to #2267
A document opened with new objects going to its top layer even when that layer was hidden and
locked (a dieline), so a placed graphic showed as an empty frame outline. Document::working_layer
picks the topmost layer that is shown and unlocked (the top layer when there is none); DocState::new
and the fallback after the active layer is deleted use it.
The warning from #2190 looked only at the attributes passed. A composite
font made by style.compositeFont.set isn't an installed family, so
applying one warned "Missing font: Mixed" even when its entries were
installed. And a fontStyle-only call, or a family change that kept a
style the new family lacks, said nothing.
After a call that sets or clears fontFamily or fontStyle, type.char now
tallies the fonts the formatted text resolves to, with the code
font.list uses (composite entries per character), and warns about the
missing ones and substitute styles. At a caret it checks the font the
next typing gets. tally_story becomes tally_range over a byte range,
and describe_fonts is the part of used_fonts that type.char reuses.
A relative link names another file once the document is saved elsewhere,
so a status remembered for the old file must not answer for the new one.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A fontFamily the app doesn't have was applied with a null result, so a
script that asked for Courier Prime exported the PDF in the substitute
and exited 0. The font is still applied, since documents can carry
missing fonts and Find Font and preflight list them, but type.char now
returns {"warnings": ["Missing font: Courier Prime (using Source Sans 3)"]},
or "Missing font style: ..." for a style the family doesn't have, in
preflight's words. Other calls still return null.
links.list decided a placed graphic's status by reading the whole file and comparing it with the asset's bytes whenever the sizes matched, and the Links panel polls it twice a second, so a document of press-size images read every one of them in full on every poll. Image links now have the size-and-time fast path linked text files already had: a file of the remembered size and time isn't read, a new time is read once and remembered (unless the file changed in the last two seconds), a different size is modified without a read. The answer is keyed by the asset's bytes' identity, so a relink, update or undo can never be served a stale one; status() stays as the exact check for callers that want it.
Verified locally on a288a87b: fmt, clippy, engine link tests including the new unchanged_linked_images_are_not_read_again.
A sheet draws its spread's items without asking which page each one sits on, so
a frame straddling two pages is drawn, in part, on both. The warning chose the
page from the frame's centre alone (`page_at_x(bounds.center().x)`), so a frame
centred on a page the export leaves out had its warning dropped while the part
on an exported page went into the file (noted in review).
`pages_of` gives every page of the spread the frame's bounds overlap, and the
story is kept when any of them is exported.
The page named is one the export has: the centre page when that is exported, so
an ordinary frame reads exactly as before, otherwise the first exported page the
frame reaches. A frame wholly on the pasteboard overlaps no page's span and
falls back to `page_of`, so the two cannot disagree about where such a frame is.
`overset_location` returns the reached pages beside the centre page, which is
what made it worth a named type.
The test exports a frame centred on page 3 and reaching back into page 2, four
ways: the whole document, page 3 alone, page 2 alone -- which used to report
nothing -- and page 4, which the frame never reaches and which still reports
nothing.
Found while testing crates/engine/src/cmd/datamerge/parse.rs:212 (parse_record_no, used by select_range)
Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Merge origin/main at a288a87b. Preserve the font.list progress entry and the content-first routing note. The feature diff remains the same four reviewed files.
Co-Authored-By: OpenAI Codex <noreply@openai.com>
Keep native ZIP, legacy JSON and IDML bytes out of the INDD converter even when a browser supplies a misleading .indd or .indt name. Preserve signature and unknown-data routing to the converter. Check that every browser delivery adds a document before asserting its title.
Co-Authored-By: OpenAI Codex <noreply@openai.com>
A font with no readable OS/2 table doesn't say what its licence allows,
and reporting fsType 0 made it look installable. FontFace::fs_type() now
returns None for it, and font.list reports fsType and the five flags as
null. restricted_licence() and bitmap_only() still treat it as
unrestricted, so export behaviour doesn't change.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ApvpyStzzHbKyDBNxpzn2Y
Found while testing crates/engine/src/script.rs:50-54 (parse, compact `command {json}` branch)
Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
file.openBytes used the name it was given as the document's title as is. The
IDML path strips .idml/.indd/.indt, but a native document opened as
"Brochure.designcraft" kept the extension, and everything that adds it back
doubled it: Save in the browser downloaded Brochure.designcraft.designcraft,
Save As suggested that name, and the File Name variable showed it. The app's
own drop and open paths strip the extension before calling, so only hosts and
scripts that pass a file name hit it.
The title now drops one trailing .designcraft (any case). Other names are
unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ApvpyStzzHbKyDBNxpzn2Y
font.list now gives, for the face that sets the text, its raw OS/2 fsType
and what the bits mean: restrictedLicence, bitmapOnly, noSubsetting,
editable and previewPrint (null when the face is missing). A host that
makes print PDFs can then refuse a face whose licence doesn't allow the
export, including system fonts and the bundled fonts, without reading the
font files itself. PDF export subsets every font, so a caller needs
noSubsetting as well as the restricted and bitmap-only bits.
FontFace gains fs_type(); restricted_licence() and bitmap_only() read it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ApvpyStzzHbKyDBNxpzn2Y
Found while testing crates/engine/src/math.rs:909 (to_svg, the `esc` closure used for each <text> glyph)
Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Found while testing crates/engine/src/cmd/mathexpr.rs:~50 (the math.svg query) vs insert at ~64
Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Found while testing crates/engine/src/script.rs:30-47 (parse: `t.lines().enumerate()` runs over the trimmed text)
Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>