diff --git a/Cargo.lock b/Cargo.lock index 14385167a..3defc7f13 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=a891f5c1ee419e73a221ffef64e089bd59bc6bc5#a891f5c1ee419e73a221ffef64e089bd59bc6bc5" +source = "git+https://github.com/storytold/craft-libs?rev=49e4a1b4a127b168426db02eb62b6cd6436eea46#49e4a1b4a127b168426db02eb62b6cd6436eea46" dependencies = [ - "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=a891f5c1ee419e73a221ffef64e089bd59bc6bc5)", - "craft-zip 0.1.0 (git+https://github.com/storytold/craft-libs?rev=a891f5c1ee419e73a221ffef64e089bd59bc6bc5)", + "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=49e4a1b4a127b168426db02eb62b6cd6436eea46)", + "craft-zip 0.1.0 (git+https://github.com/storytold/craft-libs?rev=49e4a1b4a127b168426db02eb62b6cd6436eea46)", "thiserror 2.0.21", ] @@ -1656,7 +1656,7 @@ dependencies = [ [[package]] name = "craft-xml" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=8abfa9d0f14bafbfc3449fc552ffeafb9ca6a551#8abfa9d0f14bafbfc3449fc552ffeafb9ca6a551" +source = "git+https://github.com/storytold/craft-libs?rev=49e4a1b4a127b168426db02eb62b6cd6436eea46#49e4a1b4a127b168426db02eb62b6cd6436eea46" dependencies = [ "quick-xml 0.41.0", "thiserror 2.0.21", @@ -1665,7 +1665,7 @@ dependencies = [ [[package]] name = "craft-xml" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=a891f5c1ee419e73a221ffef64e089bd59bc6bc5#a891f5c1ee419e73a221ffef64e089bd59bc6bc5" +source = "git+https://github.com/storytold/craft-libs?rev=8abfa9d0f14bafbfc3449fc552ffeafb9ca6a551#8abfa9d0f14bafbfc3449fc552ffeafb9ca6a551" dependencies = [ "quick-xml 0.41.0", "thiserror 2.0.21", @@ -1730,7 +1730,7 @@ dependencies = [ [[package]] name = "craft-zip" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=8abfa9d0f14bafbfc3449fc552ffeafb9ca6a551#8abfa9d0f14bafbfc3449fc552ffeafb9ca6a551" +source = "git+https://github.com/storytold/craft-libs?rev=49e4a1b4a127b168426db02eb62b6cd6436eea46#49e4a1b4a127b168426db02eb62b6cd6436eea46" dependencies = [ "flate2", "thiserror 2.0.21", @@ -1740,7 +1740,7 @@ dependencies = [ [[package]] name = "craft-zip" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=a891f5c1ee419e73a221ffef64e089bd59bc6bc5#a891f5c1ee419e73a221ffef64e089bd59bc6bc5" +source = "git+https://github.com/storytold/craft-libs?rev=8abfa9d0f14bafbfc3449fc552ffeafb9ca6a551#8abfa9d0f14bafbfc3449fc552ffeafb9ca6a551" dependencies = [ "flate2", "thiserror 2.0.21", @@ -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=a891f5c1ee419e73a221ffef64e089bd59bc6bc5)", + "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=49e4a1b4a127b168426db02eb62b6cd6436eea46)", "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=a891f5c1ee419e73a221ffef64e089bd59bc6bc5)", + "craft-idml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=49e4a1b4a127b168426db02eb62b6cd6436eea46)", "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=a891f5c1ee419e73a221ffef64e089bd59bc6bc5)", + "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=49e4a1b4a127b168426db02eb62b6cd6436eea46)", "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=a891f5c1ee419e73a221ffef64e089bd59bc6bc5)", + "craft-idml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=49e4a1b4a127b168426db02eb62b6cd6436eea46)", "craft-rtf", "craft-wordmodel", "craft-xlsx", diff --git a/Cargo.toml b/Cargo.toml index 35924b581..d353ba4c8 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 = "19692b6190465671e41967c75d0cd4c439d0c84c", 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 = "a891f5c1ee419e73a221ffef64e089bd59bc6bc5", version = "=0.1.0" } +craft-idml = { git = "https://github.com/storytold/craft-libs", rev = "49e4a1b4a127b168426db02eb62b6cd6436eea46", 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 = "a891f5c1ee419e73a221ffef64e089bd59bc6bc5", version = "=0.1.0" } +craft-xml = { git = "https://github.com/storytold/craft-libs", rev = "49e4a1b4a127b168426db02eb62b6cd6436eea46", 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/import/text_attrs.rs b/crates/idml/src/import/text_attrs.rs index aecd7b9ee..0220da831 100644 --- a/crates/idml/src/import/text_attrs.rs +++ b/crates/idml/src/import/text_attrs.rs @@ -532,25 +532,8 @@ impl Importer<'_> { /// OpenType features (only when the element sets any). fn read_otf_features(e: &El, a: &mut CharAttrs) { - let mut otf_list: Vec = Vec::new(); - let mut any = false; - for (tag, _, attr) in designcraft_doc::otf::TOGGLES { - if let Some(on) = e.boolean(attr) { - designcraft_doc::otf::set(&mut otf_list, tag, on); - any = true; - } - } - if let Some(fig) = e.prop("OTFFigureStyle") - && let Some((id, ..)) = designcraft_doc::otf::FIGURES.iter().find(|f| f.3 == fig.trim()) - { - designcraft_doc::otf::set_figures(&mut otf_list, id); - any = true; - } - if let Some(m) = e.num("OTFStylisticSets") { - designcraft_doc::otf::set_stylistic_sets(&mut otf_list, m.max(0.0) as u32); - any = true; - } - if any { - a.otf_features = Some(otf_list); + let features = craft_idml::model::OpenTypeFeatureValues::from_el(&crate::xml::to_craft(e)); + if features.present { + a.otf_features = Some(features.features); } }