Commit Graph
279 Commits
Author SHA1 Message Date
aiongg 3719470140 Integration: format 2026-10-12 17:26:21 +00:00
aiongg 7cc6f6db72 Merge idml-deleted-text (update): deleted text inside nested paragraphs stays deleted; a deleted break doesn't break (#581)
Conflict: crates/idml/src/tests.rs: both sides' tests (#473's SameParaStyleSpacing tests, then the branch's deleted-text tests)
2026-10-12 17:25:31 +00:00
aiongg aef8c39a3b Integration: wrap tests use the top-to-baseline band; a clipping path contour stops at its frame (#384, #561, #589, #557)
an_image_contour_stops_at_its_frame builds its Graphic with next's clip and wrap fields.
a_wrap_object_cutting_a_narrow_frame_leaves_its_sliver_empty and lines_in_band test a line's
band from its top to its baseline. New test: a Detect Edges clipping path overhanging its frame
wraps text (Same As Clipping) only within the frame.
2026-10-12 17:23:45 +00:00
aiongg cb83b6071a Merge contour-wrap (update): a line meets the wrap from its top to its baseline; an image's contour stops at its frame (#384)
Conflict: crates/compose/src/lib.rs: wrap_exclusion keeps next's custom boundary and outline closure, which now yields (outline, clipping frame) and limits the contour to the frame via Contour::within
Conflict: crates/compose/src/lib.rs: contour_path keeps next's (it, kind) form; Same As Clipping (the graphic's clip path) and Bounding Box (shown bounds) return the frame path as the clip, other kinds the frame with no clip
Conflict: crates/compose/src/lib.rs: main loop and estimate_slots keep next's grid and wrap_slot code; wrap_slot drops its desc argument and tests the band from the line top to its baseline (free_slots and the in-band edge search), for both callers
2026-10-12 17:20:50 +00:00
aiongg dad91f0c74 Merge #473: Honor IDML SameParaStyleSpacing between same-style paragraphs (#449)
Conflict: crates/compose/src/lib.rs: same-style gap replaces the pending space; otherwise next's text_above span space-before rule
Conflict: crates/doc/src/attrs.rs: same_para_style_spacing before the drop-cap fields and their doc
Conflict: crates/compose/src/tests.rs: both sides' tests
Conflict: crates/idml/src/tests.rs: both sides' tests
2026-10-12 17:16:10 +00:00
aiongg 254cc49d1b Text wrap: an image's contour stops at its frame 2026-10-12 17:04:48 +00:00
aiongg 90890e37aa Compose: a deleted break doesn't break
A column, frame or page break character that tracked changes delete, or a
hidden condition hides, no longer sends the next paragraph on. Deleted
paragraphs between a live break and the next paragraph don't stop the break.
Tests cover a deleted paragraph range inside a change, a deleted frame break in
both nestings, and a live break before a deleted paragraph.
2026-10-12 17:02:46 +00:00
aiongg 67ae415506 Text wrap: a line meets the wrap from its top to its baseline 2026-10-12 17:02:08 +00:00
aiongg a5fbf5d8d4 Merge table-border-drag: Tables: drag row and column borders with the Type tool
Conflict: crates/compose/src/lib.rs: one re-export line with next's hit_cell_with and the branch's BorderHit/hit_border
Conflict: crates/tools/src/text.rs: next's IME/preedit, guides and unit_selected kept alongside the border drag; border press checked after the Down resets; drag keeps next's `cell_drag || unit_selected` guard after the border branch; Esc cancels a border drag before next's preedit guard; BorderHit via next's `compose` alias
Conflict: crates/tools/src/tests.rs: both sides' appended tests kept
Conflict: docs/target-app-parity.md: next's IDML line, branch's Tables line
Conflict: ROADMAP.md: branch entry on top of next's entries
2026-10-12 14:56:19 +00:00
aiongg 44fde50463 Tables: drag row and column borders with the Type tool
Hovering a table's inner column or row border, or its end or bottom
edge, shows a double-arrow cursor; dragging resizes instead of selecting
text. A column drag changes the column before the border and moves later
columns; Shift keeps the table width (the next column compensates), and
Shift on the end edge scales every column. Rows work the same way, and a
dragged row becomes At Least. Sizes clamp at 3 pt. One undo step per
drag, Esc cancels, locked frames refuse, and the pointer is mapped
through the frame's transform so rotated frames and turned spreads work.

New command table.resizeBorder {story?, table?, frame?, axis, index,
delta | size, keepTableSize?}; the Type tool emits it through
Begin/Preview/Commit. compose::hit_border finds the border under a point
in frame inner space.

Closes #595
2026-10-12 14:52:31 +00:00
aiongg 4f16d88309 Merge #589: (fix)Small frame wrap for overset small text boxes
Conflict: crates/compose/src/lib.rs: next's wrap_obstacles and free_slots kept; frame_specs keeps only exclusions that reach the frame's text area (as wrap.rs does for anchored obstacles), and free_slots applies the 1.5 em minimum segment only when an exclusion reaches the column
Conflict: crates/compose/src/tests.rs: both sides kept; the PR's tombstone tests plus tests for a sliver beside a wrap object in a narrow frame and a narrow first column beside a wrap object in column 2
2026-10-12 14:14:12 +00:00
aiongg 90eab17186 Integration: hyphenation zone applies to both single-line composers
#585 tests Composer::SingleLine; next's Composer also has JapaneseSingleLine, so the zone check uses Composer::single_line().
2026-10-12 14:10:58 +00:00
aiongg 432e1cbbcc Merge #585: Hyphenation Zone applies to the Single-line Composer only
Conflict: ROADMAP.md: both progress-log lines kept
2026-10-12 14:10:25 +00:00
moppeeerandClaude Opus 5.5 0c4a6641cb fix(compose): Hyphenation Zone applies to the Single-line Composer only
InDesign's Hyphenation Zone ("the white space allowed at the end of a
line of unjustified text before hyphenation begins") applies only with the
Single-line Composer. The Paragraph Composer, the default, weighs every
break of the paragraph instead. DesignCraft applied the default 3p0 zone
to both, so ragged paragraphs under the Paragraph Composer refused
hyphens InDesign makes. In LYH Studio's poster tutorial the placeholder
text breaks "aper-natem" and "mosticsia-tur"; ours ran a line longer.

The breaker now gets the zone only for unjustified Single-line Composer
paragraphs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 14:57:09 +02:00
aiongg 72aacb5858 Merge footnote-spacing: Footnotes: notes stack baseline to baseline (#582) 2026-10-12 12:41:20 +00:00
aiongg bc9011863e Integration: format 2026-10-12 12:36:45 +00:00
aiongg e2eae1c62b Merge idml-deleted-text: IDML: tracked deleted text takes no room in the layout (#581)
Conflict: crates/idml/src/import.rs: the branch's `over.change` line moved into next's `range_format()`, which takes the enclosing format for it (its CrossReferenceSource caller passes it too); next's `TextVariableInstance` arm kept beside the branch's `Change` arm, with next's ignore list
Conflict: crates/idml/src/export.rs: kept next's metadata, text-variable and CJK settings helpers and the branch's `change_type`
Conflict: crates/idml/src/tests.rs: kept next's `$ID/` font test and the branch's tracked-change test
2026-10-12 12:36:40 +00:00
aiongg e8d38d13e3 Merge contour-wrap (update): Text wrap: words stay whole beside wrap objects; a segment too narrow for its word stays empty
Conflict: crates/compose/src/lib.rs: kept next's baseline-grid code (grid_end/carry_grid, gyoudori placement) and wrap_slot loop; ported the branch's `need`/`holds`, the `position(holds)` carry selection (which also takes carry_grid) and the `skip_while(!holds)` segment filter, now inside wrap_slot through a `holds` argument (the slot predictor passes one that accepts every segment); #563's wraps_line(line_start) filtering stays
Conflict: crates/compose/src/tests.rs: kept next's Same As Clipping test and the branch's sliver-wrap tests
2026-10-12 12:35:22 +00:00
aiongg 152086b3ea Footnotes: notes stack baseline to baseline (#582) 2026-10-12 12:28:06 +00:00
aiongg fbf0fabd1a Merge #565: fix(compose): enable Norwegian hyphenation patterns
Conflict: docs/typography-parity.md: kept next's Justification row (#531 note), took the PR's Hyphenation row (Portuguese and Norwegian)
2026-10-12 12:23:42 +00:00
aiongg f1a1f318ba IDML: tracked deleted text takes no room in the layout (#581) 2026-10-12 12:00:42 +00:00
aiongg 7ddd99ee4c Text wrap: words stay whole beside wrap objects; a segment too narrow for its word stays empty 2026-10-12 11:58:08 +00:00
Akash Bhat c310cf72ed fix(compose): enable Norwegian hyphenation patterns
Enable hypher/norwegian in designcraft-compose so no/nb/nn map to the bundled hyph-no.tex patterns. Add unit + composition regression tests, NOTICE attribution, and update parity docs.

Fixes #535.
2026-10-12 12:09:40 +05:30
Sean HammondandClaude Opus 5.5 0635dea065 Text wrap: small single-character frames (tombstones) are set beside text wrap
An article's closing tombstone - a one-character text frame, here a 7.6 pt
Noto Emoji symbol in a 10.5 pt box - was overset (red +, nothing drawn)
whenever its spread had a text-wrap object anywhere, while InDesign sets it.

Two causes in the wrap code:
- Every text frame took every wrap object on its spread as an exclusion,
  whether or not the object reached the frame. Now only objects that
  overlap the frame wrap its text.
- free_slot skips gaps narrower than 1.5 em of the paragraph's size
  (slivers beside a wrapped object), but applied that to the whole column
  too when nothing cut it: with a 14 pt paragraph style, no line could go
  in a frame narrower than 21 pt. The minimum now only applies to gaps a
  wrap object cut; a band no object reaches gets the whole column, however
  narrow.

On the document that showed it (an InDesign 2026 IDML with 12 tombstones and
two unrelated wrap objects on the spread), the 12 tombstone stories are set
and no other story's layout changes (54 -> 42 overset stories, all of the
difference the tombstones).

Tests: small_single_character_frame_sets_beside_unrelated_text_wrap and
narrow_frame_sets_lines_no_wrap_object_reaches fail before (overset) and
pass after.

Probably also #476 (Wingdings bullets overset in 20 x 21 pt frames).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CgGsJkVe5GYG9qK6VFdECa
2026-10-12 06:16:04 +00:00
aiongg e5c5f043ee Integration: format 2026-10-12 05:56:41 +00:00
aiongg 5f6ee139da Integration: anchored objects wrap through next's wrap_obstacles (#557 × next's wrap sides and contours)
#557 built an anchored object's exclusion as its offset bounding box; next's Exclusion also has a side and a contour, built by wrap_obstacles for page items. wrap::obstacles keeps the object and its parent → spread transform, and wrap::exclusions runs wrap_obstacles with it, so anchored objects get sides (spine sides by page), contours (Same As Clipping from the clip), custom boundaries, Jump Object and the wrap of a graphic inside, each tagged with the anchor byte (after). Without this the merge doesn't compile. Test: anchored_object_wraps_with_its_contour_and_side.
2026-10-12 05:56:35 +00:00
aiongg 9a95cee172 Merge anchored-wrap: Text wrap: anchored objects wrap text (#557)
Conflict: ROADMAP.md: both progress lines
Conflict: docs/target-app-parity.md: next's header, anchored objects wrapping text added to its change list
Conflict: docs/typography-parity.md: next's header (dated 2026-10-12) with #557's change added; Text wrap row: next's text and caveat, plus "on page items and anchored objects"
Conflict: crates/compose/src/lib.rs: next's Exclusion (side, contour) with #557's after field (Exclusion::wraps_line; next's constructors and the tests' helper set None); next's contour_path and wrap_obstacles in frame_specs; next's line loop (carry, grid, wrap_slot) with the line's start byte passed to wrap_slot; wrap_slot, free_slots and estimate_slots take line_start and skip exclusions that don't wrap the line (Jump Object test and in-band edges included); #557's re-break trigger stays in the line loop
Conflict: crates/compose/src/cache.rs: next's ComposeOptions (section_marker) with #557's neighbour compositions
Conflict: crates/compose/src/tests.rs: both test blocks
Conflict: crates/render/src/damage.rs: #557's test before next's patched_diff helper
2026-10-12 05:54:58 +00:00
aiongg 6e9517b053 Text wrap: anchored objects wrap text (#557)
An anchored object with text wrap pushes aside the text of other stories
whose frames it overlaps on its spread, and the lines of its own story
after the line holding its anchor (custom and above-line objects). Its own
story is composed again with the objects where the previous pass placed
them until they settle, at most four more times. The composition cache
keys a story wrapped by other stories' anchored objects on their
signatures, and canvas damage repaints the stories they wrap.
2026-10-12 05:51:56 +00:00
aiongg 62520485e8 Integration: format 2026-10-12 05:48:15 +00:00
aiongg 3e7cca3a0d Integration: text wrap Same As Clipping follows the graphic's clipping path (#450 × #384)
#384's contour wrap followed the frame's path for Same As Clipping, which was all a graphic could clip to; #450 gives graphics clipping paths. contour_path takes the clip region (Graphic::clip_region) when the graphic has one. Test: a triangle clip widening downwards, Same As Clipping, left side: lines beside the narrow top run further in than those at the base.
2026-10-12 05:40:04 +00:00
aiongg 43a4e70658 Merge section-marker: Sections: the section marker shows the section's marker text (#556)
Conflict: ROADMAP.md: both progress lines (next's, then #556's)
Conflict: crates/compose/src/shape.rs: #556's empty-marker zero-width glyph; next's digit mapping, styles.at(i)/styles and sub.upright() in both arms
2026-10-12 05:34:13 +00:00
aiongg 406f1b3d26 Sections: the section marker shows the section's marker text (#556) 2026-10-12 05:09:40 +00:00
seanth a21e8db14f fix(compose): key parent-page compositions by absolute page index
Parent-page text now uses the absolute page index as its cache key, so repeated page numbers and renumbering do not reuse another page's composition.

Validation: targeted canvas and PDF regressions, plus all six cargo xtask ci gates on main after #514 (1,179 native tests passed, 3 ignored; 15 crates passed WASM compilation checks).

Task: #523
2026-10-11 21:27:52 -06:00
moppeeerandskylartaylor 95c8c9cc5b fix(hyphenation): honor capitalized-word settings for uppercase words
Honor the capitalized-word hyphenation setting for uppercase words and retain the current roadmap entries.

Validation: all six cargo xtask ci gates passed on the current main merge candidate; 1,170 native tests passed and all 15 WASM packages checked.

Task: #538

Co-authored-by: skylartaylor <26588250+skylartaylor@users.noreply.github.com>
2026-10-11 19:32:49 -06:00
aiongg d50f1b36d9 Merge #538: Words in capitals hyphenate like capitalized words
Conflict: ROADMAP.md: both progress-log lines
2026-10-12 00:17:58 +00:00
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
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
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
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 43019733a8 Merge #512: Hyphenation: Portuguese text is hyphenated with hyph-utf8's Portuguese patterns 2026-10-11 18:01:34 +00:00
Sean HammondandClaude Opus 5.5 f23fa33e16 Parent-page items are composed for their page by index, not page name
A running header (or any text variable) in a parent-page frame was empty or
wrong on pages whose page number repeats an earlier one: with two sections
that both number from 1 (front matter 1-10, body 1-...), body pages 1-10
showed nothing. The renderer and PDF export passed only the page's name to
the composition cache, which looked the page up as the first page with
that name - in the front matter, before any heading.

CompositionCache::get now takes the absolute page index (None for a story's
own frames) and derives the name for page-number markers from it; the cache
is keyed by index, so two pages with the same name no longer share a
composed header. The renderer and PDF export pass first_page_of_spread + i.

Test: running_header_on_parent_page_with_repeated_page_numbers (pages named
1, 2, 1, 2; the only heading on the third page). Before the fix the third
page's header was empty (0 glyphs); with it, "Epsilon" (7).

Found with an InDesign IDML (a dictionary with two sections and Match
Character Style running headers on its parent page), together with #301.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CgGsJkVe5GYG9qK6VFdECa
2026-10-11 16:56:41 +00:00
japbcoelhoandClaude Opus 5.5 db55cb7e49 Hyphenation: Portuguese text is hyphenated with hyph-utf8's Portuguese patterns
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 13:52:46 -03:00
aiongg b6cc59d349 Merge wrap-boundary: IDML: import and wrap around custom text-wrap boundaries
Conflict: crates/compose/src/lib.rs: the custom boundary goes into next's shared wrap_exclusion(); free_slots keeps next's JumpObject handling outside it and takes the branch's combined BoundingBox/Contour arm
Conflict: crates/engine/src/cmd/object.rs: params doc has next's content flag and the branch's custom-boundary note
Conflict: crates/engine/src/tests.rs: both tests
Conflict: crates/idml/src/export.rs: the boundary goes into next's text_wrap_pref()
Conflict: crates/idml/src/import.rs: next's object-style-aware text_wrap() plus the branch's boundary parsing for the item's own wrap; pdf_page_in and wrap_path_of both kept
Conflict: crates/idml/src/tests.rs: both sides' tests
2026-10-11 13:08:12 +00:00
aiongg 8f5b3313a9 Merge feat/layout-parity update: Layout: a baseline shift doesn't move the Em Box Height first baseline 2026-10-11 13:03:09 +00:00
aiongg 47d17ca6f5 IDML: import and wrap around custom text-wrap boundaries 2026-10-11 12:53:50 +00:00
aiongg 0de31ef27b Layout: a baseline shift doesn't move the Em Box Height first baseline
The line's em box top is measured at the unshifted baseline; the shift
moves only the drawn glyphs. CJK character alignment still counts. The
Ascent, Cap Height and x Height offsets keep counting a raised baseline.
2026-10-11 12:33:55 +00:00
aiongg d5a6eca36d Merge #427 update: Text: Optical kerning spaces pairs from their outlines
Conflict: Cargo.lock: next's (the PR's dependency is already on next)
Conflict: ROADMAP.md: next's (the PR's earlier head is already merged)
Conflict: docs/gaps.md: next's (the PR's earlier head is already merged)
Conflict: docs/typography-parity.md: next's, test count 170 -> 172 as in d0120bf6
Conflict: crates/compose/src/optical.rs: next's plus d0120bf6's kernable() dash and fullwidth exclusion and its unit test
Conflict: crates/compose/src/tests.rs: next's plus d0120bf6's optical_kerning_leaves_dash_pairs_alone
2026-10-11 12:19:35 +00:00
Abdelrehman Fouad d0120bf6a6 Text: Optical kerning leaves dashes and fullwidth forms alone
Two dashes end to end have no ink gap to measure, so -- and the double
em dash opened up by the loosen cap; Chinese sets —— as one continuous
rule. Fullwidth Latin (U+FF21–FF5A) was kernable through its Latin
script and moved CJK text off its em grid. Both are now excluded from
kernable(), with a unit test and a compose test that failed before.
2026-10-11 11:45:29 +02:00
MarekSpodBiedry 30cbd67e3d Honor IDML SameParaStyleSpacing between same-style paragraphs (#449) 2026-10-11 11:43:38 +02:00
Abdelrehman Fouad d02a220b4e Text: Optical kerning spaces pairs from their outlines
Optical kerning was treated exactly like Metrics: the font's kern pairs
and nothing else, so text set with Optical in InDesign came out wider,
rewrapped and went overset in tightly fitted frames.

Now the font's pairs are turned off for Optical text and each pair is
spaced from its outlines (crates/compose/src/optical.rs): every glyph's
ink is sampled into 28 bands across the em, the pair's mean and smallest
ink gap over the bands both glyphs ink are compared with the font's
stem-to-stem gap (the pair nn, or HH then oo), and the pair moves 60% of
the way towards it, keeping 30% of that gap and moving at most -0.12 or
+0.06 em. Latin, Greek and Cyrillic letters, digits and Western
punctuation take part; spaces, marks, missing glyphs, right-to-left
runs, upright and tate-chu-yoko glyphs and pairs across a fallback font
keep their font spacing. Profiles and references are cached, bounded.

Tests: AV, To and r. close up and nn stays; HH closes up under Optical
but not Metrics (fails on main); every change on a pangram stays within
the bounds and spaces keep their width; profile, gap, adjustment and
character-class unit tests.

Docs: typography parity Kerning row and remaining effort, gap 4,
ROADMAP milestone 6 and progress log.

Fixes #181.
2026-10-11 11:39:20 +02:00