Formats: port the craft-libs cutover follow-ups from #2734 to main (#2838)

* Formats: port the craft-libs cutover follow-ups from #2734 to main (craft-libs#778)

Brings #2734's changes (made against the release branch) to main:
IDML CDATA on write and table span parsing, DOCX plain-text accepted
changes, XLSX invalid number cells shown as written, shared CMYK JPEG
polarity, exact PPTX opacity, PDF CMYK fallback wording, and the
craft-libs re-pins. Imported DOCX built-in headings keep main's and
v0.21.0's spelling ("Heading 1"), with a test. craft-pdf, craft-prepress,
craft-cms, the krilla/hayro patches and craft-xml-dtd move to the #1322
squash merge on craft-libs main (a5ac3aa0).

Co-authored-by: Dylan M. Taylor <dylan@dylanmtaylor.com>

* Point the PDF dependency check at the craft-libs main pin

Co-authored-by: Dylan M. Taylor <dylan@dylanmtaylor.com>

* Formats: address review on the cutover follow-ups

- PDF: keep main's CMYK fallback warning. The shared decoder reads planar
  CMYK TIFFs and makes associated alpha straight, so neither falls back;
  a test now checks both keep their inks.
- DOCX plain-text import uses craft-wordmodel's Paragraph::final_text,
  which already drops tracked deletions and expands inline objects.
- IDML: a test pins numeric table spans (fractions round down, spans past
  the table or past 32 bits reach its edge, anything under 1 or not a
  number spans one cell).
- Cargo.lock: craft-rtf takes craft-codepage at bfea7d98 after the merge
  with main.

* PDF test: expect the CMYK fallback warning's main wording

---------

Co-authored-by: Dylan M. Taylor <dylan@dylanmtaylor.com>
This commit is contained in:
FredAppsandDylan M. Taylor authored and GitHub committed 2026-11-15 22:45:42 +01:00
1 parent b3e6e31317
commit f405f89da4
15 files changed
+347 -164

No files matched your search

Generated
+167 -80
View File
@@ -1091,12 +1091,12 @@ dependencies = [
[[package]]
name = "craft-cfb"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ba24fe2435adb3c81ad6057faf36365fbba736cf#6d0b33c0cd63ae4250c180a04eb4a4d66ab81448"
source = "git+https://github.com/storytold/craft-libs?rev=7ad4765ee55496d0ccdb7659ad7a6375c7bbb484#7ad4765ee55496d0ccdb7659ad7a6375c7bbb484"
[[package]]
name = "craft-cms"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=40525913633942f84b06d4837a8d90534a55d63f#40525913633942f84b06d4837a8d90534a55d63f"
source = "git+https://github.com/storytold/craft-libs?rev=a5ac3aa05cf3ec013961a85599ddd9e0b5c03813#a5ac3aa05cf3ec013961a85599ddd9e0b5c03813"
dependencies = [
"md-5",
"rayon",
@@ -1105,7 +1105,7 @@ dependencies = [
[[package]]
name = "craft-codepage"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ba24fe2435adb3c81ad6057faf36365fbba736cf#6d0b33c0cd63ae4250c180a04eb4a4d66ab81448"
source = "git+https://github.com/storytold/craft-libs?rev=bfea7d9800a9f14e496209f9df30e9ef45655701#bfea7d9800a9f14e496209f9df30e9ef45655701"
[[package]]
name = "craft-codepage"
@@ -1164,16 +1164,16 @@ dependencies = [
[[package]]
name = "craft-docx"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ba24fe2435adb3c81ad6057faf36365fbba736cf#6d0b33c0cd63ae4250c180a04eb4a4d66ab81448"
source = "git+https://github.com/storytold/craft-libs?rev=7ad4765ee55496d0ccdb7659ad7a6375c7bbb484#7ad4765ee55496d0ccdb7659ad7a6375c7bbb484"
dependencies = [
"base64 0.23.1",
"chrono",
"craft-drawingml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=ba24fe2435adb3c81ad6057faf36365fbba736cf)",
"craft-drawingml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=7ad4765ee55496d0ccdb7659ad7a6375c7bbb484)",
"craft-math",
"craft-offcrypto",
"craft-opc 0.1.0 (git+https://github.com/storytold/craft-libs?rev=ba24fe2435adb3c81ad6057faf36365fbba736cf)",
"craft-opc 0.1.0 (git+https://github.com/storytold/craft-libs?rev=7ad4765ee55496d0ccdb7659ad7a6375c7bbb484)",
"craft-wordmodel",
"craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=ba24fe2435adb3c81ad6057faf36365fbba736cf)",
"craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=7ad4765ee55496d0ccdb7659ad7a6375c7bbb484)",
"log",
"quick-xml 0.41.0",
"thiserror 2.0.21",
@@ -1195,9 +1195,9 @@ dependencies = [
[[package]]
name = "craft-drawingml"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ba24fe2435adb3c81ad6057faf36365fbba736cf#6d0b33c0cd63ae4250c180a04eb4a4d66ab81448"
source = "git+https://github.com/storytold/craft-libs?rev=7ad4765ee55496d0ccdb7659ad7a6375c7bbb484#7ad4765ee55496d0ccdb7659ad7a6375c7bbb484"
dependencies = [
"craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=ba24fe2435adb3c81ad6057faf36365fbba736cf)",
"craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=7ad4765ee55496d0ccdb7659ad7a6375c7bbb484)",
"kurbo",
"log",
"serde",
@@ -1283,10 +1283,10 @@ dependencies = [
[[package]]
name = "craft-idml"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=1ad5f35bf#1ad5f35bf0b33f5846fd8aec782f0ba5a9e3b596"
source = "git+https://github.com/storytold/craft-libs?rev=899e396b9e2710fcdf1ad9b6249d6c456b7ca9a2#899e396b9e2710fcdf1ad9b6249d6c456b7ca9a2"
dependencies = [
"craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=1ad5f35bf)",
"craft-zip 0.1.0 (git+https://github.com/storytold/craft-libs?rev=1ad5f35bf)",
"craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=899e396b9e2710fcdf1ad9b6249d6c456b7ca9a2)",
"craft-zip 0.1.0 (git+https://github.com/storytold/craft-libs?rev=899e396b9e2710fcdf1ad9b6249d6c456b7ca9a2)",
"thiserror 2.0.21",
]
@@ -1303,9 +1303,10 @@ dependencies = [
[[package]]
name = "craft-image-codecs"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=cc23ffd4d26f3074808e2187d332564817624f8f#cc23ffd4d26f3074808e2187d332564817624f8f"
source = "git+https://github.com/storytold/craft-libs?rev=a5ac3aa05cf3ec013961a85599ddd9e0b5c03813#a5ac3aa05cf3ec013961a85599ddd9e0b5c03813"
dependencies = [
"craft-jpeg 0.1.0 (git+https://github.com/storytold/craft-libs?rev=cc23ffd4d26f3074808e2187d332564817624f8f)",
"craft-jpeg 0.1.0 (git+https://github.com/storytold/craft-libs?rev=a5ac3aa05cf3ec013961a85599ddd9e0b5c03813)",
"craft-metadata 0.1.0 (git+https://github.com/storytold/craft-libs?rev=a5ac3aa05cf3ec013961a85599ddd9e0b5c03813)",
"exr",
"flate2",
"half",
@@ -1325,10 +1326,32 @@ dependencies = [
[[package]]
name = "craft-image-codecs"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ea1c84290dadec636900b4d1bce107e59ca3f0d6#ea1c84290dadec636900b4d1bce107e59ca3f0d6"
source = "git+https://github.com/storytold/craft-libs?rev=bfea7d9800a9f14e496209f9df30e9ef45655701#bfea7d9800a9f14e496209f9df30e9ef45655701"
dependencies = [
"craft-jpeg 0.1.0 (git+https://github.com/storytold/craft-libs?rev=ea1c84290dadec636900b4d1bce107e59ca3f0d6)",
"craft-metadata",
"craft-jpeg 0.1.0 (git+https://github.com/storytold/craft-libs?rev=bfea7d9800a9f14e496209f9df30e9ef45655701)",
"craft-metadata 0.1.0 (git+https://github.com/storytold/craft-libs?rev=bfea7d9800a9f14e496209f9df30e9ef45655701)",
"exr",
"flate2",
"half",
"image",
"image-webp",
"jpeg-encoder",
"png",
"rayon",
"serde_json",
"thiserror 2.0.21",
"tiff",
"zune-core",
"zune-jpeg",
"zune-jpegxl",
]
[[package]]
name = "craft-image-codecs"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=cc23ffd4d26f3074808e2187d332564817624f8f#cc23ffd4d26f3074808e2187d332564817624f8f"
dependencies = [
"craft-jpeg 0.1.0 (git+https://github.com/storytold/craft-libs?rev=cc23ffd4d26f3074808e2187d332564817624f8f)",
"exr",
"flate2",
"half",
@@ -1378,7 +1401,7 @@ dependencies = [
[[package]]
name = "craft-jpeg"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=cc23ffd4d26f3074808e2187d332564817624f8f#cc23ffd4d26f3074808e2187d332564817624f8f"
source = "git+https://github.com/storytold/craft-libs?rev=a5ac3aa05cf3ec013961a85599ddd9e0b5c03813#a5ac3aa05cf3ec013961a85599ddd9e0b5c03813"
dependencies = [
"thiserror 2.0.21",
]
@@ -1386,7 +1409,15 @@ dependencies = [
[[package]]
name = "craft-jpeg"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ea1c84290dadec636900b4d1bce107e59ca3f0d6#ea1c84290dadec636900b4d1bce107e59ca3f0d6"
source = "git+https://github.com/storytold/craft-libs?rev=bfea7d9800a9f14e496209f9df30e9ef45655701#bfea7d9800a9f14e496209f9df30e9ef45655701"
dependencies = [
"thiserror 2.0.21",
]
[[package]]
name = "craft-jpeg"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=cc23ffd4d26f3074808e2187d332564817624f8f#cc23ffd4d26f3074808e2187d332564817624f8f"
dependencies = [
"thiserror 2.0.21",
]
@@ -1414,20 +1445,32 @@ dependencies = [
[[package]]
name = "craft-math"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ba24fe2435adb3c81ad6057faf36365fbba736cf#6d0b33c0cd63ae4250c180a04eb4a4d66ab81448"
source = "git+https://github.com/storytold/craft-libs?rev=7ad4765ee55496d0ccdb7659ad7a6375c7bbb484#7ad4765ee55496d0ccdb7659ad7a6375c7bbb484"
dependencies = [
"craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=ba24fe2435adb3c81ad6057faf36365fbba736cf)",
"craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=7ad4765ee55496d0ccdb7659ad7a6375c7bbb484)",
"serde",
]
[[package]]
name = "craft-metadata"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ea1c84290dadec636900b4d1bce107e59ca3f0d6#ea1c84290dadec636900b4d1bce107e59ca3f0d6"
source = "git+https://github.com/storytold/craft-libs?rev=a5ac3aa05cf3ec013961a85599ddd9e0b5c03813#a5ac3aa05cf3ec013961a85599ddd9e0b5c03813"
dependencies = [
"brotli-decompressor 6.3.1",
"chrono",
"craft-tiff",
"craft-tiff 0.1.0 (git+https://github.com/storytold/craft-libs?rev=a5ac3aa05cf3ec013961a85599ddd9e0b5c03813)",
"quick-xml 0.41.0",
"serde",
]
[[package]]
name = "craft-metadata"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=bfea7d9800a9f14e496209f9df30e9ef45655701#bfea7d9800a9f14e496209f9df30e9ef45655701"
dependencies = [
"brotli-decompressor 6.3.1",
"chrono",
"craft-tiff 0.1.0 (git+https://github.com/storytold/craft-libs?rev=bfea7d9800a9f14e496209f9df30e9ef45655701)",
"quick-xml 0.41.0",
"serde",
]
@@ -1445,12 +1488,12 @@ dependencies = [
[[package]]
name = "craft-offcrypto"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ba24fe2435adb3c81ad6057faf36365fbba736cf#6d0b33c0cd63ae4250c180a04eb4a4d66ab81448"
source = "git+https://github.com/storytold/craft-libs?rev=7ad4765ee55496d0ccdb7659ad7a6375c7bbb484#7ad4765ee55496d0ccdb7659ad7a6375c7bbb484"
dependencies = [
"aes",
"base64 0.23.1",
"craft-cfb",
"craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=ba24fe2435adb3c81ad6057faf36365fbba736cf)",
"craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=7ad4765ee55496d0ccdb7659ad7a6375c7bbb484)",
"getrandom 0.3.4",
"hmac",
"sha1 0.11.0",
@@ -1473,10 +1516,10 @@ dependencies = [
[[package]]
name = "craft-opc"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=8abfa9d0f14bafbfc3449fc552ffeafb9ca6a551#8abfa9d0f14bafbfc3449fc552ffeafb9ca6a551"
source = "git+https://github.com/storytold/craft-libs?rev=7ad4765ee55496d0ccdb7659ad7a6375c7bbb484#7ad4765ee55496d0ccdb7659ad7a6375c7bbb484"
dependencies = [
"craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=8abfa9d0f14bafbfc3449fc552ffeafb9ca6a551)",
"craft-zip 0.1.0 (git+https://github.com/storytold/craft-libs?rev=8abfa9d0f14bafbfc3449fc552ffeafb9ca6a551)",
"craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=7ad4765ee55496d0ccdb7659ad7a6375c7bbb484)",
"craft-zip 0.1.0 (git+https://github.com/storytold/craft-libs?rev=7ad4765ee55496d0ccdb7659ad7a6375c7bbb484)",
"log",
"thiserror 2.0.21",
]
@@ -1484,10 +1527,10 @@ dependencies = [
[[package]]
name = "craft-opc"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ba24fe2435adb3c81ad6057faf36365fbba736cf#6d0b33c0cd63ae4250c180a04eb4a4d66ab81448"
source = "git+https://github.com/storytold/craft-libs?rev=8abfa9d0f14bafbfc3449fc552ffeafb9ca6a551#8abfa9d0f14bafbfc3449fc552ffeafb9ca6a551"
dependencies = [
"craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=ba24fe2435adb3c81ad6057faf36365fbba736cf)",
"craft-zip 0.1.0 (git+https://github.com/storytold/craft-libs?rev=ba24fe2435adb3c81ad6057faf36365fbba736cf)",
"craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=8abfa9d0f14bafbfc3449fc552ffeafb9ca6a551)",
"craft-zip 0.1.0 (git+https://github.com/storytold/craft-libs?rev=8abfa9d0f14bafbfc3449fc552ffeafb9ca6a551)",
"log",
"thiserror 2.0.21",
]
@@ -1506,10 +1549,10 @@ dependencies = [
[[package]]
name = "craft-pdf"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=40525913633942f84b06d4837a8d90534a55d63f#40525913633942f84b06d4837a8d90534a55d63f"
source = "git+https://github.com/storytold/craft-libs?rev=a5ac3aa05cf3ec013961a85599ddd9e0b5c03813#a5ac3aa05cf3ec013961a85599ddd9e0b5c03813"
dependencies = [
"bytemuck",
"craft-svg 0.1.0 (git+https://github.com/storytold/craft-libs?rev=40525913633942f84b06d4837a8d90534a55d63f)",
"craft-svg 0.1.0 (git+https://github.com/storytold/craft-libs?rev=a5ac3aa05cf3ec013961a85599ddd9e0b5c03813)",
"hayro",
"hayro-interpret",
"hayro-syntax",
@@ -1537,7 +1580,7 @@ dependencies = [
[[package]]
name = "craft-prepress"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=40525913633942f84b06d4837a8d90534a55d63f#40525913633942f84b06d4837a8d90534a55d63f"
source = "git+https://github.com/storytold/craft-libs?rev=a5ac3aa05cf3ec013961a85599ddd9e0b5c03813#a5ac3aa05cf3ec013961a85599ddd9e0b5c03813"
dependencies = [
"craft-cms",
"craft-pdf",
@@ -1563,7 +1606,7 @@ dependencies = [
[[package]]
name = "craft-psd"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ea1c84290dadec636900b4d1bce107e59ca3f0d6#ea1c84290dadec636900b4d1bce107e59ca3f0d6"
source = "git+https://github.com/storytold/craft-libs?rev=d15bf1f35b17b759870f9e5111b9a5d243f64888#d15bf1f35b17b759870f9e5111b9a5d243f64888"
dependencies = [
"encoding_rs",
"flate2",
@@ -1574,9 +1617,9 @@ dependencies = [
[[package]]
name = "craft-rtf"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ba24fe2435adb3c81ad6057faf36365fbba736cf#6d0b33c0cd63ae4250c180a04eb4a4d66ab81448"
source = "git+https://github.com/storytold/craft-libs?rev=bfea7d9800a9f14e496209f9df30e9ef45655701#bfea7d9800a9f14e496209f9df30e9ef45655701"
dependencies = [
"craft-codepage 0.1.0 (git+https://github.com/storytold/craft-libs?rev=ba24fe2435adb3c81ad6057faf36365fbba736cf)",
"craft-codepage 0.1.0 (git+https://github.com/storytold/craft-libs?rev=bfea7d9800a9f14e496209f9df30e9ef45655701)",
"encoding_rs",
]
@@ -1588,14 +1631,17 @@ source = "git+https://github.com/storytold/craft-libs?rev=2b9a325f57624804ed423a
[[package]]
name = "craft-svg"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=40525913633942f84b06d4837a8d90534a55d63f#40525913633942f84b06d4837a8d90534a55d63f"
source = "git+https://github.com/storytold/craft-libs?rev=a5ac3aa05cf3ec013961a85599ddd9e0b5c03813#a5ac3aa05cf3ec013961a85599ddd9e0b5c03813"
dependencies = [
"craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=40525913633942f84b06d4837a8d90534a55d63f)",
"craft-image-codecs 0.1.0 (git+https://github.com/storytold/craft-libs?rev=a5ac3aa05cf3ec013961a85599ddd9e0b5c03813)",
"craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=a5ac3aa05cf3ec013961a85599ddd9e0b5c03813)",
"flate2",
"kurbo",
"roxmltree 0.21.2",
"thiserror 2.0.21",
"usvg 0.48.1",
"vectorcraft-geom",
"vectorcraft-pathops",
]
[[package]]
@@ -1629,7 +1675,16 @@ dependencies = [
[[package]]
name = "craft-tiff"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ea1c84290dadec636900b4d1bce107e59ca3f0d6#ea1c84290dadec636900b4d1bce107e59ca3f0d6"
source = "git+https://github.com/storytold/craft-libs?rev=a5ac3aa05cf3ec013961a85599ddd9e0b5c03813#a5ac3aa05cf3ec013961a85599ddd9e0b5c03813"
dependencies = [
"serde",
"thiserror 2.0.21",
]
[[package]]
name = "craft-tiff"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=bfea7d9800a9f14e496209f9df30e9ef45655701#bfea7d9800a9f14e496209f9df30e9ef45655701"
dependencies = [
"serde",
"thiserror 2.0.21",
@@ -1705,7 +1760,7 @@ dependencies = [
[[package]]
name = "craft-wordmodel"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=ba24fe2435adb3c81ad6057faf36365fbba736cf#6d0b33c0cd63ae4250c180a04eb4a4d66ab81448"
source = "git+https://github.com/storytold/craft-libs?rev=7ad4765ee55496d0ccdb7659ad7a6375c7bbb484#7ad4765ee55496d0ccdb7659ad7a6375c7bbb484"
dependencies = [
"base64 0.23.1",
"craft-math",
@@ -1728,15 +1783,6 @@ dependencies = [
"thiserror 2.0.21",
]
[[package]]
name = "craft-xml"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=1ad5f35bf#1ad5f35bf0b33f5846fd8aec782f0ba5a9e3b596"
dependencies = [
"quick-xml 0.41.0",
"thiserror 2.0.21",
]
[[package]]
name = "craft-xml"
version = "0.1.0"
@@ -1749,7 +1795,17 @@ dependencies = [
[[package]]
name = "craft-xml"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=40525913633942f84b06d4837a8d90534a55d63f#40525913633942f84b06d4837a8d90534a55d63f"
source = "git+https://github.com/storytold/craft-libs?rev=7ad4765ee55496d0ccdb7659ad7a6375c7bbb484#7ad4765ee55496d0ccdb7659ad7a6375c7bbb484"
dependencies = [
"quick-xml 0.41.0",
"serde",
"thiserror 2.0.21",
]
[[package]]
name = "craft-xml"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=899e396b9e2710fcdf1ad9b6249d6c456b7ca9a2#899e396b9e2710fcdf1ad9b6249d6c456b7ca9a2"
dependencies = [
"quick-xml 0.41.0",
"thiserror 2.0.21",
@@ -1764,6 +1820,16 @@ dependencies = [
"thiserror 2.0.21",
]
[[package]]
name = "craft-xml"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=a5ac3aa05cf3ec013961a85599ddd9e0b5c03813#a5ac3aa05cf3ec013961a85599ddd9e0b5c03813"
dependencies = [
"quick-xml 0.41.0",
"serde",
"thiserror 2.0.21",
]
[[package]]
name = "craft-xml"
version = "0.1.0"
@@ -1791,16 +1857,6 @@ dependencies = [
"thiserror 2.0.21",
]
[[package]]
name = "craft-xml"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=f23b0f33f0d00b157476533a43cbbcfd901aa1f1#f23b0f33f0d00b157476533a43cbbcfd901aa1f1"
dependencies = [
"quick-xml 0.41.0",
"serde",
"thiserror 2.0.21",
]
[[package]]
name = "craft-xml"
version = "0.1.0"
@@ -1813,7 +1869,7 @@ dependencies = [
[[package]]
name = "craft-zip"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=1ad5f35bf#1ad5f35bf0b33f5846fd8aec782f0ba5a9e3b596"
source = "git+https://github.com/storytold/craft-libs?rev=2b9a325f57624804ed423aded16695eddb815119#2b9a325f57624804ed423aded16695eddb815119"
dependencies = [
"flate2",
"thiserror 2.0.21",
@@ -1823,7 +1879,17 @@ dependencies = [
[[package]]
name = "craft-zip"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=2b9a325f57624804ed423aded16695eddb815119#2b9a325f57624804ed423aded16695eddb815119"
source = "git+https://github.com/storytold/craft-libs?rev=7ad4765ee55496d0ccdb7659ad7a6375c7bbb484#7ad4765ee55496d0ccdb7659ad7a6375c7bbb484"
dependencies = [
"flate2",
"thiserror 2.0.21",
"zip 9.1.1",
]
[[package]]
name = "craft-zip"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=899e396b9e2710fcdf1ad9b6249d6c456b7ca9a2#899e396b9e2710fcdf1ad9b6249d6c456b7ca9a2"
dependencies = [
"flate2",
"thiserror 2.0.21",
@@ -2052,7 +2118,7 @@ name = "designcraft-cli"
version = "0.21.0"
dependencies = [
"craft-file-formats",
"craft-image-codecs 0.1.0 (git+https://github.com/storytold/craft-libs?rev=ea1c84290dadec636900b4d1bce107e59ca3f0d6)",
"craft-image-codecs 0.1.0 (git+https://github.com/storytold/craft-libs?rev=bfea7d9800a9f14e496209f9df30e9ef45655701)",
"designcraft-color",
"designcraft-compose",
"designcraft-doc",
@@ -2125,8 +2191,8 @@ 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=1ad5f35bf)",
"craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=f23b0f33f0d00b157476533a43cbbcfd901aa1f1)",
"craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=899e396b9e2710fcdf1ad9b6249d6c456b7ca9a2)",
"craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=a5ac3aa05cf3ec013961a85599ddd9e0b5c03813)",
"designcraft-color",
"designcraft-compose",
"designcraft-doc",
@@ -2209,9 +2275,9 @@ name = "designcraft-idml"
version = "0.21.0"
dependencies = [
"craft-file-formats",
"craft-idml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=1ad5f35bf)",
"craft-idml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=899e396b9e2710fcdf1ad9b6249d6c456b7ca9a2)",
"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=1ad5f35bf)",
"craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=899e396b9e2710fcdf1ad9b6249d6c456b7ca9a2)",
"designcraft-color",
"designcraft-compose",
"designcraft-doc",
@@ -2229,7 +2295,7 @@ dependencies = [
"craft-cms",
"craft-eps 0.1.0 (git+https://github.com/storytold/craft-libs?rev=ba24fe2435adb3c81ad6057faf36365fbba736cf)",
"craft-file-formats",
"craft-image-codecs 0.1.0 (git+https://github.com/storytold/craft-libs?rev=ea1c84290dadec636900b4d1bce107e59ca3f0d6)",
"craft-image-codecs 0.1.0 (git+https://github.com/storytold/craft-libs?rev=bfea7d9800a9f14e496209f9df30e9ef45655701)",
"craft-psd",
"craft-svg 0.1.0 (git+https://github.com/storytold/craft-libs?rev=cc23ffd4d26f3074808e2187d332564817624f8f)",
"designcraft-color",
@@ -2263,7 +2329,7 @@ version = "0.21.0"
dependencies = [
"chrono",
"craft-cms",
"craft-image-codecs 0.1.0 (git+https://github.com/storytold/craft-libs?rev=ea1c84290dadec636900b4d1bce107e59ca3f0d6)",
"craft-image-codecs 0.1.0 (git+https://github.com/storytold/craft-libs?rev=bfea7d9800a9f14e496209f9df30e9ef45655701)",
"craft-pdf",
"craft-prepress",
"designcraft-color",
@@ -2288,7 +2354,7 @@ name = "designcraft-pptx"
version = "0.21.0"
dependencies = [
"chrono",
"craft-image-codecs 0.1.0 (git+https://github.com/storytold/craft-libs?rev=ea1c84290dadec636900b4d1bce107e59ca3f0d6)",
"craft-image-codecs 0.1.0 (git+https://github.com/storytold/craft-libs?rev=bfea7d9800a9f14e496209f9df30e9ef45655701)",
"craft-opc 0.1.0 (git+https://github.com/storytold/craft-libs?rev=8abfa9d0f14bafbfc3449fc552ffeafb9ca6a551)",
"craft-pptx",
"designcraft-color",
@@ -2309,7 +2375,7 @@ name = "designcraft-render"
version = "0.21.0"
dependencies = [
"bytemuck",
"craft-image-codecs 0.1.0 (git+https://github.com/storytold/craft-libs?rev=ea1c84290dadec636900b4d1bce107e59ca3f0d6)",
"craft-image-codecs 0.1.0 (git+https://github.com/storytold/craft-libs?rev=bfea7d9800a9f14e496209f9df30e9ef45655701)",
"craft-pdf",
"designcraft-color",
"designcraft-compose",
@@ -2331,7 +2397,7 @@ version = "0.21.0"
dependencies = [
"craft-docx",
"craft-file-formats",
"craft-idml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=1ad5f35bf)",
"craft-idml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=899e396b9e2710fcdf1ad9b6249d6c456b7ca9a2)",
"craft-rtf",
"craft-wordmodel",
"craft-xlsx",
@@ -3474,7 +3540,7 @@ dependencies = [
[[package]]
name = "hayro"
version = "0.7.1"
source = "git+https://github.com/storytold/craft-libs?rev=40525913633942f84b06d4837a8d90534a55d63f#40525913633942f84b06d4837a8d90534a55d63f"
source = "git+https://github.com/storytold/craft-libs?rev=a5ac3aa05cf3ec013961a85599ddd9e0b5c03813#a5ac3aa05cf3ec013961a85599ddd9e0b5c03813"
dependencies = [
"bytemuck",
"hayro-interpret",
@@ -3494,7 +3560,7 @@ checksum = "9f4d0e94ddd48749f06bbe4e5389fb9799a0c45bcaf00495042076ef05e3241a"
[[package]]
name = "hayro-cmap"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=40525913633942f84b06d4837a8d90534a55d63f#40525913633942f84b06d4837a8d90534a55d63f"
source = "git+https://github.com/storytold/craft-libs?rev=a5ac3aa05cf3ec013961a85599ddd9e0b5c03813#a5ac3aa05cf3ec013961a85599ddd9e0b5c03813"
dependencies = [
"brotli",
"hayro-postscript",
@@ -3503,7 +3569,7 @@ dependencies = [
[[package]]
name = "hayro-interpret"
version = "0.7.0"
source = "git+https://github.com/storytold/craft-libs?rev=40525913633942f84b06d4837a8d90534a55d63f#40525913633942f84b06d4837a8d90534a55d63f"
source = "git+https://github.com/storytold/craft-libs?rev=a5ac3aa05cf3ec013961a85599ddd9e0b5c03813#a5ac3aa05cf3ec013961a85599ddd9e0b5c03813"
dependencies = [
"bitflags 2.13.2",
"hayro-cmap",
@@ -3521,7 +3587,7 @@ dependencies = [
[[package]]
name = "hayro-jbig2"
version = "0.3.0"
source = "git+https://github.com/storytold/craft-libs?rev=40525913633942f84b06d4837a8d90534a55d63f#40525913633942f84b06d4837a8d90534a55d63f"
source = "git+https://github.com/storytold/craft-libs?rev=a5ac3aa05cf3ec013961a85599ddd9e0b5c03813#a5ac3aa05cf3ec013961a85599ddd9e0b5c03813"
dependencies = [
"fearless_simd",
"hayro-ccitt",
@@ -3539,12 +3605,12 @@ dependencies = [
[[package]]
name = "hayro-postscript"
version = "0.1.0"
source = "git+https://github.com/storytold/craft-libs?rev=40525913633942f84b06d4837a8d90534a55d63f#40525913633942f84b06d4837a8d90534a55d63f"
source = "git+https://github.com/storytold/craft-libs?rev=a5ac3aa05cf3ec013961a85599ddd9e0b5c03813#a5ac3aa05cf3ec013961a85599ddd9e0b5c03813"
[[package]]
name = "hayro-syntax"
version = "0.7.2"
source = "git+https://github.com/storytold/craft-libs?rev=40525913633942f84b06d4837a8d90534a55d63f#40525913633942f84b06d4837a8d90534a55d63f"
source = "git+https://github.com/storytold/craft-libs?rev=a5ac3aa05cf3ec013961a85599ddd9e0b5c03813#a5ac3aa05cf3ec013961a85599ddd9e0b5c03813"
dependencies = [
"flate2",
"hayro-ccitt",
@@ -4185,7 +4251,7 @@ dependencies = [
[[package]]
name = "krilla"
version = "0.8.2"
source = "git+https://github.com/storytold/craft-libs?rev=40525913633942f84b06d4837a8d90534a55d63f#40525913633942f84b06d4837a8d90534a55d63f"
source = "git+https://github.com/storytold/craft-libs?rev=a5ac3aa05cf3ec013961a85599ddd9e0b5c03813#a5ac3aa05cf3ec013961a85599ddd9e0b5c03813"
dependencies = [
"base64 0.22.1",
"bumpalo",
@@ -7528,6 +7594,27 @@ dependencies = [
"wasm-bindgen",
]
[[package]]
name = "vectorcraft-geom"
version = "0.18.0"
source = "git+https://github.com/storytold/vectorcraft.git?rev=6b3a6b8788ebcb420d69449199cbdf323888d27e#6b3a6b8788ebcb420d69449199cbdf323888d27e"
dependencies = [
"kurbo",
"serde",
"thiserror 2.0.21",
]
[[package]]
name = "vectorcraft-pathops"
version = "0.18.0"
source = "git+https://github.com/storytold/vectorcraft.git?rev=6b3a6b8788ebcb420d69449199cbdf323888d27e#6b3a6b8788ebcb420d69449199cbdf323888d27e"
dependencies = [
"kurbo",
"linesweeper",
"thiserror 2.0.21",
"vectorcraft-geom",
]
[[package]]
name = "vello_common"
version = "0.0.8"
+18 -18
View File
@@ -14,29 +14,29 @@ repository = "https://github.com/storytold/designcraft"
# Shared RFC 4648 encoding; document decoding policies remain local.
craft-mime = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "f0f4758c01581d79577b9bf5046c06f4e77b1f18" }
# Shared reader and writer; publish the immutable revision before this consumer.
craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "40525913633942f84b06d4837a8d90534a55d63f", version = "=0.1.0", default-features = false }
craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "a5ac3aa05cf3ec013961a85599ddd9e0b5c03813", version = "=0.1.0", default-features = false }
craft-designcraft-format = { git = "https://github.com/storytold/craft-libs", rev = "b1b4602a71d19e09ad33f7752a10d6598cf39b2b", 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 = "1ad5f35bf", version = "=0.1.0" }
craft-idml = { git = "https://github.com/storytold/craft-libs", rev = "899e396b9e2710fcdf1ad9b6249d6c456b7ca9a2", 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 = "1ad5f35bf", 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-xml = { git = "https://github.com/storytold/craft-libs", rev = "899e396b9e2710fcdf1ad9b6249d6c456b7ca9a2", version = "=0.1.0" }
craft-xml-dtd = { package = "craft-xml", git = "https://github.com/storytold/craft-libs", rev = "a5ac3aa05cf3ec013961a85599ddd9e0b5c03813", version = "=0.1.0" }
craft-rtf = { git = "https://github.com/storytold/craft-libs", rev = "bfea7d9800a9f14e496209f9df30e9ef45655701", version = "=0.1.0" }
craft-xlsx = { git = "https://github.com/storytold/craft-libs", rev = "2b9a325f57624804ed423aded16695eddb815119", version = "=0.1.0" }
craft-docx = { git = "https://github.com/storytold/craft-libs", rev = "ba24fe2435adb3c81ad6057faf36365fbba736cf", version = "=0.1.0" }
craft-wordmodel = { git = "https://github.com/storytold/craft-libs", rev = "ba24fe2435adb3c81ad6057faf36365fbba736cf", version = "=0.1.0" }
craft-docx = { git = "https://github.com/storytold/craft-libs", rev = "7ad4765ee55496d0ccdb7659ad7a6375c7bbb484", version = "=0.1.0" }
craft-wordmodel = { git = "https://github.com/storytold/craft-libs", rev = "7ad4765ee55496d0ccdb7659ad7a6375c7bbb484", version = "=0.1.0" }
craft-csv = { git = "https://github.com/storytold/craft-libs", rev = "387c64892b30fdad491b263cc3d9eac660d88dcc", version = "=0.1.0" }
craft-image-codecs = { git = "https://github.com/storytold/craft-libs", rev = "ea1c84290dadec636900b4d1bce107e59ca3f0d6", version = "=0.1.0" }
craft-psd = { git = "https://github.com/storytold/craft-libs", rev = "ea1c84290dadec636900b4d1bce107e59ca3f0d6", version = "=0.1.0" }
craft-image-codecs = { git = "https://github.com/storytold/craft-libs", rev = "bfea7d9800a9f14e496209f9df30e9ef45655701", version = "=0.1.0" }
craft-psd = { git = "https://github.com/storytold/craft-libs", rev = "d15bf1f35b17b759870f9e5111b9a5d243f64888", version = "=0.1.0" }
craft-file-formats = { git = "https://github.com/storytold/craft-libs", rev = "eed3c28cf016723d004d6f2c79c61424c15d4558", version = "=0.1.0" }
craft-opc = { git = "https://github.com/storytold/craft-libs", rev = "8abfa9d0f14bafbfc3449fc552ffeafb9ca6a551", version = "=0.1.0" }
craft-pptx = { git = "https://github.com/storytold/craft-libs", rev = "f6cab1980", version = "=0.1.0" }
# Shared keyboard bindings: chords, overrides, conflicts, egui dispatch, the Keyboard Shortcuts dialog.
craft-keymap = { git = "https://github.com/storytold/craft-libs", rev = "92d392cff132eaf53e13afff77f38b5c11b73aa0", version = "=0.1.0", features = ["egui", "ui"] }
# Separations, ink coverage and the ink manager; same revision as craft-pdf and the krilla patch.
craft-prepress = { git = "https://github.com/storytold/craft-libs", rev = "40525913633942f84b06d4837a8d90534a55d63f", version = "=0.1.0", features = ["flatten"] }
craft-prepress = { git = "https://github.com/storytold/craft-libs", rev = "a5ac3aa05cf3ec013961a85599ddd9e0b5c03813", version = "=0.1.0", features = ["flatten"] }
# craft-update: app-specific pretend versions apply to startup and manual checks.
craft-update = { git = "https://github.com/storytold/craft-libs", version = "=0.1.0", rev = "e98299546f5c5c3c22388d16507f8b5e61a5f280", features = ["egui"] }
# internal
@@ -103,7 +103,7 @@ craft-atomic = { version = "0.1.0", git = "https://github.com/storytold/craft-li
craft-print = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "92d392cff132eaf53e13afff77f38b5c11b73aa0" }
# ICC colour management: working spaces, transforms, black point compensation (craft-libs).
craft-cms = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "40525913633942f84b06d4837a8d90534a55d63f" }
craft-cms = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "a5ac3aa05cf3ec013961a85599ddd9e0b5c03813" }
# ui
# Shared frontend components; keep this dependency above the engine boundary.
@@ -153,16 +153,16 @@ debug = 0
# Opt-in cancelable macOS termination on the pinned winit 0.30 line.
[patch.crates-io]
krilla = { git = "https://github.com/storytold/craft-libs", rev = "40525913633942f84b06d4837a8d90534a55d63f", version = "=0.8.2" }
krilla = { git = "https://github.com/storytold/craft-libs", rev = "a5ac3aa05cf3ec013961a85599ddd9e0b5c03813", version = "=0.8.2" }
winit = { git = "https://github.com/storytold/winit.git", rev = "a517b3846ee8457d84ee4975110bfda6797c44dc" }
# The hayro crates from craft-libs' vendor/ directory (pdfcraft's, plus the plate mode and decode
# limits craft-pdf and craft-prepress need); same revision as craft-pdf.
hayro = { git = "https://github.com/storytold/craft-libs", rev = "40525913633942f84b06d4837a8d90534a55d63f", version = "=0.7.1" }
hayro-interpret = { git = "https://github.com/storytold/craft-libs", rev = "40525913633942f84b06d4837a8d90534a55d63f", version = "=0.7.0" }
hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "40525913633942f84b06d4837a8d90534a55d63f", version = "=0.7.2" }
hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "40525913633942f84b06d4837a8d90534a55d63f", version = "=0.3.0" }
hayro-cmap = { git = "https://github.com/storytold/craft-libs", rev = "40525913633942f84b06d4837a8d90534a55d63f", version = "=0.1.0" }
hayro-postscript = { git = "https://github.com/storytold/craft-libs", rev = "40525913633942f84b06d4837a8d90534a55d63f", version = "=0.1.0" }
hayro = { git = "https://github.com/storytold/craft-libs", rev = "a5ac3aa05cf3ec013961a85599ddd9e0b5c03813", version = "=0.7.1" }
hayro-interpret = { git = "https://github.com/storytold/craft-libs", rev = "a5ac3aa05cf3ec013961a85599ddd9e0b5c03813", version = "=0.7.0" }
hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "a5ac3aa05cf3ec013961a85599ddd9e0b5c03813", version = "=0.7.2" }
hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "a5ac3aa05cf3ec013961a85599ddd9e0b5c03813", version = "=0.3.0" }
hayro-cmap = { git = "https://github.com/storytold/craft-libs", rev = "a5ac3aa05cf3ec013961a85599ddd9e0b5c03813", version = "=0.1.0" }
hayro-postscript = { git = "https://github.com/storytold/craft-libs", rev = "a5ac3aa05cf3ec013961a85599ddd9e0b5c03813", version = "=0.1.0" }
ecolor = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" }
emath = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" }
epaint = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" }
+1
View File
@@ -396,6 +396,7 @@ list) · [roadmap.md](docs/roadmap.md) (milestones, plan) · [parity-checklist.m
- **2026-11-15** · Removed the obsolete gap saying pull requests have no test workflow: [CI](.github/workflows/ci.yml) runs the shared quality gate on every pull request and push to main (#1352). No readiness percentage change.
- **2026-11-15** · Accepting tracked deletions or rejecting insertions follows body-text selections through the removed text, including resolving all changes, and preserves independent cell and footnote insertion points. No readiness percentage change.
- **2026-11-15** · Format follow-ups to the craft-libs cutover (craft-libs#778; ported from #2734 by Dylan M. Taylor): IDML export keeps CDATA image contents and table spans such as `inf` reach the table edge; DOCX plain-text import leaves out deleted tracked changes and expands inline objects; an XLSX number cell that isn't a number shows as written; unmarked CMYK JPEGs keep the shared decoder's ink polarity; PPTX export writes exact opacity; PDF export repins craft-pdf and craft-prepress to craft-libs main. No readiness percentage change.
- **2026-11-14** · `object.stroke` refuses a tint or gap tint outside 0 to 1, a weight outside 0 to 1000 pt, a miter limit outside 1 to 500, a gap overprint that isn't true or false, and an alignment, cap, join or arrowhead name it doesn't have, instead of clamping the numbers and skipping the names. The Stroke panel's Weight and Miter Limit fields keep their values in those ranges. No readiness percentage change.
- **2026-11-14** · Photo books no longer freeze the canvas (#1411; based on #2051 by texjer). The image cache keeps only the mip level each image is drawn at, for every format and display quality: a TIFF, PNG, PSD or CMYK JPEG used to keep its full decode too (48 MB for a 12 MP photo), so after about a dozen photos each edit evicted and decoded them again on the render thread. The canvas no longer waits for decodes: an image not cached at its size shows a light box or another cached level and decodes on one of three background threads (within the same in-flight memory limit as the decodes ahead of a render), and finished decodes are drawn in batches, at most one canvas render every 250 ms. Zooming into an image decodes it at most twice. Thumbnails and exports still wait for every image. No readiness percentage change.
- **2026-11-14** · IDML export keeps each endnote reference as its number in superscript text, as the endnote frame lists it, instead of dropping it; the endnotes are still written as plain text, without IDML's endnote elements (#2753). No readiness percentage change.
+1 -1
View File
@@ -10,7 +10,7 @@ pub(super) fn p(name: &str, ty: &str, val: impl Into<String>) -> El {
/// Insert a `<Properties>` element as the first child when there are any.
pub(super) fn with_props(el: El, props: Vec<El>) -> El {
crate::xml::from_craft(craft_idml::with_props(crate::xml::to_craft(&el), props.into_iter().map(|p| crate::xml::to_craft(&p)).collect()))
crate::xml::from_craft_for_write(craft_idml::with_props(crate::xml::to_craft(&el), props.into_iter().map(|p| crate::xml::to_craft(&p)).collect()))
}
pub(super) fn pkg_root(kind: &str) -> El {
+5 -9
View File
@@ -160,15 +160,11 @@ impl<'r> Importer<'r> {
if r >= nr || c >= nc {
continue;
}
let (mut cs, mut rs) = model_cell.span();
if model_cell.values.get("RowSpan").is_some_and(|v| v.eq_ignore_ascii_case("inf") || v.eq_ignore_ascii_case("infinity")) {
rs = (nr - r) as u32;
}
if model_cell.values.get("ColumnSpan").is_some_and(|v| v.eq_ignore_ascii_case("inf") || v.eq_ignore_ascii_case("infinity")) {
cs = (nc - c) as u32;
}
let rs = (rs as usize).min(nr - r);
let cs = (cs as usize).min(nc - c);
// Preserve the prior importer behavior for malformed positive spans such as `inf`:
// saturate the float-to-integer conversion, then clamp before grid arithmetic.
let span = |key| model_cell.values.prop(key).and_then(|v| v.trim().parse::<f64>().ok()).unwrap_or(1.0).max(1.0) as usize;
let rs = span("RowSpan").min(nr - r);
let cs = span("ColumnSpan").min(nc - c);
let mut cell = t.cell(r, c).cloned().unwrap_or_default();
let cell_el = crate::xml::from_craft(model_cell.to_el());
let cell_style =
+16
View File
@@ -3126,6 +3126,22 @@ fn hostile_table_spans_are_clamped_before_arithmetic() {
assert_eq!(table.cell(1, 1).unwrap().col_span, 2);
}
/// Spans are read as numbers: a fraction rounds down, a span past the table (even one too large for
/// 32 bits) reaches its edge, and anything under 1 or not a number spans one cell.
#[test]
fn numeric_table_spans_round_down_and_stop_at_the_table_edge() {
for (raw, rows, cols) in
[("1.5", 1, 1), ("2.5", 2, 2), ("4000000000", 2, 3), ("1e300", 2, 3), ("0", 1, 1), ("-3", 1, 1), ("NaN", 1, 1), ("x", 1, 1)]
{
let story = CASCADE_STORY.replace("Name=\"0:0\"", &format!("Name=\"0:0\" RowSpan=\"{raw}\" ColumnSpan=\"{raw}\""));
let document = import_idml(&fixture_with_table_styles(CASCADE_STYLES, &story)).unwrap();
document.check().unwrap();
let table = document.stories.values().flat_map(|s| s.tables.values()).next().unwrap();
let cell = table.cell(0, 0).unwrap();
assert_eq!((cell.row_span, cell.col_span), (rows, cols), "{raw}");
}
}
#[test]
fn signed_idml_edge_priorities_roundtrip_without_clamping() {
let story = CASCADE_STORY.replace(
+23 -4
View File
@@ -227,6 +227,16 @@ pub fn parse(bytes: &[u8]) -> Result<El, String> {
}
pub(crate) fn from_craft(el: craft_xml::El) -> El {
from_craft_with_cdata(el, false)
}
/// Convert shared XML trees back into the writer's tree without losing CDATA boundaries.
/// Parsing deliberately folds CDATA into text, but write-side model composition must retain it.
pub(crate) fn from_craft_for_write(el: craft_xml::El) -> El {
from_craft_with_cdata(el, true)
}
fn from_craft_with_cdata(el: craft_xml::El, preserve_cdata: bool) -> El {
El {
name: el.name,
attrs: el.attrs,
@@ -234,11 +244,10 @@ pub(crate) fn from_craft(el: craft_xml::El) -> El {
.children
.into_iter()
.filter_map(|n| match n {
craft_xml::Node::El(e) => Some(Node::El(from_craft(e))),
craft_xml::Node::El(e) => Some(Node::El(from_craft_with_cdata(e, preserve_cdata))),
craft_xml::Node::Text(t) => Some(Node::Text(t)),
// The parser joins CDATA to the text around it, so only trees built for export
// (`<Contents>` image data passed through `with_props`) carry sections here.
craft_xml::Node::CData(t) => Some(Node::CData(t)),
craft_xml::Node::CData(t) if preserve_cdata => Some(Node::CData(t)),
craft_xml::Node::CData(t) => Some(Node::Text(t)),
craft_xml::Node::Pi { target, data } => Some(Node::Pi(target, data.trim().to_string())),
craft_xml::Node::Comment(_) => None,
})
@@ -250,6 +259,16 @@ pub(crate) fn from_craft(el: craft_xml::El) -> El {
mod tests {
use super::*;
#[test]
fn parsed_cdata_is_text_but_write_conversion_preserves_its_boundary() {
let tree = craft_xml::El { name: "Contents".into(), attrs: Vec::new(), children: vec![craft_xml::Node::CData("JVBERi0=".into())] };
assert_eq!(from_craft(tree.clone()).children, vec![Node::Text("JVBERi0=".into())]);
let written = from_craft_for_write(tree);
assert_eq!(written.children, vec![Node::CData("JVBERi0=".into())]);
assert!(String::from_utf8(document(&written)).unwrap().contains("<![CDATA[JVBERi0=]]>"));
}
/// Issue #712: nesting past the budget is an error from the parser, not a stack overflow later.
#[test]
fn nesting_past_the_budget_is_refused() {
+7 -26
View File
@@ -402,7 +402,7 @@ pub fn decode_rgba(bytes: &[u8]) -> Option<image::RgbaImage> {
}
let decoded = craft_image_codecs::decode_with(bytes, &decode_options()).ok()?;
if decoded.layout().is_cmyk() {
let raster = cmyk_raster(&decoded, bytes)?;
let raster = cmyk_raster(&decoded)?;
return to_display_rgba(Pixels::Cmyk(raster), decoded.icc.as_deref(), &DisplayColour::active());
}
let rgba = image::RgbaImage::from_raw(decoded.width(), decoded.height(), decoded.to_rgba8())?;
@@ -479,39 +479,20 @@ fn decode_options() -> craft_image_codecs::DecodeOptions {
craft_image_codecs::DecodeOptions { limits: craft_image_codecs::Limits { max_alloc: MAX_RGBA_BYTES, ..Default::default() }, ..Default::default() }
}
/// Whether an APP14 "Adobe" segment comes before the image data.
fn adobe_marker(bytes: &[u8]) -> bool {
let mut i = 2;
while let Some(&[0xFF, marker, hi, lo]) = bytes.get(i..i + 4).and_then(|s| <&[u8; 4]>::try_from(s).ok()) {
// Start of scan or end of image: no more header segments.
if marker == 0xDA || marker == 0xD9 {
return false;
}
let len = usize::from(u16::from_be_bytes([hi, lo]));
if marker == 0xEE && bytes.get(i + 4..i + 9) == Some(b"Adobe".as_slice()) {
return true;
}
i += 2 + len;
}
false
}
fn cmyk_raster(image: &craft_image_codecs::Image, bytes: &[u8]) -> Option<CmykRaster> {
/// Convert the shared decoder's CMYK values to the app's ink raster without changing their
/// polarity. `craft-image-codecs` already interprets Adobe-marked and unmarked JPEG CMYK and
/// YCCK samples; inverting unmarked JPEGs here reverses their documented device-ink values.
fn cmyk_raster(image: &craft_image_codecs::Image) -> Option<CmykRaster> {
let converted = image.convert(craft_image_codecs::ChannelLayout::CmykA, craft_image_codecs::SampleType::U8);
let pixels = usize::try_from(converted.width()).ok()?.checked_mul(usize::try_from(converted.height()).ok()?)?;
let data = converted.as_u8()?;
if data.len() != pixels.checked_mul(5)? {
return None;
}
let invert = bytes.starts_with(&[0xFF, 0xD8]) && !adobe_marker(bytes);
let mut cmyk = Vec::with_capacity(pixels.checked_mul(4)?);
let mut alpha = Vec::with_capacity(pixels);
for &[c, m, y, k, a] in data.as_chunks::<5>().0 {
if invert {
cmyk.extend([255 - c, 255 - m, 255 - y, 255 - k]);
} else {
cmyk.extend([c, m, y, k]);
}
cmyk.extend([c, m, y, k]);
alpha.push(a);
}
let alpha = alpha.iter().any(|&a| a < 255).then_some(alpha);
@@ -609,7 +590,7 @@ pub fn decode_cmyk_tiff(bytes: &[u8]) -> Option<CmykRaster> {
return None;
}
let image = craft_image_codecs::decode_with(bytes, &decode_options()).ok()?;
image.layout().is_cmyk().then(|| cmyk_raster(&image, bytes)).flatten()
image.layout().is_cmyk().then(|| cmyk_raster(&image)).flatten()
}
/// An SVG rasterised so its longer side is `max_side` pixels: premultiplied RGBA8.
+51
View File
@@ -1053,3 +1053,54 @@ fn reduced_decoding_refuses_progressive_jpegs_whose_full_size_coefficients_are_o
let gray = decode_rgba_reduced(&progressive_jpeg(10_240, 8_800, 1), 3).unwrap();
assert_eq!(gray.dimensions(), (1_280, 1_100));
}
/// Planar CMYK TIFFs and CMYK TIFFs with associated (premultiplied) alpha keep their inks through
/// the shared decoder, so the PDF export's RGB fallback is only for other inks and oversized files.
#[test]
fn planar_and_premultiplied_cmyk_tiffs_keep_their_inks() {
use tiff::encoder::colortype::CMYKA8;
// 2×1, PlanarConfiguration 2: one strip per ink, 100% K then C0 M100 Y100 K0.
let (bps, offsets, counts, data) = (134u32, 142u32, 158u32, 174u32);
let entries: [(u16, u16, u32, u32); 10] = [
(256, 4, 1, 2), // width
(257, 4, 1, 1), // height
(258, 3, 4, bps), // bits per sample
(259, 3, 1, 1), // no compression
(262, 3, 1, 5), // separated (CMYK)
(273, 4, 4, offsets), // strip offsets
(277, 3, 1, 4), // samples per pixel
(278, 4, 1, 1), // rows per strip
(279, 4, 4, counts), // strip byte counts
(284, 3, 1, 2), // planar
];
let mut t = b"II*\0".to_vec();
t.extend(8u32.to_le_bytes());
t.extend(10u16.to_le_bytes());
for (tag, kind, count, value) in entries {
t.extend(tag.to_le_bytes());
t.extend(kind.to_le_bytes());
t.extend(count.to_le_bytes());
t.extend(value.to_le_bytes());
}
t.extend(0u32.to_le_bytes());
assert_eq!(t.len(), bps as usize);
t.extend([8u16; 4].iter().flat_map(|b| b.to_le_bytes()));
t.extend((0..4u32).flat_map(|i| (data + 2 * i).to_le_bytes()));
t.extend([2u32; 4].iter().flat_map(|c| c.to_le_bytes()));
assert_eq!(t.len(), data as usize);
t.extend([0, 0, 0, 255, 0, 255, 255, 0]);
assert!(is_cmyk_tiff(&t));
assert_eq!(decode_cmyk_tiff(&t), Some(CmykRaster { width: 2, height: 1, cmyk: vec![0, 0, 0, 255, 0, 255, 255, 0], alpha: None }));
// ExtraSamples 1 (associated alpha): the second pixel is C0 M100 Y100 K0 at half coverage.
let mut b = Vec::new();
let mut enc = tiff::encoder::TiffEncoder::new(std::io::Cursor::new(&mut b)).unwrap();
let mut img = enc.new_image::<CMYKA8>(2, 1).unwrap();
img.encoder().write_tag(tiff::tags::Tag::ExtraSamples, &[1u16][..]).unwrap();
img.write_data(&[0, 0, 0, 255, 255, 0, 128, 128, 0, 128]).unwrap();
let r = decode_cmyk_tiff(&b).expect("a CMYK TIFF with associated alpha keeps its inks");
assert_eq!(r.alpha, Some(vec![255, 128]));
assert_eq!(&r.cmyk[..4], &[0, 0, 0, 255]);
let straight = &r.cmyk[4..];
assert!(straight[0] <= 1 && straight[1] >= 254 && straight[2] >= 254 && straight[3] <= 1, "made straight: {straight:?}");
}
+13 -16
View File
@@ -13,6 +13,14 @@ use crate::fonts::Fonts;
use crate::model::{Media, Slide};
use crate::{PptxError, PptxOptions, Result};
/// Preserve fractional DesignCraft opacity in DrawingML instead of rounding it through 8-bit alpha.
pub(crate) fn color_with_opacity(color: designcraft_color::Color, opacity: f32) -> craft_pptx::ColorRef {
let [r, g, b, _] = color.to_rgba8(1.0);
let color = craft_pptx::ColorRef::rgb(craft_pptx::Rgba::rgb(r, g, b));
let alpha = (f64::from(opacity.clamp(0.0, 1.0)) * 100_000.0).round() as i32;
if alpha == 100_000 { color } else { color.with(craft_pptx::ColorTransform::Alpha(alpha)) }
}
/// Objects PowerPoint can't show as editable objects, which a caller should rasterise before
/// exporting: placed PDF and EPS graphics, type on a path, and effects without a DrawingML
/// counterpart.
@@ -362,20 +370,9 @@ impl<'a> Exporter<'a> {
pub(crate) fn model_color(&self, swatch: &str, tint: f32, alpha: f32) -> Option<craft_pptx::ColorRef> {
if let Some(gradient) = resolve_gradient(&self.doc.swatches, swatch) {
let (_, color, gradient_alpha) = gradient.expanded_stops().into_iter().next()?;
let total_alpha = gradient_alpha * alpha;
let [r, g, b, _] = color.to_rgba8(1.0);
let mut c = craft_pptx::ColorRef::rgb(craft_pptx::Rgba::rgb(r, g, b));
if total_alpha < 1.0 {
c = c.with(craft_pptx::ColorTransform::Alpha((total_alpha * 100_000.0).round() as i32));
}
return Some(c);
return Some(color_with_opacity(color, gradient_alpha * alpha));
}
let [r, g, b, _] = self.doc.resolve_color(swatch, tint)?.to_rgba8(1.0);
let mut c = craft_pptx::ColorRef::rgb(craft_pptx::Rgba::rgb(r, g, b));
if alpha < 1.0 {
c = c.with(craft_pptx::ColorTransform::Alpha((alpha * 100_000.0).round() as i32));
}
Some(c)
Some(color_with_opacity(self.doc.resolve_color(swatch, tint)?, alpha))
}
fn model_fill(&mut self, fill: &designcraft_doc::Fill, closed: bool, opacity: f32) -> craft_pptx::Fill {
@@ -389,9 +386,9 @@ impl<'a> Exporter<'a> {
let stops = gradient
.expanded_stops()
.into_iter()
.map(|(offset, color, alpha)| {
let [r, g, b, a] = color.to_rgba8(alpha * opacity);
craft_pptx::style::GradientStop { pos: f64::from(offset), color: craft_pptx::ColorRef::rgb(craft_pptx::Rgba::rgba(r, g, b, a)) }
.map(|(offset, color, alpha)| craft_pptx::style::GradientStop {
pos: f64::from(offset),
color: color_with_opacity(color, alpha * opacity),
})
.collect();
let shape = match gradient.kind {
+3 -5
View File
@@ -397,13 +397,11 @@ pub(crate) fn model_body(ex: &mut Exporter, seg: &Segment, k: f64, opacity: f32,
fn color(ex: &Exporter, swatch: &str, tint: f32, opacity: f32) -> Option<craft_pptx::ColorRef> {
let color = if let Some(gradient) = resolve_gradient(&ex.doc.swatches, swatch) {
let (_, color, alpha) = gradient.expanded_stops().into_iter().next()?;
let [r, g, b, a] = color.to_rgba8(alpha * opacity);
craft_pptx::Rgba::rgba(r, g, b, a)
return Some(crate::slide::color_with_opacity(color, alpha * opacity));
} else {
let [r, g, b, a] = ex.doc.resolve_color(swatch, tint)?.to_rgba8(opacity);
craft_pptx::Rgba::rgba(r, g, b, a)
ex.doc.resolve_color(swatch, tint)?
};
Some(craft_pptx::ColorRef::rgb(color))
Some(crate::slide::color_with_opacity(color, opacity))
}
fn run_props(ex: &mut Exporter, run: Option<&Run>, size: f64, k: f64, opacity: f32) -> craft_pptx::text::RunProps {
+1
View File
@@ -319,6 +319,7 @@ fn plain_blocks(blocks: &[std::sync::Arc<Block>]) -> String {
out.push('\n');
}
first = false;
// The importer accepts tracked changes: deletions are left out, inline objects expanded.
let text = p.final_text();
let is_break = |c: char| matches!(c, designcraft_doc::PAGE_BREAK | designcraft_doc::COLUMN_BREAK);
out.push_str(&text.chars().map(|c| if is_break(c) { '\n' } else { c }).collect::<String>());
+25
View File
@@ -256,6 +256,31 @@ fn imports_styles_runs_footnotes_and_tables() {
assert_eq!(i.char_styles[0].chars.font_style.as_deref(), Some("Italic"));
}
/// Word stores its built-in heading names in lower case (`heading 1`); they come in under the
/// name Word shows, `Heading 1`, as in v0.21.0.
#[test]
fn built_in_headings_take_the_name_word_shows() {
let styles = format!(
r#"<w:styles {W}>
<w:style w:type="paragraph" w:styleId="Heading1"><w:name w:val="heading 1"/></w:style>
<w:style w:type="paragraph" w:styleId="Heading2"><w:name w:val="heading 2"/></w:style>
<w:style w:type="paragraph" w:styleId="Heading9"><w:name w:val="heading 9"/></w:style>
</w:styles>"#
);
let document = format!(
r#"<w:document {W}><w:body>
<w:p><w:pPr><w:pStyle w:val="Heading1"/></w:pPr><w:r><w:t>One</w:t></w:r></w:p>
<w:p><w:pPr><w:pStyle w:val="Heading2"/></w:pPr><w:r><w:t>Two</w:t></w:r></w:p>
<w:p><w:pPr><w:pStyle w:val="Heading9"/></w:pPr><w:r><w:t>Nine</w:t></w:r></w:p>
</w:body></w:document>"#
);
let i = import(&docx(&document, &styles, "")).unwrap();
let used: Vec<&str> = i.story.paras.iter().map(|p| p.style.as_str()).collect();
assert_eq!(used, ["Heading 1", "Heading 2", "Heading 9"]);
let names: Vec<&str> = i.para_styles.iter().map(|s| s.name.as_str()).collect();
assert_eq!(names, ["Heading 1", "Heading 2", "Heading 9"]);
}
/// A content control inside a paragraph (`w:sdt`) keeps its text, also around a hyperlink.
#[test]
fn inline_content_control_text_is_kept() {
+14 -3
View File
@@ -38,9 +38,11 @@ fn sheet_cells(
let mut cut = false;
let result = package.sheet(entry, |row| {
for cell in row.cells {
let value = match &cell.value {
craft_xlsx::CellValue::Invalid(s) => s.clone(),
other => display(other.resolve(&strings, date_1904)),
let value = match cell.value {
// A value that doesn't read as its type says (`inf`, `n/a` in a number cell) is
// shown as written, as the importer did before the shared reader.
craft_xlsx::CellValue::Invalid(raw) => raw,
value => display(value.resolve(&strings, date_1904)),
};
text_bytes = text_bytes.saturating_add(value.len());
if cells.len() >= max_cells || text_bytes > max_text_bytes {
@@ -418,6 +420,15 @@ mod tests {
}
}
#[test]
fn number_cells_that_are_not_numbers_show_as_written() {
for text in ["inf", "Infinity", "NaN", "n/a", "12 apples"] {
let book = one_value(&format!(r#"<c r="A2"><v>{text}</v></c>"#));
let rows = crate::xlsx_records(&book, None).unwrap();
assert_eq!(rows[1][0], text, "cell {text}");
}
}
#[test]
fn cached_string_values_are_not_reformatted_as_numbers() {
for text in ["00123", "1e3", "12.0", " 42 "] {
+2 -2
View File
@@ -5,8 +5,8 @@ use std::process::Command;
use serde_json::Value;
const REPO: &str = "https://github.com/storytold/craft-libs";
const REV: &str = "40525913633942f84b06d4837a8d90534a55d63f";
const COMMIT: &str = "40525913633942f84b06d4837a8d90534a55d63f";
const REV: &str = "a5ac3aa05cf3ec013961a85599ddd9e0b5c03813";
const COMMIT: &str = "a5ac3aa05cf3ec013961a85599ddd9e0b5c03813";
const PACKAGES: &[(&str, &str)] = &[
("craft-pdf", "0.1.0"),
("krilla", "0.8.2"),