Use shared IDML text path writer

This commit is contained in:
Dylan M. Taylor committed 2026-11-13 09:37:36 -05:00
1 parent dab41a4f60
commit 703ffed779
3 files changed
+36 -41

No files matched your search

Generated
+26 -26
View File
@@ -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",
+2 -2
View File
@@ -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" }
+8 -13
View File
@@ -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));