From 703ffed77971c4052dbcf498e92a2b401f8f25b7 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Fri, 13 Nov 2026 09:37:36 -0500 Subject: [PATCH] Use shared IDML text path writer --- Cargo.lock | 52 +++++++++++++++++----------------- Cargo.toml | 4 +-- crates/idml/src/export/item.rs | 21 ++++++-------- 3 files changed, 36 insertions(+), 41 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index aacb7a702..23a7b52e4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1242,10 +1242,10 @@ dependencies = [ [[package]] name = "craft-idml" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=33e1fffca#33e1fffcace339b5a046a3b6822d7c1a0f545b4c" +source = "git+https://github.com/storytold/craft-libs?rev=9ba88911e#9ba88911e41b58df324f750a2962bd6ddd284e36" dependencies = [ - "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33e1fffca)", - "craft-zip 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33e1fffca)", + "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=9ba88911e)", + "craft-zip 0.1.0 (git+https://github.com/storytold/craft-libs?rev=9ba88911e)", "thiserror 2.0.21", ] @@ -1644,15 +1644,6 @@ dependencies = [ "thiserror 2.0.21", ] -[[package]] -name = "craft-xml" -version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=33e1fffca#33e1fffcace339b5a046a3b6822d7c1a0f545b4c" -dependencies = [ - "quick-xml 0.41.0", - "thiserror 2.0.21", -] - [[package]] name = "craft-xml" version = "0.1.0" @@ -1671,6 +1662,15 @@ dependencies = [ "thiserror 2.0.21", ] +[[package]] +name = "craft-xml" +version = "0.1.0" +source = "git+https://github.com/storytold/craft-libs?rev=9ba88911e#9ba88911e41b58df324f750a2962bd6ddd284e36" +dependencies = [ + "quick-xml 0.41.0", + "thiserror 2.0.21", +] + [[package]] name = "craft-xml" version = "0.1.0" @@ -1717,16 +1717,6 @@ dependencies = [ "thiserror 2.0.21", ] -[[package]] -name = "craft-zip" -version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=33e1fffca#33e1fffcace339b5a046a3b6822d7c1a0f545b4c" -dependencies = [ - "flate2", - "thiserror 2.0.21", - "zip 9.1.1", -] - [[package]] name = "craft-zip" version = "0.1.0" @@ -1747,6 +1737,16 @@ dependencies = [ "zip 9.1.1", ] +[[package]] +name = "craft-zip" +version = "0.1.0" +source = "git+https://github.com/storytold/craft-libs?rev=9ba88911e#9ba88911e41b58df324f750a2962bd6ddd284e36" +dependencies = [ + "flate2", + "thiserror 2.0.21", + "zip 9.1.1", +] + [[package]] name = "craft-zip" version = "0.1.0" @@ -2021,7 +2021,7 @@ dependencies = [ "craft-prepress", "craft-print", "craft-svg 0.1.0 (git+https://github.com/storytold/craft-libs?rev=cc23ffd4d26f3074808e2187d332564817624f8f)", - "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33e1fffca)", + "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=9ba88911e)", "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=f23b0f33f0d00b157476533a43cbbcfd901aa1f1)", "designcraft-color", "designcraft-compose", @@ -2103,9 +2103,9 @@ name = "designcraft-idml" version = "0.20.1" dependencies = [ "craft-file-formats", - "craft-idml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33e1fffca)", + "craft-idml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=9ba88911e)", "craft-svg 0.1.0 (git+https://github.com/storytold/craft-libs?rev=cc23ffd4d26f3074808e2187d332564817624f8f)", - "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33e1fffca)", + "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=9ba88911e)", "designcraft-color", "designcraft-compose", "designcraft-doc", @@ -2222,7 +2222,7 @@ version = "0.20.1" dependencies = [ "craft-docx", "craft-file-formats", - "craft-idml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=33e1fffca)", + "craft-idml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=9ba88911e)", "craft-rtf", "craft-wordmodel", "craft-xlsx", diff --git a/Cargo.toml b/Cargo.toml index d24749e18..207a94159 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,10 +16,10 @@ craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "4052591363 craft-designcraft-format = { git = "https://github.com/storytold/craft-libs", rev = "93d0998383aa150fa50a2ffbf49ef37786e37eca", version = "=0.1.0" } craft-eps = { git = "https://github.com/storytold/craft-libs", rev = "ba24fe2435adb3c81ad6057faf36365fbba736cf", version = "=0.1.0" } craft-epub = { git = "https://github.com/storytold/craft-libs", rev = "ba24fe2435adb3c81ad6057faf36365fbba736cf", version = "=0.1.0" } -craft-idml = { git = "https://github.com/storytold/craft-libs", rev = "33e1fffca", version = "=0.1.0" } +craft-idml = { git = "https://github.com/storytold/craft-libs", rev = "9ba88911e", version = "=0.1.0" } craft-indd = { git = "https://github.com/storytold/craft-libs", rev = "47bf5650b0d503b97bfb5e841746c4957897d11f", version = "=0.1.0" } craft-svg = { git = "https://github.com/storytold/craft-libs", rev = "cc23ffd4d26f3074808e2187d332564817624f8f", version = "=0.1.0", features = ["tree-render", "tree-text"] } -craft-xml = { git = "https://github.com/storytold/craft-libs", rev = "33e1fffca", version = "=0.1.0" } +craft-xml = { git = "https://github.com/storytold/craft-libs", rev = "9ba88911e", version = "=0.1.0" } craft-xml-dtd = { package = "craft-xml", git = "https://github.com/storytold/craft-libs", rev = "f23b0f33f0d00b157476533a43cbbcfd901aa1f1", version = "=0.1.0" } craft-rtf = { git = "https://github.com/storytold/craft-libs", rev = "ba24fe2435adb3c81ad6057faf36365fbba736cf", version = "=0.1.0" } craft-xlsx = { git = "https://github.com/storytold/craft-libs", rev = "ba24fe2435adb3c81ad6057faf36365fbba736cf", version = "=0.1.0" } diff --git a/crates/idml/src/export/item.rs b/crates/idml/src/export/item.rs index 35e789ae7..d2d975f7d 100644 --- a/crates/idml/src/export/item.rs +++ b/crates/idml/src/export/item.rs @@ -30,19 +30,14 @@ impl<'a> Ex<'a> { { // Type on a path: a TextPath child holds the story. let len = designcraft_geom::warp::PathWarp::new(&it.path.to_bezpath(), false).length(); - el.push( - El::new("TextPath") - .attr("Self", format!("{}tp", uid(it.id.0))) - .attr("ParentStory", uid(t.story.0)) - .attr("PreviousTextFrame", "n") - .attr("NextTextFrame", "n") - .attr("PathEffect", "RainbowPathEffect") - .attr("PathAlignment", "CenterPathAlignment") - .attr("TextAlignment", names::path_align_out(pt.align)) - .attr("FlipPathEffect", if pt.flip { "Flipped" } else { "NotFlipped" }) - .attr("StartBracket", num(pt.start)) - .attr("EndBracket", num(pt.end.map_or(len, |e| e.min(len)))), - ); + el.push(crate::xml::from_craft(craft_idml::model::TextPath::to_el( + &uid(it.id.0), + &uid(t.story.0), + names::path_align_out(pt.align), + pt.flip, + pt.start, + pt.end.map_or(len, |end| end.min(len)), + ))); } else if let Content::Text(t) = &it.content { let (prev, next) = self.threads.get(&it.id.0).copied().unwrap_or((None, None)); el.set("ParentStory", uid(t.story.0));