Read IDML ink settings through shared model

This commit is contained in:
Dylan M. Taylor committed 2026-11-13 04:43:35 -05:00
1 parent 1055cac8ba
commit 987dc174ba
3 files changed
+17 -17

No files matched your search

Generated
+9 -9
View File
@@ -1225,10 +1225,10 @@ dependencies = [
[[package]]
name = "craft-idml"
version = "0.1.0"
source = "git+https://github.com/dylanmtaylor/craft-libs?rev=46bb2753a5fdd68bba3fc8535bc0abdcaec8b934#46bb2753a5fdd68bba3fc8535bc0abdcaec8b934"
source = "git+https://github.com/dylanmtaylor/craft-libs?rev=4f4f8f8bc6b4cc850279f927808252d32f7c866e#4f4f8f8bc6b4cc850279f927808252d32f7c866e"
dependencies = [
"craft-xml 0.1.0 (git+https://github.com/dylanmtaylor/craft-libs?rev=46bb2753a5fdd68bba3fc8535bc0abdcaec8b934)",
"craft-zip 0.1.0 (git+https://github.com/dylanmtaylor/craft-libs?rev=46bb2753a5fdd68bba3fc8535bc0abdcaec8b934)",
"craft-xml 0.1.0 (git+https://github.com/dylanmtaylor/craft-libs?rev=4f4f8f8bc6b4cc850279f927808252d32f7c866e)",
"craft-zip 0.1.0 (git+https://github.com/dylanmtaylor/craft-libs?rev=4f4f8f8bc6b4cc850279f927808252d32f7c866e)",
"thiserror 2.0.21",
]
@@ -1587,7 +1587,7 @@ dependencies = [
[[package]]
name = "craft-xml"
version = "0.1.0"
source = "git+https://github.com/dylanmtaylor/craft-libs?rev=46bb2753a5fdd68bba3fc8535bc0abdcaec8b934#46bb2753a5fdd68bba3fc8535bc0abdcaec8b934"
source = "git+https://github.com/dylanmtaylor/craft-libs?rev=4f4f8f8bc6b4cc850279f927808252d32f7c866e#4f4f8f8bc6b4cc850279f927808252d32f7c866e"
dependencies = [
"quick-xml 0.41.0",
"thiserror 2.0.21",
@@ -1633,7 +1633,7 @@ dependencies = [
[[package]]
name = "craft-zip"
version = "0.1.0"
source = "git+https://github.com/dylanmtaylor/craft-libs?rev=46bb2753a5fdd68bba3fc8535bc0abdcaec8b934#46bb2753a5fdd68bba3fc8535bc0abdcaec8b934"
source = "git+https://github.com/dylanmtaylor/craft-libs?rev=4f4f8f8bc6b4cc850279f927808252d32f7c866e#4f4f8f8bc6b4cc850279f927808252d32f7c866e"
dependencies = [
"flate2",
"thiserror 2.0.21",
@@ -1914,7 +1914,7 @@ dependencies = [
"craft-prepress",
"craft-print",
"craft-svg 0.1.0 (git+https://github.com/dylanmtaylor/craft-libs?rev=2e670cf9377b523112f3fe4b409399772c745895)",
"craft-xml 0.1.0 (git+https://github.com/dylanmtaylor/craft-libs?rev=46bb2753a5fdd68bba3fc8535bc0abdcaec8b934)",
"craft-xml 0.1.0 (git+https://github.com/dylanmtaylor/craft-libs?rev=4f4f8f8bc6b4cc850279f927808252d32f7c866e)",
"craft-xml 0.1.0 (git+https://github.com/dylanmtaylor/craft-libs?rev=f23b0f33f0d00b157476533a43cbbcfd901aa1f1)",
"designcraft-color",
"designcraft-compose",
@@ -1998,8 +1998,8 @@ dependencies = [
name = "designcraft-idml"
version = "0.20.1"
dependencies = [
"craft-idml 0.1.0 (git+https://github.com/dylanmtaylor/craft-libs?rev=46bb2753a5fdd68bba3fc8535bc0abdcaec8b934)",
"craft-xml 0.1.0 (git+https://github.com/dylanmtaylor/craft-libs?rev=46bb2753a5fdd68bba3fc8535bc0abdcaec8b934)",
"craft-idml 0.1.0 (git+https://github.com/dylanmtaylor/craft-libs?rev=4f4f8f8bc6b4cc850279f927808252d32f7c866e)",
"craft-xml 0.1.0 (git+https://github.com/dylanmtaylor/craft-libs?rev=4f4f8f8bc6b4cc850279f927808252d32f7c866e)",
"designcraft-color",
"designcraft-compose",
"designcraft-doc",
@@ -2116,7 +2116,7 @@ version = "0.20.1"
dependencies = [
"craft-docx",
"craft-file-formats",
"craft-idml 0.1.0 (git+https://github.com/dylanmtaylor/craft-libs?rev=46bb2753a5fdd68bba3fc8535bc0abdcaec8b934)",
"craft-idml 0.1.0 (git+https://github.com/dylanmtaylor/craft-libs?rev=4f4f8f8bc6b4cc850279f927808252d32f7c866e)",
"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-document-bundle = { git = "https://github.com/storytold/craft-libs", rev = "ba24fe2435adb3c81ad6057faf36365fbba736cf", 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/dylanmtaylor/craft-libs", rev = "46bb2753a5fdd68bba3fc8535bc0abdcaec8b934", version = "=0.1.0" }
craft-idml = { git = "https://github.com/dylanmtaylor/craft-libs", rev = "4f4f8f8bc6b4cc850279f927808252d32f7c866e", 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/dylanmtaylor/craft-libs", rev = "2e670cf9377b523112f3fe4b409399772c745895", version = "=0.1.0", features = ["tree-render", "tree-text"] }
craft-xml = { git = "https://github.com/dylanmtaylor/craft-libs", rev = "46bb2753a5fdd68bba3fc8535bc0abdcaec8b934", version = "=0.1.0" }
craft-xml = { git = "https://github.com/dylanmtaylor/craft-libs", rev = "4f4f8f8bc6b4cc850279f927808252d32f7c866e", version = "=0.1.0" }
craft-xml-dtd = { package = "craft-xml", git = "https://github.com/dylanmtaylor/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" }
+6 -6
View File
@@ -48,17 +48,17 @@ impl<'r> Importer<'r> {
/// Ink Manager settings: inks converted to process and ink aliases.
fn read_inks(&mut self, top: &[El]) {
for e in top.iter().filter(|e| e.local() == "Ink") {
let Some(name) = e
.get("Name")
.filter(|n| !n.starts_with("$ID/") && !["Process Cyan", "Process Magenta", "Process Yellow", "Process Black"].contains(n))
let model_top: Vec<_> = top.iter().map(crate::xml::to_craft).collect();
for e in craft_idml::model::inks(&model_top) {
let Some(name) =
e.name().filter(|n| !n.starts_with("$ID/") && !["Process Cyan", "Process Magenta", "Process Yellow", "Process Black"].contains(n))
else {
continue;
};
if e.get("ConvertToProcess") == Some("true") {
if e.convert_to_process() {
self.inks.to_process.push(name.to_string());
}
if let Some(a) = e.get("AliasInkName").filter(|a| !a.is_empty() && *a != name && !a.starts_with("$ID/")) {
if let Some(a) = e.alias().filter(|a| !a.is_empty() && *a != name && !a.starts_with("$ID/")) {
self.inks.aliases.push((name.to_string(), a.to_string()));
}
}