Commit Graph
2702 Commits
Author SHA1 Message Date
aiongg d11ccad30a Merge #523: Parent-page items are composed for their page by index, not page name
Conflict: crates/pdf/src/export.rs: next's cycle guard (item -> item_guarded) and frame_objects (notes and cells) with the PR's page: Option<usize>; the PR's anchored-object loop dropped (frame_objects covers it)
Conflict: crates/render/src/lib.rs: stories keyed by (StoryId, Option<usize>) plus next's drawing_items; next's draw_item -> draw_item_inner guard with page: Option<usize>
2026-10-12 00:14:33 +00:00
aiongg 117420a829 Merge #522: Every command that writes story text reads CR as a paragraph return
Conflict: ROADMAP.md: both progress-log lines
Conflict: crates/engine/src/cmd/table.rs: next's setCell (StrokeEdit/EdgeSel, edit_table with ID) with the PR's text_param for the cell text
2026-10-12 00:12:48 +00:00
skylar taylor-barrick 65ef027f9f Merge pull request #452 from storytold/codex/craft-print
M6: Adopt craft-print and support Windows PDF printing
2026-10-11 18:12:43 -06:00
aiongg 059f9a40ef Merge #519: Corner Options keep curves and round every corner point
Conflict: ROADMAP.md: both progress-log lines
Conflict: crates/geom/src/corners.rs: tests keep next's radius_is_clamped_to_half_the_shorter_side and box_outline_rounds_only_closed_corners plus the PR's nearest, quarter_disc and three tests
2026-10-12 00:12:34 +00:00
aiongg aee3748be2 Merge #411: Undo: a command that runs another is one undo step
Conflict: crates/engine/src/guard.rs: next's snapshot tuple without revision (bump_revision on restore) + the PR's saved in_undo_step
2026-10-12 00:12:13 +00:00
aiongg 461598a149 Merge upstream main 66860bd1
Conflict: crates/engine/src/cmd/file.rs: next's pdfCrop/PdfCrop placement and trim-box test (next already has #511 with later work)
Conflict: crates/ui-egui/src/panels/mod.rs: next's Find/Replace Font row and swatch_list_tests (next already has #447)
2026-10-12 00:12:05 +00:00
aiongg 66860bd1de UI: Return and Escape in the font menu stay in the menu, never reach the dialog under it (#447)
Every font field's menu (Control bar, Contextual Task Bar, Properties > Character,
Character and Glyphs panels, Paragraph/Character Style Options, Find/Replace Font)
keeps its search focused and open on a click and filters as you type. In a dialog,
Return picked the highlighted family and also pressed OK, and Escape closed the
menu and cancelled the dialog: the menu now consumes the keys it uses. The
drawn font fields report themselves as combo boxes to screen readers.
2026-10-11 17:40:06 -06:00
japbcoelhoandClaude Opus 5.5 2b46ca664c Hyphenation: Portuguese text is hyphenated with hyph-utf8's Portuguese patterns (#512)
Text set in Portuguese ("Portuguese: Brazilian", "Portuguese", pt_BR) got
no hyphenation, so justified Portuguese columns could only stretch their
word spaces (up to 335 % of the normal space in a 56 mm column of 10 pt
Times).

Turn on hypher's "portuguese" feature, beside Spanish: hyph-pt.tex 1.4
(2024-07-13) from hyph-utf8, BSD-3-Clause, credited in NOTICE.
Lang::for_language already maps the Portuguese names and locale codes.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 17:39:53 -06:00
japbcoelhoandClaude Opus 5.5 3dc0a1563a Place: PDF pages and SVGs keep their exact size (#511)
file.place sized a placed PDF page (and SVG) from its size rounded to
whole points, while the export draws the page into that size: a page of
91.774 x 613.276 pt became 92 x 613 and was drawn 0.25 % wider and
0.3 % shorter, so pieces laid edge to edge left gaps of up to 1.9 pt.
A 100.4 x 50.4 pt page placed 100.4 pt wide came out 50.2 pt tall:
`Rect { x0: 0.0, y0: 0.0, x1: 100.4, y1: 50.2 }`.

The graphic's natural size is now the exact page (crop box) or SVG size;
the rounded pixel size stays for display and preflight. place.load (the
place cursor) gets the same exact size.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 17:39:40 -06:00
skylar taylor-barrick 957890223a M6: Pin craft-print with native driver capability validation 2026-10-12 01:20:53 +02:00
moppeeerandClaude Opus 5.5 65ddf1f119 feat(ui): Rotation, shear, scale, rotate and flip in Properties › Transform
InDesign's Properties › Transform shows, under X/Y/W/H, the rotation
and shear angles beside the X and Y scale, then buttons to rotate a
quarter turn either way and to flip horizontally or vertically.
DesignCraft's showed only X/Y/W/H; the rest was in the Control bar
and Object › Transform. The fields set totals through transform.set
around the reference point; the buttons run transform.rotate and
transform.flip. Rotate and flip icons are original drawings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 00:34:51 +02:00
moppeeerandClaude Opus 5.5 1e34026a79 fix(render): One underline bar per stretch of text, no seams
The canvas drew an underline (and a strikethrough) as one rectangle per
glyph; where two anti-aliased edges met at a fractional pixel they left
a lighter seam between the letters. Contiguous bars of the same colour
and position are merged into one, as the PDF export already does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 00:29:17 +02:00
moppeeerandClaude Opus 5.5 d6ddf749fe fix(compose): Words in capitals hyphenate like capitalized words
A word typed in capitals was never hyphenated, so a heading such as
FERRUM COMMODI UNTI moved the whole word to the next line where InDesign
breaks it (COM-MODI). Capital words now follow Hyphenate Capitalized
Words like words with a capital first letter: on by default, and turning
it off keeps both, acronyms included, whole.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 00:24:48 +02:00
moppeeerandClaude Opus 5.5 83584feb03 feat(engine): Report the selected text; remember recently used fonts
type.selectionAttrs reports the start of the selected text on one line
(`selectedText`, up to 60 characters), for previews such as the font
menu's Selected Text sample. The preferences keep `recentFonts`, the
fonts last picked in the font menus.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 00:14:13 +02:00
moppeeerandClaude Opus 5.5 1009d59d26 feat(fonts): A family's kind without keeping it loaded
ScopedFonts::family_kind reads a family's format, class, PANOSE and file
date from its Regular face. A loaded face is asked; an installed family
that isn't loaded is read from its file, which is let go afterwards,
instead of loading every family the font menu's filters look at for the
rest of the session. Files over MAX_DOCUMENT_FONT_BYTES are skipped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 00:14:12 +02:00
moppeeerandClaude Opus 5.5 1ff2cda02b feat(fonts): Font format, classification and PANOSE for the font menus
Each face reports what InDesign's font menu shows and filters by, read
once from its tables: its format (TrueType, OpenType/CFF, variable,
colour), its class (serif, slab serif, sans serif, script, monospaced,
decorative, symbol) from PANOSE, else the OS/2 IBM family class, else
the family name, else the shape of its "l" (serifs widen the foot), its
PANOSE numbers (with a distance for similar fonts) and when its file
was added.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 00:14:12 +02:00
moppeeerandClaude Opus 5.5 15d2b998f0 fix(ui): Screen Mode checks the current mode; Japanese View submenu paths
View › Screen Mode showed no check mark (checked() had no view.screenMode
arm), so with the Normal/Preview row gone nothing showed the current
mode. ja.rs still translated the old Type/Proof Setup, Type/Rotate Spread
and Type/Separations Preview paths; it now has the View/… paths,
Screen Mode, Extras and Structure included.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 00:09:46 +02:00
moppeeerandClaude Opus 5.5 60bf43b9e8 fix(ui): A tint keeps each object's swatch, and no stroke stays none
Changing the Tint in the Fill menu sent the first object's swatch with
it, so with several objects selected every fill became that swatch; and
a Stroke tint on a frame without a stroke gave it the default 1 pt black
stroke.

object.fill now takes a tint alone and keeps each object's swatch, and
object.stroke with only a tint leaves a [None] stroke alone; the menu
sends just the tint.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 00:06:18 +02:00
moppeeerandClaude Opus 5.5 95a5317b0b fix(engine): note.edit reads CR as a paragraph return too
note.edit was the one story-text command still reading `text` without
text_param. The progress-log line held real CR and CRLF characters where
it meant to show the escapes; it reads `\r` and `\r\n` now.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 00:00:30 +02:00
moppeeerandClaude Opus 5.5 c6d2856688 fix(geom): Trim straight sides exactly for Corner Options
Straight sides were trimmed through inv_arclen at 1e-3 accuracy, so a
rectangle's corner points landed up to about 1e-4 pt off. Lines are now
measured and trimmed along the chord, exactly; curves still use arc length.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 23:57:34 +02:00
Sean HammondandClaude Opus 5.5 5898c084b6 Parent-page composition: the page's name is part of the cache signature
Keying parent-page compositions by page index (previous commit) dropped the
page name from the cache key, and the signature only counts sections, so a
page-number marker on a parent page kept its old text after a section's
start number, style or prefix changed (renaming the page without changing
its index). The page's name is now hashed into the signature whenever a page
is given, so renumbering recomposes it as it did before, while two pages that
share a name stay separate.

Test: parent_page_number_follows_section_renumbering (marker on a parent
page, composed for page 3; the first section restarted at 100) fails before
(still "3", 1 glyph) and passes after ("102").

Reported by aiongg on #523.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CgGsJkVe5GYG9qK6VFdECa
2026-10-11 21:17:42 +00:00
aiongg bfe6cf8518 Integration: format the Paragraph Style Options justification check (#531 × paragraph style sections)
The merge of #531 moved its style-dialog justification check into next's confirm_paragraph_style_options (from our paragraph style sections work); rustfmt wraps the moved line.
2026-10-11 20:51:10 +00:00
aiongg f5ee268962 Merge justification-dialog: a Justification dialog for the selected paragraphs (#531)
Conflict: ROADMAP.md: both progress-log entries, #531's above next's 2026-10-11 lines.
Conflict: docs/typography-parity.md: status line lists next's changes and the Justification dialog.
Conflict: crates/engine/src/cmd/text.rs: selection_attrs keeps next's typing-format chars and adds paraMixed for {mixed: true}; mixed_para_attrs sits beside next's apply_typing_format and link_style.
Conflict: crates/ui-egui/src/dialogs.rs: titles, draw and confirm arms for both paragraphLocal and justification; the style dialog's justify arm calls the shared justification(), which uses next's composer_choice (Japanese composers) and selects neither composer when mixed; the style dialog's justification check moved into next's confirm_paragraph_style_options (section set to justify, reason in next's status line); tests from both sides.
Conflict: crates/ui-egui/src/i18n/ja.rs: union of rows.
Conflict: crates/ui-egui/src/i18n/uk.rs: union of rows.
Conflict: crates/ui-egui/src/menus.rs: UI_COMMANDS, run_ui arms and Type menu keep next's Paragraph Borders and Shading, Span Columns and Bullets and Numbering plus Justification… (Cmd+Alt+Shift+J, free on next) right after Paragraph Rules…; menu_enabled keeps next's IME check before the type.para check.
Auto-merged crates/ui-egui/src/panels/properties.rs: Justification… joins the Paragraph panel menu list after Paragraph Rules….
2026-10-11 20:49:57 +00:00
aiongg 1a9499b465 Merge document-grid: View draws the document grid (#530)
ROADMAP.md: both progress-log lines
docs/target-app-parity.md: next's lines plus the document grid
2026-10-11 20:47:12 +00:00
aiongg 3f752312d6 Type: Justification dialog for the selected paragraphs (#531)
Type > Justification... and the Paragraph panel menu (Cmd+Alt+Shift+J) open
the Justification controls of Paragraph Style Options for the selected
paragraphs: word and letter spacing, glyph scaling, composer, kashidas and
Korean line breaks. Values that differ across the selection show empty, and
OK applies only the edited fields through type.para as one undo step.
Spacing values outside their range or out of minimum/desired/maximum order
keep the dialog open with the reason, in both dialogs.

type.selectionAttrs takes {mixed: true} and lists the paragraph attributes
that differ across the selected paragraphs as paraMixed.
2026-10-11 20:46:38 +00:00
aiongg 61504dae48 View: draw the document grid (#530)
Show/Hide Document Grid (View > Grids & Guides, Cmd+') draws the grid
on the positions Snap to Document Grid uses: subdivision and major
lines from each page's top-left corner, across the spread's band of the
pasteboard, behind or in front of page items as the grid settings say.
Dense lines are left out at low zoom. The Properties toggle runs the
command.
2026-10-11 20:46:38 +00:00
skylar taylor-barrick 3ec5cef6a2 M6: Adopt merged craft-print with scaling and queue duplex defaults 2026-10-11 22:14:24 +02:00
aiongg d240ecb0b9 Merge idml-spread-rotation: IDML keeps a spread's view rotation
ROADMAP.md: both progress-log lines
crates/idml/src/tests.rs: next's test modules plus spread_rotation
docs/target-app-parity.md: next's lines; Rotate Spread names IDML's spread transform
2026-10-11 20:11:34 +00:00
aiongg a8fc6a5219 IDML: read and write a spread's view rotation (#484)
Rotate Spread is the rotation part of the Spread element's ItemTransform.
Import maps the three quarter-turn matrices to view_rotation on the spread's
first page and treats anything else as no rotation; pages and items keep
their unrotated spread coordinates. Export writes the rotation part for
document spreads; parent spreads stay identity.
2026-10-11 20:11:05 +00:00
aiongg 5a7a3ebefd Integration: Control bar tests find the bar's own button when Properties has one with the same name (#524 × object controls) 2026-10-11 19:19:07 +00:00
aiongg 1ff299adf2 Merge place-no-autofit update: the fitting test names its fitting 2026-10-11 19:18:07 +00:00
aiongg 54b607525e Place: the fitting test names its fitting, since a placed image no longer auto-fits 2026-10-11 19:18:07 +00:00
aiongg 3725b90a2a Integration: context menu test expects Paste available with nothing copied (#84 update)
The #84 update enables edit.paste whenever a document is open, since the system clipboard may hold another app's text. next's right_clicking_an_object_selects_it_and_its_menu_arranges_it (from the context-menu work) asserted Paste greyed before any copy; it asserts Paste is available.
2026-10-11 19:14:30 +00:00
aiongg 83893ba3f0 Integration: menu_row matches only buttons that aren't toggles (#524)
#524 gives icon buttons their tooltip as accessible name, so the Task Bar's icon toggles share names with menu rows. right_clicking_an_object_selects_it_and_its_menu_arranges_it and rows_hidden_in_the_menu_bar_are_hidden_in_context_menus found two nodes; the canvas tests' menu_row helper skips toggle buttons.
2026-10-11 19:12:15 +00:00
aiongg f1459e6e64 Merge #524: Pathfinder section in Properties
Conflict: ROADMAP.md: both progress lines kept, the PR's first
2026-10-11 19:12:01 +00:00
aiongg 13fb00fd08 Integration: transform.move on content reports the ids it moved (#521)
#521 makes transform.move return {moved, ids}; next's move_content (the content-selection path, content?) returned only {moved}. It returns the ids of the items whose content or frame moved, and copies_report_their_ids checks it.
2026-10-11 19:11:53 +00:00
aiongg 3af8c6275d Merge #521: Copies report their ids
Conflict: ROADMAP.md: both progress lines kept, the PR's first
Conflict: crates/engine/src/cmd/object.rs: transform.move params doc is next's (with content?) plus the PR's return text; next's test modules and the PR's copy_ids_tests both kept
2026-10-11 19:11:43 +00:00
aiongg 12647790c8 Integration: formatting_affects_text test fills with default swatch names (#520)
#520 makes object.fill refuse a name that isn't a swatch; next's Formatting Affects Text test filled the frame with "Cyan" and the text with "Magenta". It uses the default swatches C=100 M=0 Y=0 K=0 and C=0 M=100 Y=0 K=0. No other caller passes a bare name.
2026-10-11 19:11:24 +00:00
aiongg fc05e814df Merge #520: Object fills and strokes must name a swatch
Conflict: ROADMAP.md: both progress lines kept, the PR's first
Conflict: crates/engine/src/cmd/object.rs: next's reorder/group test modules and the PR's swatch_name_tests both kept
2026-10-11 19:10:39 +00:00
aiongg d8f1e69882 Merge place-no-autofit: an image placed into a frame leaves Auto-Fit off
Conflict: crates/engine/src/cmd/file.rs: next's natural-size (bw, bh) fill with the branch's comment; both place-into-frame paths set auto_fit to the default
2026-10-11 19:10:20 +00:00
aiongg 53d57e7e17 Merge #84 update: paste text with no insertion point makes a text frame
Conflict: crates/engine/src/cmd/edit.rs: edit.paste params doc joins next's `spread?: index (0)` with the branch's text-frame and `at?` text; enablement is the branch's has_doc
Conflict: crates/ui-egui/src/canvas.rs: next's current_spread and the branch's view_centre both kept
2026-10-11 19:10:07 +00:00
aiongg 1da2bb9082 Place: an image placed into a frame fills it once and leaves Auto-Fit off 2026-10-11 18:59:08 +00:00
aiongg 162a7f14bb Paste: text from another app with no insertion point becomes a new text frame (#518)
Paste with no text insertion point and text on the system clipboard that
does not stand for copied objects creates a text frame holding it,
selected as an object: as wide as the first column of the page's margin
area, as tall as the text (at most the margin area) and centred in the
view. One undo removes it.

edit.paste takes optional spread and at params and is available whenever
a document is open, since the engine cannot see the system clipboard.
The paste keys without a native menu pass the paste event's text; menu
Paste reads the system clipboard. With a native menu, an object copy
records the system clipboard's text at that moment, so older text from
another app still pastes the copied objects.
2026-10-11 18:55:50 +00:00
noah1400 60f463f03c Undo: a caught panic leaves the outer command's undo step (#406)
After a panic the guard said that no undoable command is running. A
command that ran the one that panicked and carried on then had each
later command it ran record an undo step of its own. The guard now
puts that back to what it was when the command started.
2026-10-11 20:50:26 +02:00
moppeeerandClaude Opus 5.5 e1e5c35eeb fix(ui): View items in the View menu, laid out like InDesign's
Rotate Spread, Proof Setup, Proof Colors, Flattener Preview, Show Tag
Markers, Separations Preview and Show/Hide Tagged Frames were at the end
of the Type menu. They are in View now, which follows InDesign's order:
Overprint Preview and proofing, zoom, Rotate Spread, Screen Mode,
Display Performance, rulers, Extras (frame edges, text threads), Grids &
Guides and Structure (tagged frames, tag markers). Show Hidden
Characters stays in Type, as in InDesign; W still toggles Preview.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 20:25:49 +02:00
moppeeerandClaude Opus 5.5 6f2ddfbd7c feat(ui): Tint and Apply To in the Properties Fill and Stroke menus
InDesign's Fill and Stroke menus in Properties › Appearance have a Tint
field and, for a text frame, Apply To: Frame or Text. DesignCraft's
listed only the swatches, so a tint needed the Swatches panel and a
text frame's text colour needed a text selection.

The menus now have both: the tint applies to the fill or stroke of the
frame (object.fill / object.stroke) or of its text (type.char fillTint /
strokeTint); Apply To: Text colours the whole story. With text selected
the menu applies to the selected text, with its tint.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 20:21:51 +02:00
moppeeerandClaude Opus 5.5 191594897b feat(ui): Pathfinder section in Properties
With several objects selected, InDesign's Properties panel shows
Pathfinder: Add, Subtract, Intersect, Exclude Overlap and Minus Back.
DesignCraft had them only in Object › Pathfinder and the Pathfinder
panel. The section sits after Align, with code-drawn icons.

Section titles and icon buttons in Properties now have accessible names
(the title; the button's tooltip), so screen readers can tell them apart.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 20:16:44 +02:00
moppeeerandClaude Opus 5.5 3ec6f47e26 fix(engine): Every command that writes story text reads CR as a paragraph return
frame.create and text.insert turned \r and \r\n into paragraph returns,
but story.replaceRange, story.setText, note.new, footnote and endnote
text, type on a path and table cells kept the CR in the text, where it
drew as a missing glyph and joined the paragraphs. They all use
text_param now.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 20:12:02 +02:00
moppeeerandClaude Opus 5.5 b837371f50 feat(engine): Copies report their ids
transform.move with copy, edit.duplicate and edit.stepAndRepeat
returned only a count, so a script (or an agent) couldn't act on the
copies it had just made. They now return `ids`: the objects moved, or
the copies. The counts are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 20:09:00 +02:00
moppeeerandClaude Opus 5.5 6f053fc7b3 fix(engine): Object fills and strokes must name a swatch
object.fill and object.stroke stored any string as the swatch, so a
name like `Paper` or `Black` (the swatches are `[Paper]`, `[Black]`)
painted nothing without an error. They now refuse an unknown name,
change nothing, and suggest the swatch it was probably meant to be.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 20:06:43 +02:00