Skip to content

DesignCraft: An open-source page and layout design editor written by scratch in pure Rust

Merge pr/647: Text: edit type on a path along the curve (#647)

aiongg6797589402c6
diff --cc ROADMAP.md
index 80bfdc044,35bc92d16..bd88f446e
--- a/ROADMAP.md
+++ b/ROADMAP.md
@@@ -128,9 -129,8 +128,10 @@@ list) · [roadmap.md](docs/roadmap.md)
Newest first.
+ - **2026-10-12** · Editing type on a path: the Type tool clicks, drags and double-clicks along the curve (the character under the pointer, not one on the straightened line), a click on the letters themselves hits the frame, and the caret and highlight bend with the path. No readiness percentage change.
- **2026-10-12** · Type on a path has start and end brackets, as in InDesign: selected path type shows them across the path, and dragging either with the Selection or Direct Selection tool moves where the text starts or ends (text past the end bracket is overset). `type.pathOptions {end}`; IDML reads and writes EndBracket. No readiness percentage change.
+- **2026-10-12** · The Pen tool continues an open path from either end point, as in InDesign: the cursor shows it over an end point, a click there carries on drawing that path, a drag first reshapes the end point's direction lines, and the other end closes it. Object › Paths › Reverse Path (`path.reverse`); `path.setAnchor`; `path.appendAnchor` and `path.close` take a subpath. No readiness percentage change.
+- **2026-10-12** · The Eyedropper puts a colour sampled from an image on the stroke when the toolbox's Stroke box is in front, as in InDesign (a line takes it on its stroke). No readiness percentage change.
- **2026-10-12** · Window close and application/menu Quit ask about unsaved documents; later Cancel keeps every tab open, including earlier Don't Save choices. Approvals are rechecked after edits. Cancelable macOS Dock Quit remains open (#544). No readiness percentage change.
- **2026-10-12** · Each running app keeps recovery data in its own locked folder; current folder and lock ownership are checked before writes and cleanup. Failed isolation disables recovery with a warning instead of sharing document IDs. No readiness percentage change.
- **2026-10-12** · Native engine saves and exports replace files atomically; failed writes retain the original, private staging preserves Unix permissions, and valid long filenames work. Desktop Services and CLI raster exports remain separate follow-ups. No readiness percentage change.
diff --cc crates/engine/src/cmd/text.rs
index 6e07f0f38,a1a17ccc8..7c87550f4
--- a/crates/engine/src/cmd/text.rs
+++ b/crates/engine/src/cmd/text.rs
@@@ -362,13 -279,15 +362,15 @@@ fn hit_byte_with
let inner = xf.inverse() * pt;
let cs = s.cache.get(&st.doc, sid, None);
let fi = cs.frames.iter().position(|f| f.frame == frame)?;
+ // Type on a path: the click lands on the line where it is along the path.
+ let inner = cs.frames.get(fi).and_then(|ft| compose::PathTextMap::new(it, ft)).map_or(inner, |m| m.to_line(inner));
- if let Some((table, row, col, b)) = compose::hit_cell(&cs, fi, inner) {
+ if let Some((table, row, col, b)) = compose::hit_cell_with(&cs, fi, inner, hit) {
return Some((sid, b, Some(CellAddr { table, row, col })));
}
- if let Some((id, b)) = compose::hit_note(&cs, fi, inner) {
+ if let Some((id, b)) = compose::hit_note_with(&cs, fi, inner, hit) {
return Some((sid, b, Some(CellAddr::footnote(id))));
}
- let b = compose::hit(&cs, fi, inner).unwrap_or(0);
+ let b = hit(&cs, fi, inner).unwrap_or(0);
Some((sid, b, None))
}