Commit Graph
2702 Commits
Author SHA1 Message Date
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
Brandon ThomasandClaude Opus 5.5 14e677b242 Bump version to 0.4.0 (from 0.3.0) for release
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
v0.4.0
2026-10-08 10:02:08 -04:00
d26b91335c README Downloads: where to get it first, then builds with Windows before macOS (#135)
Co-authored-by: Brandon Thomas <shared2@storyteller.ai>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 09:50:30 -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
865640b70a Release: FreeBSD x86_64, Flatpak x86_64/aarch64, AppImage zsync updates; README Downloads (#132)
- freebsd job: builds packaging/freebsd/package.sh in a FreeBSD 14.3 VM (same image and
  packages as freebsd.yml) into designcraft-<ver>-freebsd-x86_64.tar.gz.
- flatpak jobs (x86_64 on ubuntu-24.04, aarch64 on ubuntu-24.04-arm): repackage the Linux
  tarball with packaging/linux/flatpak-bundle.sh and a new bundle manifest; runtime and
  finish-args shared with the from-source manifest (checked by packaging-lint).
- AppImages embed gh-releases-zsync update information and ship a .zsync beside them.
- version, linux, web, flatpak and freebsd no longer use the release environment (they read
  no secrets), so a workflow_dispatch on a branch dry-runs them; the signing jobs and the
  draft release stay environment-gated.
- nfpm package description described an image editor; now describes DesignCraft.
- README: Downloads section listing every build.

Co-authored-by: Brandon Thomas <shared2@storyteller.ai>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 09:38:16 -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 67c05eb22c README: PDF and EPUB export ship (#60) 2026-10-08 08:30:57 -04: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
aiongg b7a1ff8f2b CLI: run rejects an export option with no export after it (#67)
--page, --scale and --pdf-options apply to the exports that follow them; one
given after the last --export or --all-pages did nothing and said nothing.
The usage text and docs/agents.md say so.
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
Brandon ThomasandClaude Opus 5.5 5382fd4fb7 Bump version to 0.3.0 (from 0.2.1) for release
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 08:13:12 -04: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
Gert Pellin 36255f1697 Desktop: no eprintln! on the log and panic paths
eprintln! panics when standard error is a broken pipe (a GUI launch on
Windows), and a panic inside the panic hook aborts. The "no log file"
message goes through log::warn! (standard error only by then); the panic
hook's fallback writes to standard error with write_fmt and ignores the
error. Same fix as storytold/vectorcraft#465.
2026-10-08 13:01:13 +02: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
Gert Pellin 4f25955002 Desktop: write log records to standard error and a rotating log file
The desktop app installed no logger, so every log::warn!/log::error! in
the workspace was discarded: the crash guard's panic report, a failed
crash-recovery save, font folders that can't be read. A launch from a
desktop menu has no terminal either, so there was nothing to attach to a
bug report.

apps/designcraft/src/logging.rs (no new dependency):
- standard error plus <settings dir>/logs/designcraft.log (beside
  ui.json and prefs.json); each launch rotates the previous log to
  designcraft.1.log and .2.log, so the log of a run that crashed
  survives the next start; the file is capped at 16 MiB
- records logged before the settings directory is known are buffered
  (bounded) and written once the file is attached
- default levels: info for designcraft*, warn for everything else;
  RUST_LOG replaces them with env_logger-style directives
- never panics: an unusable directory or a failed write leaves standard
  error as the only sink

The logger is installed first in main (before the engine's panic hook)
and the file is opened after argument parsing (--version leaves no
file). The settings directory moves out of prefs_path into config_dir.
A --control or DESIGNCRAFT_CONTROL_PORT value that is not a port is now
logged instead of silently leaving the control channel off. Documented
in README.md (Quick start > Logs).
2026-10-08 11:36:29 +02: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