Commit Graph
2291 Commits
Author SHA1 Message Date
zydvc26s67-webandCopilot App fde78978a4 Paragraph Styles: wire save and delete into the UI (#169)
The engine already supported style.paragraph.edit and
style.paragraph.delete, but the UI never exposed a delete action and
edit was only reachable by double-clicking a style row, with no
visible affordance.

- Add "Edit Paragraph Style…" and "Delete Paragraph Style…" entries to
  the paragraph style row context menu (hidden for built-in styles).
- Add a new deleteParagraphStyle confirmation dialog that detects
  whether the style is currently in use and, if so, lets the user pick
  a replacement style (defaulting to [Basic Paragraph]) for affected
  text before deleting.
- Add engine tests covering paragraph style edit (attribute merge and
  rename propagation), based-on cycle rejection, delete with text
  reassignment, and rejection of built-in style deletion.
- Add UI-level tests covering the edit dialog persisting changes and
  the delete dialog removing a style and reassigning text, including
  the default replacement style.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-10-08 14:55:11 -07:00
skylar taylor-barrick 4e4eaad1c8 PERF-MEM: release retired layouts and trim edit-history capacity 2026-10-08 15:35:20 -06:00
Philipp Krüger a11bd021cd feat(pptx): export documents as editable PowerPoint presentations
New designcraft-pptx crate (L3) and file.exportPptx command (File ›
Export PowerPoint…, CLI --export x.pptx). Each page becomes a slide of
native objects: shapes with fills, gradients, strokes and effects,
pictures cropped like their frames, native tables, and text boxes.

Text keeps DesignCraft's composition by default: composed lines end in
line breaks, justified spacing becomes character spacing, and leading
becomes percentage line spacing (PowerPoint rounds exact spacing to
whole points; its 100% line is 1.2 em for every font). Threaded
stories split at their frames and wrapped lines get their own boxes.
lineBreaks: reflow writes one box per frame in native columns instead.

TrueType fonts are embedded as Embedded OpenType when their licences
allow. Objects PowerPoint can't represent (placed PDF/EPS, type on a
path, some effects) are rasterised through the existing
rasterize_where path.

Checked in PowerPoint for Mac and LibreOffice: on the sample magazine,
word positions match DesignCraft's PDF to within 0.8 pt horizontally
and 1.6 pt vertically.
2026-10-08 23:32:53 +02:00
skylar taylor-barrick abf9a40dc0 PERF-CI: use fixed-size chunks in PSD decoding 2026-10-08 15:29:32 -06:00
skylar taylor-barrick b050343a6c links.relink: make replacements atomic and retain EPS sources 2026-10-08 11:13:17 -06:00
Jan Hallvard LarsenandClaude Opus 5.5 c63ca54227 Import: RTF and Tagged Text keep characters past U+FFFF
Placing an RTF or Tagged Text file dropped every character outside the
Basic Multilingual Plane: emoji, mathematical letters and the rarer CJK
ideographs such as 𠮷 (U+20BB7, used in Japanese names). The text
around them came in, so the loss was silent. It also broke our own round
trip: Export Text writes these characters correctly and Place lost them.

Both formats carry such a character as a UTF-16 surrogate pair, two
units in a row: \u-10179?\u-8704? in RTF, <0xD83D><0xDE00> in Tagged
Text. Both readers passed each unit to char::from_u32 on its own. Half a
pair is not a character, so each half was dropped.

A small shared Utf16Units joins the units: a first half waits for the
second, and the pair becomes one character. Half a pair with no partner
is still left out, as before.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-08 16:33:44 +01:00
Skylar Taylor-Barrick 6a53d95895 Security: escape HTML and EPUB metadata 2026-10-08 15:31:35 +00:00
aiongg 7d064f268e UI: the Contextual Task Bar moves by its grip and stays where it is dropped, with Pin Bar Position and Reset Bar Position in its menu 2026-10-08 11:27:01 -04:00
Jan Hallvard LarsenandClaude Opus 5.5 1ed206642f PDF: a damaged PNG, GIF or WebP is skipped, not fatal
A placed PNG, GIF or WebP that is cut off (an interrupted download) or
has a bad checksum made the whole PDF export fail with
"PDF writer error: Image(Image(ImageRepr {..}), None, "unexpected end of
file")", which names no file. A damaged TIFF or BMP in the same place is
skipped with the warning "image `name` could not be decoded and was
skipped", and the rest of the document is exported.

The exporter decides whether an image can be embedded by asking krilla
to open it. krilla opens PNG, GIF and WebP lazily: it reads the header,
accepts the file, and decodes the pixels only when the PDF is written,
where an error ends the export. TIFF and BMP are decoded by us first, so
they took the skip path.

lossless() now decodes the image first for every format. A file that
does not decode returns None and takes the existing skip-with-warning
path. This costs one extra decode per PNG, GIF or WebP asset: the sample
magazine (two PNGs, 820 KB) exports in 0.19 s instead of 0.17 s in a
debug build.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-08 16:26:30 +01:00
Jan Hallvard LarsenandClaude Opus 5.5 c84eb56258 UI: closing a document with unsaved changes asks first (#141)
File ▸ Close, its shortcut (Ctrl/Cmd+W) and the tab's × closed a document
with unsaved changes at once. Closing also discards the document's
recovery data, so the edits were gone for good.

The three user paths now go through menus::close_document. A document
with unsaved changes opens a dialog with Save, Don't Save and Cancel:

- Save runs the same Save the menu does, then closes. If the document
  is still unsaved afterwards (the file picker was cancelled), it stays
  open.
- Don't Save closes it.
- Cancel (or Escape) does nothing.

A document with nothing to save closes as before. The engine command
file.close is unchanged and never asks, so scripts, MCP and the control
channel's engine.execute keep working unattended. ui.menu.invoke without
params acts like the menu item, as it does for other dialogs.

Quitting the app is not covered here. Recovery data survives a quit, so
unsaved documents come back on the next start.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-08 16:20:51 +01:00
Jan Hallvard LarsenandClaude Opus 5.5 20422c4725 UI: the Control panel shows its second row
In every workspace that shows the Control panel (Advanced, Typography,
Printing and Proofing, Book), the second row of fields was cut off at the
panel's lower edge: Y and H in object mode, leading, tracking and the
indents in text mode.

The panel lays its groups out in a row that centres each child
vertically. The two-row grids were placed as if they were one row tall
and then grew downward, so they started 13.5 pt below the panel's top
instead of at it and ended 5.5 pt past the 59 pt panel.

The row is now top-aligned, which is where the font menus, the
separators and the reference-point proxy already sat.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-08 16:14:24 +01:00
Jan Hallvard LarsenandClaude Opus 5.5 e8ee4cffb4 Docs, About: the Illustrator-class sibling is VectorCraft (#59)
DrawCraft was renamed VectorCraft, and its repository is now
storytold/vectorcraft. Three places still used the old name:

- AGENTS.md and CLAUDE.md told contributors and agents that the sibling
  checkout lives at ../drawcraft. A clone made from the README link lands
  in ../vectorcraft, so that path does not exist.
- The About window's sibling list used the app-page slug "drawcraft".
  getartcraft.com/apps/drawcraft still redirects to /apps/vectorcraft,
  so the link worked, but the README (which the list says it matches)
  uses /apps/vectorcraft.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-08 16:04:52 +01:00
Jan Hallvard LarsenandClaude Opus 5.5 9ec7858dc9 Web: AltGr and other named keys no longer type their names (#134)
In the browser, pressing AltGr while editing text on the canvas inserted
the word "AltGraph" into the story.

eframe's web backend (0.36.2, web/input.rs text_from_keyboard_event)
turns a keydown into a text event unless the key is on a fixed list of
names. Browsers report many more named keys than that list holds:
AltGraph, Dead, Unidentified, the media keys. Each one arrived as text.
Panel text fields are not affected, because a focused egui text field
takes its text from the browser's input events instead of keydown.

The web shell now drops a text event that is a key name (ASCII letters
and digits, starting with a capital, longer than one character) unless
an egui text field has the keyboard. One key press never types such a
word; a text field's input events can, so they are left alone.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-08 15:54:52 +01:00
aiongg 9fec15876a UI: captions in a sideways-scrolled bar stay on one line
The last group of a scrolled Control bar row got only the width left
over, so a caption like Columns wrapped one letter per line.
2026-10-08 10:51:46 -04:00
Jan Hallvard LarsenandClaude Opus 5.5 7c739feb6f Commands: huge row and column counts can't exhaust memory
Three commands took a count from their parameters and used it unchecked.
Parameters come from MCP, the control channel and scripts, so the count
is hostile input (never-crash: cap input-sized allocations, checked
arithmetic).

- layout.createGuides made one or two guides per row and column with no
  upper limit: 30 million rows took 1.2 GB, and 2^32 - 1 would exhaust
  memory, which aborts the process past the command guard. A count over
  2^32 wrapped to a small one. Both counts are now capped at 100.
- edit.stepAndRepeat multiplied rows by columns as usize. In debug builds
  the overflow panicked; in release builds 2^32 x 2^32 wraps to 0, passes
  the 1000-copy limit and starts a grid of 2^64 copies. The product is
  now checked, and a grid that large falls back to `count` copies like
  any other grid over 1000.
- file.new stored any column count in the page (4 billion, or a wrapped
  value past 2^32). Page::column_rects builds one rect per column each
  time the columns are laid out. The count is now clamped to 1..=216,
  the range layout.marginsAndColumns already uses.

Each case has a regression test that failed before the fix.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-08 15:45:15 +01:00
Jan Hallvard LarsenandClaude Opus 5.5 27b5c871bd Images: PSD decode passes clippy on Rust 1.98
Rust 1.98 adds the clippy lint chunks_exact_to_as_chunks. It flags two
loops in the PSD decoder, so `cargo xtask ci` stops at the clippy step on
unmodified main for anyone on current stable.

Both loops now use as_chunks / as_chunks_mut (stable since 1.88, below the
workspace rust-version 1.90). The chunks are arrays, so the try_from that
could never fail goes away too. Decoded pixels are unchanged; the existing
PSD tests cover both paths.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-08 15:32:20 +01:00
aiongg 63a1f03498 UI: the Properties panel's Character section sets the text's language, from the same list as the Character panel (#130) 2026-10-08 10:14:18 -04:00
aiongg 8ddd20d95d UI: right-clicking a ruler picks that ruler's units, and the vertical ruler measures in the vertical units (#133) 2026-10-08 10:10:41 -04:00
aiongg ca0ab6e551 UI: Character Style Options edits a character style's name, Based On and character formats, opened by double-clicking the style, Edit in its menu, or New Character Style… 2026-10-08 10:03:57 -04:00
aiongg 11585c82fa Styles: editing a character style renames it everywhere it is used, changes its Based On and unsets attributes; [None] can't be edited 2026-10-08 09:46:59 -04:00
aiongg cab09f41eb UI: every font field opens the same searchable font menu, with the search ready for typing and hidden system fonts left out 2026-10-08 09:30:19 -04:00
Shao Wenbin 9f655739fa CJK-REVERT2: withdraw speculative spacing rules and narrow import rejection
Restore the previous preset and character-class coverage. Remove regional punctuation and Tsume policy changes while retaining cluster, tracking, and spacing-allocation repairs. Preserve finite unsupported rows for diagnostics instead of rejecting whole documents.
2026-10-08 20:36:21 +08:00
Shao Wenbin 56febef6ab CJK-REVERT1: revert CID preference and diagnostic expansion
Revert 20ce4f5 because the compatibility extension does not implement CID-based layout and is not required for the verified spacing repairs.
2026-10-08 20:32:53 +08:00
aiongg 79f9d56cef MCP: docs name the UI-only commands precisely; app.links works headless (#62) 2026-10-08 08:30:57 -04:00
aiongg 75aa5356ba MCP: document that text offsets and story lengths are UTF-8 bytes (#68) 2026-10-08 08:30:57 -04:00
Shao Wenbin 20ce4f5ecd CJK-MOJI9: preserve CID preferences and report unsupported glyph classification 2026-10-08 20:24:59 +08:00
Shao Wenbin 1e32767cef CJK-MOJI8: preserve narrow punctuation and manual body compression 2026-10-08 20:18:30 +08:00
Shao Wenbin bc43965a45 CJK-MOJI7: validate spacing data and inspect nested typography rules 2026-10-08 20:14:16 +08:00
Shao Wenbin d9f24b6ad5 CJK-MOJI6: respect glyph clusters and regional punctuation metrics 2026-10-08 20:09:29 +08:00
Shao Wenbin a35f03c126 CJK-MOJI5: balance spacing priorities and fit discrete compression endpoints 2026-10-08 20:05:19 +08:00
Shao Wenbin 14b04cbaf8 CJK-MOJI4: implement public preset boundary policies and punctuation classes 2026-10-08 20:01:57 +08:00
Shao Wenbin d16a7423b8 CJK-MOJI3: report only unsupported Mojikumi rules in preflight 2026-10-08 19:55:16 +08:00
Shao Wenbin c66d502c79 CJK-MOJI2: apply Mojikumi spacing and kinsoku priorities during composition 2026-10-08 19:54:22 +08:00
Shao Wenbin e1755c3cbe CJK-MOJI1: resolve Mojikumi tables and preserve IDML references 2026-10-08 19:50:50 +08:00
Shao Wenbin 4f8d230d70 CJK-BASE: integrate font resolution and special-text preflight branches 2026-10-08 19:50:38 +08:00
Shao Wenbin af43dd88c9 FONT7: validate replacement coverage and reject placeholder font fallbacks 2026-10-08 19:19:33 +08:00
Shao Wenbin f36636b95f FONT6: unify localized font matching and replacement recommendations 2026-10-08 19:02:39 +08:00
Shao Wenbin 39482d1b8c FONT5: diagnose missing glyphs in generated text with frame locations 2026-10-08 18:56:14 +08:00
Shao Wenbin 06ed81e547 FONT4: resolve composite fonts and fallback for generated note labels 2026-10-08 18:54:26 +08:00
Shao Wenbin 4f1aa8773d FONT3: prompt for missing fonts when opening documents 2026-10-08 18:34:32 +08:00
Shao Wenbin 6c18ccdc3b FONT2: resolve inherited fonts during document-wide replacement 2026-10-08 18:33:42 +08:00
Shao Wenbin 2dbbf98900 FONT1: preserve composite font references and unify usage checks
Resolve imported composite fonts by resource identity and preserve literal
display names. Export AppliedFont as an object reference instead of registering
a composite definition as an ordinary font family.

Share composite lookup and typed font usage between composition, font inventory,
and preflight. Include nested cells and notes, and report only component fonts
selected by the document's characters.

Add synthetic coverage for reference round trips, footnote character mapping
and metrics, nested font inventory, component replacement, and undo.
2026-10-08 18:21:10 +08:00
Shao Wenbin 7c10b3ad41 IDML1: preserve anchored text frames and footnote artwork
Resolve forward story references before importing embedded frames and groups.
Compose embedded stories, retain anonymous-story objects for screen and PDF
rendering, and invalidate layout caches when embedded frame geometry changes.

Measure inline objects by geometry, fill open contours, reject cyclic frame
references, and distinguish unplaced stories from located overset text.

Add synthetic round-trip, composition, preflight, pixel-rendering, and PDF
regressions. Update the roadmap with the supported import and rendering paths.
2026-10-08 18:08:44 +08:00
skylar taylor-barrick 637d05e776 #91: reject PDF pages before narrowing on Wasm 2026-10-08 00:31:43 -06:00
skylar taylor-barrick bae5a92dbb #72: preserve typed generic dialog values 2026-10-08 00:23:35 -06:00
skylar taylor-barrick e3d2312f00 #89: preserve browser import context and PDF options 2026-10-08 00:15:24 -06:00
skylar taylor-barrick e9cc4b49ec #61: honor MCP typing, story and page contracts 2026-10-08 00:08:17 -06:00
skylar taylor-barrick 8662526736 browser-correctness: fix print, startup flags, and document MIME 2026-10-08 00:08:16 -06:00
Haseom Shin ac4c7e6b8e Images: set SVG text in the shared fonts when the bundled ones lack it 2026-10-08 14:58:56 +09:00
Haseom Shin 36000e75f5 Compose: don't panic when a hyphenated paragraph starts with a no-break letter 2026-10-08 14:58:08 +09:00