diff --git a/ASSETS.md b/ASSETS.md
index 3233c99d0e..e4a17c7640 100644
--- a/ASSETS.md
+++ b/ASSETS.md
@@ -224,13 +224,16 @@ Generated-in-code art is original and has no file to list. This covers the defau
| `assets/icons/dc-swap.svg` | VectorCraft contributors | Original work, drawn for VectorCraft | MIT OR Apache-2.0 | |
| `assets/icons/dc-swatch-kinds.svg` | VectorCraft contributors | Original work, drawn for VectorCraft | MIT OR Apache-2.0 | |
| `assets/icons/dc-symbol-sprayer.svg` | VectorCraft contributors | Original work, drawn for VectorCraft | MIT OR Apache-2.0 | |
-| `assets/icons/dc-touch-type.svg` | VectorCraft contributors | Original work, drawn for VectorCraft | MIT OR Apache-2.0 | |
+| `assets/icons/dc-touch-type.svg` | VectorCraft contributors (designed by ham9zah) | Original work, drawn for VectorCraft | MIT OR Apache-2.0 | |
| `assets/icons/dc-transform-panel.svg` | VectorCraft contributors | Original work, drawn for VectorCraft | MIT OR Apache-2.0 | |
| `assets/icons/dc-transparency.svg` | VectorCraft contributors | Original work, drawn for VectorCraft | MIT OR Apache-2.0 | |
| `assets/icons/dc-twirl.svg` | VectorCraft contributors | Original work, drawn for VectorCraft | MIT OR Apache-2.0 | |
-| `assets/icons/dc-type-area.svg` | VectorCraft contributors | Original work, drawn for VectorCraft | MIT OR Apache-2.0 | |
-| `assets/icons/dc-type-path.svg` | VectorCraft contributors | Original work, drawn for VectorCraft | MIT OR Apache-2.0 | |
-| `assets/icons/dc-type-vertical.svg` | VectorCraft contributors | Original work, drawn for VectorCraft | MIT OR Apache-2.0 | |
+| `assets/icons/dc-type.svg` | VectorCraft contributors (designed by ham9zah) | Original work, drawn for VectorCraft | MIT OR Apache-2.0 | |
+| `assets/icons/dc-type-area.svg` | VectorCraft contributors (designed by ham9zah) | Original work, drawn for VectorCraft | MIT OR Apache-2.0 | |
+| `assets/icons/dc-type-path.svg` | VectorCraft contributors (designed by ham9zah) | Original work, drawn for VectorCraft | MIT OR Apache-2.0 | |
+| `assets/icons/dc-type-vertical.svg` | VectorCraft contributors (designed by ham9zah) | Original work, drawn for VectorCraft | MIT OR Apache-2.0 | |
+| `assets/icons/dc-type-vertical-area.svg` | VectorCraft contributors (designed by ham9zah) | Original work, drawn for VectorCraft | MIT OR Apache-2.0 | |
+| `assets/icons/dc-type-vertical-path.svg` | VectorCraft contributors (designed by ham9zah) | Original work, drawn for VectorCraft | MIT OR Apache-2.0 | |
| `assets/icons/dc-width-profile.svg` | VectorCraft contributors | Original work, drawn for VectorCraft | MIT OR Apache-2.0 | |
| `assets/icons/dc-width.svg` | VectorCraft contributors | Original work, drawn for VectorCraft | MIT OR Apache-2.0 | |
| `assets/icons/dc-wrinkle.svg` | VectorCraft contributors | Original work, drawn for VectorCraft | MIT OR Apache-2.0 | |
@@ -355,20 +358,20 @@ The shared PDF backend keeps the existing standard-font and CMap features. These
| Crate / file | Author | Source | Licence | SHA-256 | Use |
| --- | --- | --- | --- | --- | --- |
-| `hayro-interpret 0.7.0 / assets/FoxitDingbats.pfb` | Foxit Software Inc. / PDFium Authors | https://github.com/storytold/craft-libs/blob/92d392cff132eaf53e13afff77f38b5c11b73aa0/vendor/hayro-interpret/assets/FoxitDingbats.pfb | BSD-3-Clause | `845c752392b6c914fb989c75a08b7792b88f542d2499042ef2889f8c814a16ed` | Renders non-embedded standard-14 fonts (pinned hayro-interpret) |
-| `hayro-interpret 0.7.0 / assets/FoxitFixed.pfb` | Foxit Software Inc. / PDFium Authors | https://github.com/storytold/craft-libs/blob/92d392cff132eaf53e13afff77f38b5c11b73aa0/vendor/hayro-interpret/assets/FoxitFixed.pfb | BSD-3-Clause | `b6c8fe53f134b8b6d4578cd2d544df4cee9624c4efa8d51a560fb40ea296101b` | Renders non-embedded standard-14 fonts (pinned hayro-interpret) |
-| `hayro-interpret 0.7.0 / assets/FoxitFixedBold.pfb` | Foxit Software Inc. / PDFium Authors | https://github.com/storytold/craft-libs/blob/92d392cff132eaf53e13afff77f38b5c11b73aa0/vendor/hayro-interpret/assets/FoxitFixedBold.pfb | BSD-3-Clause | `f1b7159702973f54fc86254ea38bcf3712b2a736eb3a0995751e9f4bb45ad603` | Renders non-embedded standard-14 fonts (pinned hayro-interpret) |
-| `hayro-interpret 0.7.0 / assets/FoxitFixedBoldItalic.pfb` | Foxit Software Inc. / PDFium Authors | https://github.com/storytold/craft-libs/blob/92d392cff132eaf53e13afff77f38b5c11b73aa0/vendor/hayro-interpret/assets/FoxitFixedBoldItalic.pfb | BSD-3-Clause | `8a000945843bd31add06aee63bf9fd41b7578b4f3242a4b7cd46349ad9d24d4d` | Renders non-embedded standard-14 fonts (pinned hayro-interpret) |
-| `hayro-interpret 0.7.0 / assets/FoxitFixedItalic.pfb` | Foxit Software Inc. / PDFium Authors | https://github.com/storytold/craft-libs/blob/92d392cff132eaf53e13afff77f38b5c11b73aa0/vendor/hayro-interpret/assets/FoxitFixedItalic.pfb | BSD-3-Clause | `5007faf8320fa1fcc08b8894b356ad976f60b992ba29ee5272578bbdebaf3876` | Renders non-embedded standard-14 fonts (pinned hayro-interpret) |
-| `hayro-interpret 0.7.0 / assets/FoxitSans.pfb` | Foxit Software Inc. / PDFium Authors | https://github.com/storytold/craft-libs/blob/92d392cff132eaf53e13afff77f38b5c11b73aa0/vendor/hayro-interpret/assets/FoxitSans.pfb | BSD-3-Clause | `a02339e95d20db14cbdfc1c6baf359cd36a091d5434925c3a4040f60e1a1af9e` | Renders non-embedded standard-14 fonts (pinned hayro-interpret) |
-| `hayro-interpret 0.7.0 / assets/FoxitSansBold.pfb` | Foxit Software Inc. / PDFium Authors | https://github.com/storytold/craft-libs/blob/92d392cff132eaf53e13afff77f38b5c11b73aa0/vendor/hayro-interpret/assets/FoxitSansBold.pfb | BSD-3-Clause | `7bdfa36de1d5757dcfaf8b8a4be95c6e41c40fa70dbed9d78bf979a7b9959054` | Renders non-embedded standard-14 fonts (pinned hayro-interpret) |
-| `hayro-interpret 0.7.0 / assets/FoxitSansBoldItalic.pfb` | Foxit Software Inc. / PDFium Authors | https://github.com/storytold/craft-libs/blob/92d392cff132eaf53e13afff77f38b5c11b73aa0/vendor/hayro-interpret/assets/FoxitSansBoldItalic.pfb | BSD-3-Clause | `555ce45924338e2e4b32821910221ce85da691fd59a9723c4c971a7c5627fc8b` | Renders non-embedded standard-14 fonts (pinned hayro-interpret) |
-| `hayro-interpret 0.7.0 / assets/FoxitSansItalic.pfb` | Foxit Software Inc. / PDFium Authors | https://github.com/storytold/craft-libs/blob/92d392cff132eaf53e13afff77f38b5c11b73aa0/vendor/hayro-interpret/assets/FoxitSansItalic.pfb | BSD-3-Clause | `7751cbefeda351708dae8c4a88db043411bc39ab2ae2097685da845d4d16f307` | Renders non-embedded standard-14 fonts (pinned hayro-interpret) |
-| `hayro-interpret 0.7.0 / assets/FoxitSerif.pfb` | Foxit Software Inc. / PDFium Authors | https://github.com/storytold/craft-libs/blob/92d392cff132eaf53e13afff77f38b5c11b73aa0/vendor/hayro-interpret/assets/FoxitSerif.pfb | BSD-3-Clause | `4f57d2b9d884af8f907bf22df6019b52d86cbf6214fdbd02b1ae05472a543f35` | Renders non-embedded standard-14 fonts (pinned hayro-interpret) |
-| `hayro-interpret 0.7.0 / assets/FoxitSerifBold.pfb` | Foxit Software Inc. / PDFium Authors | https://github.com/storytold/craft-libs/blob/92d392cff132eaf53e13afff77f38b5c11b73aa0/vendor/hayro-interpret/assets/FoxitSerifBold.pfb | BSD-3-Clause | `0bdf4b04e964139818d51eda03d566ba999fc3ba2421b1c6c51f9dc969022e80` | Renders non-embedded standard-14 fonts (pinned hayro-interpret) |
-| `hayro-interpret 0.7.0 / assets/FoxitSerifBoldItalic.pfb` | Foxit Software Inc. / PDFium Authors | https://github.com/storytold/craft-libs/blob/92d392cff132eaf53e13afff77f38b5c11b73aa0/vendor/hayro-interpret/assets/FoxitSerifBoldItalic.pfb | BSD-3-Clause | `a406cac82583bf98175cb62c87ed5e95c45fbb34eece63a10b0a13e793cb2e10` | Renders non-embedded standard-14 fonts (pinned hayro-interpret) |
-| `hayro-interpret 0.7.0 / assets/FoxitSerifItalic.pfb` | Foxit Software Inc. / PDFium Authors | https://github.com/storytold/craft-libs/blob/92d392cff132eaf53e13afff77f38b5c11b73aa0/vendor/hayro-interpret/assets/FoxitSerifItalic.pfb | BSD-3-Clause | `610ae0687198045c4db5d1a6650fd5e92536631706382eb8b72e38df578d0ae9` | Renders non-embedded standard-14 fonts (pinned hayro-interpret) |
-| `hayro-interpret 0.7.0 / assets/FoxitSymbol.pfb` | Foxit Software Inc. / PDFium Authors | https://github.com/storytold/craft-libs/blob/92d392cff132eaf53e13afff77f38b5c11b73aa0/vendor/hayro-interpret/assets/FoxitSymbol.pfb | BSD-3-Clause | `47967d055530e7357088a08403115425643ec2cdfd6201ba8af0fbd7116c1539` | Renders non-embedded standard-14 fonts (pinned hayro-interpret) |
-| `hayro-interpret 0.7.0 / assets/CGATS001Compat-v2-micro.icc` | Clinton Ingram (saucecontrol/Compact-ICC-Profiles) | https://github.com/storytold/craft-libs/blob/92d392cff132eaf53e13afff77f38b5c11b73aa0/vendor/hayro-interpret/assets/CGATS001Compat-v2-micro.icc | CC0-1.0 | `73e1ba37d2bad5bab2a964f40a9eed96209666efc067c3322626214bbef234a0` | Default CMYK colour conversion (pinned hayro-interpret) |
-| `hayro-cmap 0.1.0 / assets/cmaps.brotli` | Adobe | https://github.com/storytold/craft-libs/blob/92d392cff132eaf53e13afff77f38b5c11b73aa0/vendor/hayro-cmap/assets/cmaps.brotli | BSD-3-Clause | `ddf37af521d904d5646c2fc37b2b7e912dc1b56f0d210190b61f598154758e46` | Character-code mapping tables required to read CJK PDFs. Non-visual dependency data; existing embedding unchanged |
-| `hayro-interpret 0.7.0 / src/font/generated/metrics.rs` | Adobe (Core 14 AFM metrics, PDF specification encodings); tables by The Hayro Authors | https://github.com/storytold/craft-libs/blob/92d392cff132eaf53e13afff77f38b5c11b73aa0/vendor/hayro-interpret/src/font/generated/metrics.rs | MIT OR Apache-2.0 | `2ec9e608573eda459de1e1d9bda3bb494315e36bee885acc88912a11fe0caa41` | Glyph widths and encodings for non-embedded standard fonts. Non-visual dependency data; existing embedding unchanged |
+| `hayro-interpret 0.7.0 / assets/FoxitDingbats.pfb` | Foxit Software Inc. / PDFium Authors | https://github.com/storytold/craft-libs/blob/9be9a63782298ab59cd9b7a42ee9cba4f42a5ccb/vendor/hayro-interpret/assets/FoxitDingbats.pfb | BSD-3-Clause | `845c752392b6c914fb989c75a08b7792b88f542d2499042ef2889f8c814a16ed` | Renders non-embedded standard-14 fonts (pinned hayro-interpret) |
+| `hayro-interpret 0.7.0 / assets/FoxitFixed.pfb` | Foxit Software Inc. / PDFium Authors | https://github.com/storytold/craft-libs/blob/9be9a63782298ab59cd9b7a42ee9cba4f42a5ccb/vendor/hayro-interpret/assets/FoxitFixed.pfb | BSD-3-Clause | `b6c8fe53f134b8b6d4578cd2d544df4cee9624c4efa8d51a560fb40ea296101b` | Renders non-embedded standard-14 fonts (pinned hayro-interpret) |
+| `hayro-interpret 0.7.0 / assets/FoxitFixedBold.pfb` | Foxit Software Inc. / PDFium Authors | https://github.com/storytold/craft-libs/blob/9be9a63782298ab59cd9b7a42ee9cba4f42a5ccb/vendor/hayro-interpret/assets/FoxitFixedBold.pfb | BSD-3-Clause | `f1b7159702973f54fc86254ea38bcf3712b2a736eb3a0995751e9f4bb45ad603` | Renders non-embedded standard-14 fonts (pinned hayro-interpret) |
+| `hayro-interpret 0.7.0 / assets/FoxitFixedBoldItalic.pfb` | Foxit Software Inc. / PDFium Authors | https://github.com/storytold/craft-libs/blob/9be9a63782298ab59cd9b7a42ee9cba4f42a5ccb/vendor/hayro-interpret/assets/FoxitFixedBoldItalic.pfb | BSD-3-Clause | `8a000945843bd31add06aee63bf9fd41b7578b4f3242a4b7cd46349ad9d24d4d` | Renders non-embedded standard-14 fonts (pinned hayro-interpret) |
+| `hayro-interpret 0.7.0 / assets/FoxitFixedItalic.pfb` | Foxit Software Inc. / PDFium Authors | https://github.com/storytold/craft-libs/blob/9be9a63782298ab59cd9b7a42ee9cba4f42a5ccb/vendor/hayro-interpret/assets/FoxitFixedItalic.pfb | BSD-3-Clause | `5007faf8320fa1fcc08b8894b356ad976f60b992ba29ee5272578bbdebaf3876` | Renders non-embedded standard-14 fonts (pinned hayro-interpret) |
+| `hayro-interpret 0.7.0 / assets/FoxitSans.pfb` | Foxit Software Inc. / PDFium Authors | https://github.com/storytold/craft-libs/blob/9be9a63782298ab59cd9b7a42ee9cba4f42a5ccb/vendor/hayro-interpret/assets/FoxitSans.pfb | BSD-3-Clause | `a02339e95d20db14cbdfc1c6baf359cd36a091d5434925c3a4040f60e1a1af9e` | Renders non-embedded standard-14 fonts (pinned hayro-interpret) |
+| `hayro-interpret 0.7.0 / assets/FoxitSansBold.pfb` | Foxit Software Inc. / PDFium Authors | https://github.com/storytold/craft-libs/blob/9be9a63782298ab59cd9b7a42ee9cba4f42a5ccb/vendor/hayro-interpret/assets/FoxitSansBold.pfb | BSD-3-Clause | `7bdfa36de1d5757dcfaf8b8a4be95c6e41c40fa70dbed9d78bf979a7b9959054` | Renders non-embedded standard-14 fonts (pinned hayro-interpret) |
+| `hayro-interpret 0.7.0 / assets/FoxitSansBoldItalic.pfb` | Foxit Software Inc. / PDFium Authors | https://github.com/storytold/craft-libs/blob/9be9a63782298ab59cd9b7a42ee9cba4f42a5ccb/vendor/hayro-interpret/assets/FoxitSansBoldItalic.pfb | BSD-3-Clause | `555ce45924338e2e4b32821910221ce85da691fd59a9723c4c971a7c5627fc8b` | Renders non-embedded standard-14 fonts (pinned hayro-interpret) |
+| `hayro-interpret 0.7.0 / assets/FoxitSansItalic.pfb` | Foxit Software Inc. / PDFium Authors | https://github.com/storytold/craft-libs/blob/9be9a63782298ab59cd9b7a42ee9cba4f42a5ccb/vendor/hayro-interpret/assets/FoxitSansItalic.pfb | BSD-3-Clause | `7751cbefeda351708dae8c4a88db043411bc39ab2ae2097685da845d4d16f307` | Renders non-embedded standard-14 fonts (pinned hayro-interpret) |
+| `hayro-interpret 0.7.0 / assets/FoxitSerif.pfb` | Foxit Software Inc. / PDFium Authors | https://github.com/storytold/craft-libs/blob/9be9a63782298ab59cd9b7a42ee9cba4f42a5ccb/vendor/hayro-interpret/assets/FoxitSerif.pfb | BSD-3-Clause | `4f57d2b9d884af8f907bf22df6019b52d86cbf6214fdbd02b1ae05472a543f35` | Renders non-embedded standard-14 fonts (pinned hayro-interpret) |
+| `hayro-interpret 0.7.0 / assets/FoxitSerifBold.pfb` | Foxit Software Inc. / PDFium Authors | https://github.com/storytold/craft-libs/blob/9be9a63782298ab59cd9b7a42ee9cba4f42a5ccb/vendor/hayro-interpret/assets/FoxitSerifBold.pfb | BSD-3-Clause | `0bdf4b04e964139818d51eda03d566ba999fc3ba2421b1c6c51f9dc969022e80` | Renders non-embedded standard-14 fonts (pinned hayro-interpret) |
+| `hayro-interpret 0.7.0 / assets/FoxitSerifBoldItalic.pfb` | Foxit Software Inc. / PDFium Authors | https://github.com/storytold/craft-libs/blob/9be9a63782298ab59cd9b7a42ee9cba4f42a5ccb/vendor/hayro-interpret/assets/FoxitSerifBoldItalic.pfb | BSD-3-Clause | `a406cac82583bf98175cb62c87ed5e95c45fbb34eece63a10b0a13e793cb2e10` | Renders non-embedded standard-14 fonts (pinned hayro-interpret) |
+| `hayro-interpret 0.7.0 / assets/FoxitSerifItalic.pfb` | Foxit Software Inc. / PDFium Authors | https://github.com/storytold/craft-libs/blob/9be9a63782298ab59cd9b7a42ee9cba4f42a5ccb/vendor/hayro-interpret/assets/FoxitSerifItalic.pfb | BSD-3-Clause | `610ae0687198045c4db5d1a6650fd5e92536631706382eb8b72e38df578d0ae9` | Renders non-embedded standard-14 fonts (pinned hayro-interpret) |
+| `hayro-interpret 0.7.0 / assets/FoxitSymbol.pfb` | Foxit Software Inc. / PDFium Authors | https://github.com/storytold/craft-libs/blob/9be9a63782298ab59cd9b7a42ee9cba4f42a5ccb/vendor/hayro-interpret/assets/FoxitSymbol.pfb | BSD-3-Clause | `47967d055530e7357088a08403115425643ec2cdfd6201ba8af0fbd7116c1539` | Renders non-embedded standard-14 fonts (pinned hayro-interpret) |
+| `hayro-interpret 0.7.0 / assets/CGATS001Compat-v2-micro.icc` | Clinton Ingram (saucecontrol/Compact-ICC-Profiles) | https://github.com/storytold/craft-libs/blob/9be9a63782298ab59cd9b7a42ee9cba4f42a5ccb/vendor/hayro-interpret/assets/CGATS001Compat-v2-micro.icc | CC0-1.0 | `73e1ba37d2bad5bab2a964f40a9eed96209666efc067c3322626214bbef234a0` | Default CMYK colour conversion (pinned hayro-interpret) |
+| `hayro-cmap 0.1.0 / assets/cmaps.brotli` | Adobe | https://github.com/storytold/craft-libs/blob/9be9a63782298ab59cd9b7a42ee9cba4f42a5ccb/vendor/hayro-cmap/assets/cmaps.brotli | BSD-3-Clause | `ddf37af521d904d5646c2fc37b2b7e912dc1b56f0d210190b61f598154758e46` | Character-code mapping tables required to read CJK PDFs. Non-visual dependency data; existing embedding unchanged |
+| `hayro-interpret 0.7.0 / src/font/generated/metrics.rs` | Adobe (Core 14 AFM metrics, PDF specification encodings); tables by The Hayro Authors | https://github.com/storytold/craft-libs/blob/9be9a63782298ab59cd9b7a42ee9cba4f42a5ccb/vendor/hayro-interpret/src/font/generated/metrics.rs | MIT OR Apache-2.0 | `2ec9e608573eda459de1e1d9bda3bb494315e36bee885acc88912a11fe0caa41` | Glyph widths and encodings for non-embedded standard fonts. Non-visual dependency data; existing embedding unchanged |
diff --git a/Cargo.lock b/Cargo.lock
index 248679aaca..ae8a3ee6c7 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -970,17 +970,17 @@ dependencies = [
[[package]]
name = "craft-docpath"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=92d392cff132eaf53e13afff77f38b5c11b73aa0#92d392cff132eaf53e13afff77f38b5c11b73aa0"
+source = "git+https://github.com/storytold/craft-libs?rev=9be9a63782298ab59cd9b7a42ee9cba4f42a5ccb#9be9a63782298ab59cd9b7a42ee9cba4f42a5ccb"
[[package]]
name = "craft-fonts-build"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=92d392cff132eaf53e13afff77f38b5c11b73aa0#92d392cff132eaf53e13afff77f38b5c11b73aa0"
+source = "git+https://github.com/storytold/craft-libs?rev=9be9a63782298ab59cd9b7a42ee9cba4f42a5ccb#9be9a63782298ab59cd9b7a42ee9cba4f42a5ccb"
[[package]]
name = "craft-i18n"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=92d392cff132eaf53e13afff77f38b5c11b73aa0#92d392cff132eaf53e13afff77f38b5c11b73aa0"
+source = "git+https://github.com/storytold/craft-libs?rev=9be9a63782298ab59cd9b7a42ee9cba4f42a5ccb#9be9a63782298ab59cd9b7a42ee9cba4f42a5ccb"
dependencies = [
"fixed_decimal",
"icu_decimal",
@@ -1003,7 +1003,7 @@ dependencies = [
[[package]]
name = "craft-keymap"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=92d392cff132eaf53e13afff77f38b5c11b73aa0#92d392cff132eaf53e13afff77f38b5c11b73aa0"
+source = "git+https://github.com/storytold/craft-libs?rev=9be9a63782298ab59cd9b7a42ee9cba4f42a5ccb#9be9a63782298ab59cd9b7a42ee9cba4f42a5ccb"
dependencies = [
"egui",
"serde",
@@ -1013,7 +1013,7 @@ dependencies = [
[[package]]
name = "craft-pdf"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=92d392cff132eaf53e13afff77f38b5c11b73aa0#92d392cff132eaf53e13afff77f38b5c11b73aa0"
+source = "git+https://github.com/storytold/craft-libs?rev=9be9a63782298ab59cd9b7a42ee9cba4f42a5ccb#9be9a63782298ab59cd9b7a42ee9cba4f42a5ccb"
dependencies = [
"hayro-interpret",
"hayro-syntax",
@@ -1024,9 +1024,10 @@ dependencies = [
[[package]]
name = "craft-print"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=92d392cff132eaf53e13afff77f38b5c11b73aa0#92d392cff132eaf53e13afff77f38b5c11b73aa0"
+source = "git+https://github.com/storytold/craft-libs?rev=9be9a63782298ab59cd9b7a42ee9cba4f42a5ccb#9be9a63782298ab59cd9b7a42ee9cba4f42a5ccb"
dependencies = [
"craft-winprint-gdi",
+ "log",
"miniz_oxide 0.9.1",
"roxmltree 0.21.2",
"tempfile",
@@ -1037,7 +1038,7 @@ dependencies = [
[[package]]
name = "craft-ui"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=92d392cff132eaf53e13afff77f38b5c11b73aa0#92d392cff132eaf53e13afff77f38b5c11b73aa0"
+source = "git+https://github.com/storytold/craft-libs?rev=9be9a63782298ab59cd9b7a42ee9cba4f42a5ccb#9be9a63782298ab59cd9b7a42ee9cba4f42a5ccb"
dependencies = [
"craft-fonts-build",
"craft-i18n",
@@ -1081,10 +1082,21 @@ dependencies = [
"zip",
]
+[[package]]
+name = "craft-vectorcraft-format"
+version = "0.1.0"
+source = "git+https://github.com/storytold/craft-libs?rev=9be9a63782298ab59cd9b7a42ee9cba4f42a5ccb#9be9a63782298ab59cd9b7a42ee9cba4f42a5ccb"
+dependencies = [
+ "flate2",
+ "serde",
+ "serde_json",
+ "thiserror 2.0.21",
+]
+
[[package]]
name = "craft-window"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=92d392cff132eaf53e13afff77f38b5c11b73aa0#92d392cff132eaf53e13afff77f38b5c11b73aa0"
+source = "git+https://github.com/storytold/craft-libs?rev=9be9a63782298ab59cd9b7a42ee9cba4f42a5ccb#9be9a63782298ab59cd9b7a42ee9cba4f42a5ccb"
dependencies = [
"egui",
"objc2 0.6.5",
@@ -2194,7 +2206,7 @@ checksum = "9f4d0e94ddd48749f06bbe4e5389fb9799a0c45bcaf00495042076ef05e3241a"
[[package]]
name = "hayro-cmap"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=92d392cff132eaf53e13afff77f38b5c11b73aa0#92d392cff132eaf53e13afff77f38b5c11b73aa0"
+source = "git+https://github.com/storytold/craft-libs?rev=9be9a63782298ab59cd9b7a42ee9cba4f42a5ccb#9be9a63782298ab59cd9b7a42ee9cba4f42a5ccb"
dependencies = [
"brotli",
"hayro-postscript",
@@ -2203,7 +2215,7 @@ dependencies = [
[[package]]
name = "hayro-interpret"
version = "0.7.0"
-source = "git+https://github.com/storytold/craft-libs?rev=92d392cff132eaf53e13afff77f38b5c11b73aa0#92d392cff132eaf53e13afff77f38b5c11b73aa0"
+source = "git+https://github.com/storytold/craft-libs?rev=9be9a63782298ab59cd9b7a42ee9cba4f42a5ccb#9be9a63782298ab59cd9b7a42ee9cba4f42a5ccb"
dependencies = [
"bitflags 2.13.2",
"hayro-cmap",
@@ -2221,7 +2233,7 @@ dependencies = [
[[package]]
name = "hayro-jbig2"
version = "0.3.0"
-source = "git+https://github.com/storytold/craft-libs?rev=92d392cff132eaf53e13afff77f38b5c11b73aa0#92d392cff132eaf53e13afff77f38b5c11b73aa0"
+source = "git+https://github.com/storytold/craft-libs?rev=9be9a63782298ab59cd9b7a42ee9cba4f42a5ccb#9be9a63782298ab59cd9b7a42ee9cba4f42a5ccb"
dependencies = [
"fearless_simd",
"hayro-ccitt",
@@ -2239,12 +2251,12 @@ dependencies = [
[[package]]
name = "hayro-postscript"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=92d392cff132eaf53e13afff77f38b5c11b73aa0#92d392cff132eaf53e13afff77f38b5c11b73aa0"
+source = "git+https://github.com/storytold/craft-libs?rev=9be9a63782298ab59cd9b7a42ee9cba4f42a5ccb#9be9a63782298ab59cd9b7a42ee9cba4f42a5ccb"
[[package]]
name = "hayro-syntax"
version = "0.7.2"
-source = "git+https://github.com/storytold/craft-libs?rev=92d392cff132eaf53e13afff77f38b5c11b73aa0#92d392cff132eaf53e13afff77f38b5c11b73aa0"
+source = "git+https://github.com/storytold/craft-libs?rev=9be9a63782298ab59cd9b7a42ee9cba4f42a5ccb#9be9a63782298ab59cd9b7a42ee9cba4f42a5ccb"
dependencies = [
"flate2",
"hayro-ccitt",
@@ -2852,7 +2864,7 @@ dependencies = [
[[package]]
name = "krilla"
version = "0.8.2"
-source = "git+https://github.com/storytold/craft-libs?rev=92d392cff132eaf53e13afff77f38b5c11b73aa0#92d392cff132eaf53e13afff77f38b5c11b73aa0"
+source = "git+https://github.com/storytold/craft-libs?rev=9be9a63782298ab59cd9b7a42ee9cba4f42a5ccb#9be9a63782298ab59cd9b7a42ee9cba4f42a5ccb"
dependencies = [
"base64 0.22.1",
"bumpalo",
@@ -6061,7 +6073,7 @@ dependencies = [
[[package]]
name = "vectorcraft"
-version = "0.19.0"
+version = "0.21.0"
dependencies = [
"arboard",
"block2 0.6.2",
@@ -6106,7 +6118,7 @@ dependencies = [
[[package]]
name = "vectorcraft-affinity"
-version = "0.19.0"
+version = "0.21.0"
dependencies = [
"crc32fast",
"flate2",
@@ -6117,7 +6129,7 @@ dependencies = [
[[package]]
name = "vectorcraft-brush"
-version = "0.19.0"
+version = "0.21.0"
dependencies = [
"kurbo 0.13.1",
"serde",
@@ -6129,7 +6141,7 @@ dependencies = [
[[package]]
name = "vectorcraft-cad"
-version = "0.19.0"
+version = "0.21.0"
dependencies = [
"image",
"kurbo 0.13.1",
@@ -6145,7 +6157,7 @@ dependencies = [
[[package]]
name = "vectorcraft-cli"
-version = "0.19.0"
+version = "0.21.0"
dependencies = [
"log",
"objc2-core-foundation",
@@ -6167,7 +6179,7 @@ dependencies = [
[[package]]
name = "vectorcraft-color"
-version = "0.19.0"
+version = "0.21.0"
dependencies = [
"kurbo 0.13.1",
"moxcms",
@@ -6179,7 +6191,7 @@ dependencies = [
[[package]]
name = "vectorcraft-doc"
-version = "0.19.0"
+version = "0.21.0"
dependencies = [
"chrono",
"hayro-ccitt",
@@ -6198,7 +6210,7 @@ dependencies = [
[[package]]
name = "vectorcraft-effects"
-version = "0.19.0"
+version = "0.21.0"
dependencies = [
"image",
"kurbo 0.13.1",
@@ -6214,9 +6226,10 @@ dependencies = [
[[package]]
name = "vectorcraft-engine"
-version = "0.19.0"
+version = "0.21.0"
dependencies = [
"cfb",
+ "chrono",
"craft-docpath",
"crc32fast",
"flate2",
@@ -6255,7 +6268,7 @@ dependencies = [
[[package]]
name = "vectorcraft-eps"
-version = "0.19.0"
+version = "0.21.0"
dependencies = [
"fax",
"flate2",
@@ -6271,6 +6284,7 @@ dependencies = [
"vectorcraft-effects",
"vectorcraft-geom",
"vectorcraft-metafile",
+ "vectorcraft-pathops",
"vectorcraft-pdf",
"vectorcraft-render",
"vectorcraft-testkit",
@@ -6279,8 +6293,9 @@ dependencies = [
[[package]]
name = "vectorcraft-format"
-version = "0.19.0"
+version = "0.21.0"
dependencies = [
+ "craft-vectorcraft-format",
"flate2",
"proptest",
"rustix 1.1.6",
@@ -6294,7 +6309,7 @@ dependencies = [
[[package]]
name = "vectorcraft-geom"
-version = "0.19.0"
+version = "0.21.0"
dependencies = [
"kurbo 0.13.1",
"proptest",
@@ -6306,7 +6321,7 @@ dependencies = [
[[package]]
name = "vectorcraft-mcp"
-version = "0.19.0"
+version = "0.21.0"
dependencies = [
"image",
"log",
@@ -6325,7 +6340,7 @@ dependencies = [
[[package]]
name = "vectorcraft-metafile"
-version = "0.19.0"
+version = "0.21.0"
dependencies = [
"image",
"kurbo 0.13.1",
@@ -6339,7 +6354,7 @@ dependencies = [
[[package]]
name = "vectorcraft-pathops"
-version = "0.19.0"
+version = "0.21.0"
dependencies = [
"kurbo 0.13.1",
"linesweeper",
@@ -6351,7 +6366,7 @@ dependencies = [
[[package]]
name = "vectorcraft-pdf"
-version = "0.19.0"
+version = "0.21.0"
dependencies = [
"aes",
"chrono",
@@ -6383,7 +6398,7 @@ dependencies = [
[[package]]
name = "vectorcraft-plugins"
-version = "0.19.0"
+version = "0.21.0"
dependencies = [
"serde",
"serde_json",
@@ -6397,7 +6412,7 @@ dependencies = [
[[package]]
name = "vectorcraft-render"
-version = "0.19.0"
+version = "0.21.0"
dependencies = [
"flate2",
"gif 0.14.2",
@@ -6427,14 +6442,14 @@ dependencies = [
[[package]]
name = "vectorcraft-scriptcheck"
-version = "0.19.0"
+version = "0.21.0"
dependencies = [
"proptest",
]
[[package]]
name = "vectorcraft-svg"
-version = "0.19.0"
+version = "0.21.0"
dependencies = [
"craft-docpath",
"flate2",
@@ -6444,6 +6459,7 @@ dependencies = [
"resvg",
"serde",
"serde_json",
+ "simplecss",
"skrifa 0.47.0",
"svgtypes 0.16.1",
"thiserror 2.0.21",
@@ -6459,7 +6475,7 @@ dependencies = [
[[package]]
name = "vectorcraft-testkit"
-version = "0.19.0"
+version = "0.21.0"
dependencies = [
"fax",
"image",
@@ -6477,7 +6493,7 @@ dependencies = [
[[package]]
name = "vectorcraft-text"
-version = "0.19.0"
+version = "0.21.0"
dependencies = [
"harfrust 0.13.3",
"icu_segmenter",
@@ -6498,7 +6514,7 @@ dependencies = [
[[package]]
name = "vectorcraft-three-d"
-version = "0.19.0"
+version = "0.21.0"
dependencies = [
"vectorcraft-geom",
"vectorcraft-pathops",
@@ -6506,7 +6522,7 @@ dependencies = [
[[package]]
name = "vectorcraft-tools"
-version = "0.19.0"
+version = "0.21.0"
dependencies = [
"image",
"kurbo 0.13.1",
@@ -6523,7 +6539,7 @@ dependencies = [
[[package]]
name = "vectorcraft-trace"
-version = "0.19.0"
+version = "0.21.0"
dependencies = [
"image",
"kurbo 0.13.1",
@@ -6535,7 +6551,7 @@ dependencies = [
[[package]]
name = "vectorcraft-ui-egui"
-version = "0.19.0"
+version = "0.21.0"
dependencies = [
"bytemuck",
"craft-keymap",
@@ -6573,7 +6589,7 @@ dependencies = [
[[package]]
name = "vectorcraft-web"
-version = "0.19.0"
+version = "0.21.0"
dependencies = [
"eframe",
"egui",
@@ -6740,12 +6756,12 @@ dependencies = [
[[package]]
name = "wasm-encoder"
-version = "0.262.0"
+version = "0.263.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4495a6f85dd94c411c749303efcbc5defade0b0cbdbc0541495241ab917a9b5a"
+checksum = "0b883a26aea02eaabe2d2c3fba7eb039ef5cdcb5d5201ae5551e73d5e251a81f"
dependencies = [
"leb128fmt",
- "wasmparser 0.262.0",
+ "wasmparser 0.263.0",
]
[[package]]
@@ -6800,9 +6816,9 @@ dependencies = [
[[package]]
name = "wasmparser"
-version = "0.262.0"
+version = "0.263.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "974d643b125b272607e2fff8012ea14a8328acd7621e4bafa7afb32500052b1b"
+checksum = "4f5fa0a054ae153606df820eb0a84213e28cda41bbe04ba2628e71b6ba100fcb"
dependencies = [
"bitflags 2.13.2",
"indexmap",
@@ -6811,9 +6827,9 @@ dependencies = [
[[package]]
name = "wast"
-version = "262.0.0"
+version = "263.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "30612a0c29249b5f185888a107e8a519d920226b7d07f9d351fd094e9f75eb23"
+checksum = "69d90bcf581b501aa1c358bc5dc0faa979cd375796908860ebcb6d1d70b907c7"
dependencies = [
"bumpalo",
"leb128fmt",
@@ -6824,9 +6840,9 @@ dependencies = [
[[package]]
name = "wat"
-version = "1.262.0"
+version = "1.263.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e228027f2b07bbaf946980ebbe2437fca73be6f54c40c2a8d4f42f277075f8d1"
+checksum = "bbc9c5aca783b3f1838be89f3f9937c528b90ec5faa6fb62d809726c16a7d8f7"
dependencies = [
"wast",
]
@@ -7704,7 +7720,7 @@ checksum = "9440ea3e5aeabb0ac63af70daf835274065238cdd0cec83418f417eae38bacee"
[[package]]
name = "xtask"
-version = "0.19.0"
+version = "0.21.0"
dependencies = [
"serde_json",
]
diff --git a/Cargo.toml b/Cargo.toml
index b5b4312eae..924a1a68dc 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -4,21 +4,23 @@ members = ["crates/*", "apps/*", "xtask"]
default-members = ["crates/*", "apps/vectorcraft", "apps/vectorcraft-cli", "xtask"]
[workspace.package]
-version = "0.19.0"
+version = "0.21.0"
edition = "2024"
license = "MIT OR Apache-2.0"
rust-version = "1.95"
repository = "https://github.com/storytold/vectorcraft"
[workspace.dependencies]
-craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "92d392cff132eaf53e13afff77f38b5c11b73aa0", default-features = false, features = ["interpret", "write"] }
-craft-print = { git = "https://github.com/storytold/craft-libs", rev = "92d392cff132eaf53e13afff77f38b5c11b73aa0" }
-craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "92d392cff132eaf53e13afff77f38b5c11b73aa0" }
-craft-ui = { git = "https://github.com/storytold/craft-libs", rev = "92d392cff132eaf53e13afff77f38b5c11b73aa0", features = ["serde"] }
-craft-keymap = { git = "https://github.com/storytold/craft-libs", rev = "92d392cff132eaf53e13afff77f38b5c11b73aa0" }
+craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "9be9a63782298ab59cd9b7a42ee9cba4f42a5ccb", default-features = false, features = ["interpret", "write"] }
+craft-print = { git = "https://github.com/storytold/craft-libs", rev = "9be9a63782298ab59cd9b7a42ee9cba4f42a5ccb" }
+craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "9be9a63782298ab59cd9b7a42ee9cba4f42a5ccb" }
+craft-ui = { git = "https://github.com/storytold/craft-libs", rev = "9be9a63782298ab59cd9b7a42ee9cba4f42a5ccb", features = ["serde"] }
+craft-keymap = { git = "https://github.com/storytold/craft-libs", rev = "9be9a63782298ab59cd9b7a42ee9cba4f42a5ccb" }
# Decides who draws the window frame (desktop vs. app) so the suite shares one native titlebar per
# desktop. The `egui` feature adds `craft_window::decorate`. (craft-libs#217.)
-craft-window = { git = "https://github.com/storytold/craft-libs", rev = "92d392cff132eaf53e13afff77f38b5c11b73aa0", features = ["egui"] }
+craft-window = { git = "https://github.com/storytold/craft-libs", rev = "9be9a63782298ab59cd9b7a42ee9cba4f42a5ccb", features = ["egui"] }
+# The `.vectorcraft` envelope: its members, version, embedded images and the data after the JSON.
+craft-vectorcraft-format = { git = "https://github.com/storytold/craft-libs", rev = "9be9a63782298ab59cd9b7a42ee9cba4f42a5ccb" }
# 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 = "c5a1cbfb5f9049f9270955caffb5bee5997aebf7", features = ["egui"] }
# internal
@@ -145,12 +147,12 @@ lto = "thin"
codegen-units = 1
[patch.crates-io]
-hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "92d392cff132eaf53e13afff77f38b5c11b73aa0" }
-hayro-interpret = { git = "https://github.com/storytold/craft-libs", rev = "92d392cff132eaf53e13afff77f38b5c11b73aa0" }
-hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "92d392cff132eaf53e13afff77f38b5c11b73aa0" }
-hayro-cmap = { git = "https://github.com/storytold/craft-libs", rev = "92d392cff132eaf53e13afff77f38b5c11b73aa0" }
-hayro-postscript = { git = "https://github.com/storytold/craft-libs", rev = "92d392cff132eaf53e13afff77f38b5c11b73aa0" }
-krilla = { git = "https://github.com/storytold/craft-libs", rev = "92d392cff132eaf53e13afff77f38b5c11b73aa0" }
+hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "9be9a63782298ab59cd9b7a42ee9cba4f42a5ccb" }
+hayro-interpret = { git = "https://github.com/storytold/craft-libs", rev = "9be9a63782298ab59cd9b7a42ee9cba4f42a5ccb" }
+hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "9be9a63782298ab59cd9b7a42ee9cba4f42a5ccb" }
+hayro-cmap = { git = "https://github.com/storytold/craft-libs", rev = "9be9a63782298ab59cd9b7a42ee9cba4f42a5ccb" }
+hayro-postscript = { git = "https://github.com/storytold/craft-libs", rev = "9be9a63782298ab59cd9b7a42ee9cba4f42a5ccb" }
+krilla = { git = "https://github.com/storytold/craft-libs", rev = "9be9a63782298ab59cd9b7a42ee9cba4f42a5ccb" }
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" }
diff --git a/NOTICE b/NOTICE
index 0d0758820e..4bf18085bd 100644
--- a/NOTICE
+++ b/NOTICE
@@ -72,10 +72,10 @@ Shared PDF backend
The patched hayro-interpret 0.7.0, hayro-syntax 0.7.2, hayro-jbig2 0.3.0, hayro-cmap 0.1.0
and hayro-postscript 0.1.0 are fetched from https://github.com/storytold/craft-libs at revision
-92d392cff132eaf53e13afff77f38b5c11b73aa0. Their upstream project is
+9be9a63782298ab59cd9b7a42ee9cba4f42a5ccb. Their upstream project is
https://github.com/LaurenzV/hayro, licensed MIT OR Apache-2.0. The snapshot retains each
crate's upstream licence files. The patch ledger is at
-https://github.com/storytold/craft-libs/blob/92d392cff132eaf53e13afff77f38b5c11b73aa0/vendor/README.craft-reader.md.
+https://github.com/storytold/craft-libs/blob/9be9a63782298ab59cd9b7a42ee9cba4f42a5ccb/vendor/README.craft-reader.md.
Assets already bundled through Hayro's default features retain their licences:
- Foxit standard-14 substitutes: Copyright 2014 PDFium Authors. All rights reserved.
diff --git a/README.md b/README.md
index 0b7b9932bb..8a3c453c5c 100644
--- a/README.md
+++ b/README.md
@@ -328,12 +328,21 @@ stand on its own.
| | App | What it's for | Code | Learn more |
|:-:|---|---|---|---|
| | **PhotoCraft** | Image editing: layers, masks, type and real PSD files | [GitHub](https://github.com/storytold/photocraft) | [Website](https://getartcraft.com/apps/photocraft) |
-| | **VectorCraft** | **Vector illustration · you are here** | [GitHub](https://github.com/storytold/vectorcraft) | [Website](https://getartcraft.com/apps/vectorcraft) |
+| | **VectorCraft** | Vector illustration | [GitHub](https://github.com/storytold/vectorcraft) | [Website](https://getartcraft.com/apps/vectorcraft) |
| | **FilmCraft** | Video editing, color and sound | [GitHub](https://github.com/storytold/filmcraft) | [Website](https://getartcraft.com/apps/filmcraft) |
| | **LightCraft** | Photo library and raw development | [GitHub](https://github.com/storytold/lightcraft) | [Website](https://getartcraft.com/apps/lightcraft) |
| | **PdfCraft** | Reading, organizing and protecting PDFs | [GitHub](https://github.com/storytold/pdfcraft) | [Website](https://getartcraft.com/apps/pdfcraft) |
| | **EffectCraft** | Motion graphics and visual effects | [GitHub](https://github.com/storytold/effectcraft) | [Website](https://getartcraft.com/apps/effectcraft) |
| | **DesignCraft** | Page layout and publishing | [GitHub](https://github.com/storytold/designcraft) | [Website](https://getartcraft.com/apps/designcraft) |
+| | **FigCraft** | Interface design and prototyping | [GitHub](https://github.com/storytold/figcraft) | [Website](https://getartcraft.com/apps/figcraft) |
+| | **WordCraft** | Word processing and documents | [GitHub](https://github.com/storytold/wordcraft) | [Website](https://getartcraft.com/apps/wordcraft) |
+| | **SoundCraft** | Audio recording and editing | [GitHub](https://github.com/storytold/soundcraft) | [Website](https://getartcraft.com/apps/soundcraft) |
+| | **DeckCraft** | Presentations and slide decks | [GitHub](https://github.com/storytold/deckcraft) | [Website](https://getartcraft.com/apps/deckcraft) |
+| | **CADCraft** | Computer-aided design | [GitHub](https://github.com/storytold/cadcraft) | [Website](https://getartcraft.com/apps/cadcraft) |
+| | **GridCraft** | Spreadsheets and data | [GitHub](https://github.com/storytold/gridcraft) | [Website](https://getartcraft.com/apps/gridcraft) |
+| | **TextureCraft** | 3D texture painting | [GitHub](https://github.com/storytold/texturecraft) | [Website](https://getartcraft.com/apps/texturecraft) |
+| | **Craft Anything** | See how any software works, then build your own | [GitHub](https://github.com/storytold/craft-anything) | [Website](https://getartcraft.com/apps/craft-anything) |
+| | **SolidCraft** | Parametric 3D CAD by Tangency Labs (community app) | [GitHub](https://github.com/tangency-labs/solidcraft) | |
And [**ArtCraft**](https://getartcraft.com/) itself, our AI image and video studio for artists who want real control.
diff --git a/ROADMAP.md b/ROADMAP.md
index 4d5918cba5..16bd8b1dab 100644
--- a/ROADMAP.md
+++ b/ROADMAP.md
@@ -1,5 +1,7 @@
# VectorCraft Roadmap
+- Paint: new gradients use the document's color model for default stops, including Gradient tool creation. Scores and estimates unchanged.
+
- PDF.R1: editable PDF import uses the shared reader, scans page content in windows, and rejects known incomplete input before returning a document.
- PDF.W1: PDF export and print composition use the shared optional writer for configuration, metadata, font preparation and guarded finalization; drawing and output policy remain app-owned.
@@ -9,7 +11,7 @@
**Stage: alpha** · next: beta, ~13 points (ready for real work ~62% → ~75%, and reliable `.ai` exchange) and ~170–270 h away
-> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-01 · **Change:** minor (Progress log row for the Color Effects add-on's Find Nearest Swatch; headline numbers unchanged) · **Target:** Adobe Illustrator 2026 (30.x)
+> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-03 · **Change:** minor (new gradients follow document color mode; scores and estimates unchanged) · **Target:** Adobe Illustrator 2026 (30.x)
VectorCraft is a clean-room, open-source, pure-Rust reimplementation of the Adobe Illustrator workflow. It runs
on macOS, Windows, Linux, FreeBSD and the web (WASM), and agents can drive all of it over MCP, the CLI and a JSON
@@ -129,6 +131,9 @@ Ranked; detail in [docs/roadmap.md](docs/roadmap.md) and [docs/gaps.md](docs/gap
## Progress log
+- 2026-11-04: New Document: the units chosen in Preset Details now belong to the chosen document, as the pane's options are listed for the selected preset; the chosen card shows them, every other Recent and Saved card keeps the units its document or preset was made in, and the built-in tabs still follow the chosen units, so switching between inches and millimetres no longer restyles every recent template. Scores and estimates unchanged.
+- 2026-11-02: Mouse wheel over a closed font-family field in Character, Properties or Control changes selected text through the family list using saved font filters (excluding search text), one undo step per notch, stopping at the ends (#5253). Scores and estimates unchanged.
+- 2026-10-31: Pattern libraries: Window › Swatch Libraries › Patterns and the Swatches panel's library menu open Geometric Patterns, a built-in library of eleven pattern swatches (dots, stripes, checks, a grid and shapes); clicking one adds its pattern and swatch to the document, once, and applies it to the active fill or stroke (`swatch.library.add`).
- 2026-11-01: Find Nearest Swatch joins the Color Effects add-on (Object › Plug-ins › Color Effects): for each colour of the selection, the closest swatches of the document, a built-in library or a library or colour book the user loaded, with their CIEDE2000 difference; Apply gives each colour its nearest swatch as one undo step, linking global and spot swatches and adding a library's to the document first, so a process colour becomes the closest spot colour (`addon.color.nearestSwatch`, `addon.color.applyNearestSwatch`, #4923).
- 2026-11-01: Expand Dashes into Paths joins the Path Precision Tools add-on (Object › Plug-ins › Path Precision Tools): each selected path's dashed stroke becomes separate open paths, one per dash, laid out exactly as the stroke draws them (pattern, offset, Align Dashes to Corners and Path Ends), each keeping the stroke with the dashes off, so the gaps are real gaps for cutters and plotters, as one undo step (`addon.pathtools.expandDashes`, #4922).
- 2026-11-01: Randomize Opacity joins the Arrange Tools add-on (Object › Plug-ins › Arrange Tools): each selected object gets its own opacity at random between a minimum and a maximum percent, with a seed that repeats the result, as one undo step (`addon.arrange.randomizeOpacity`, #4925).
@@ -136,6 +141,7 @@ Ranked; detail in [docs/roadmap.md](docs/roadmap.md) and [docs/gaps.md](docs/gap
- 2026-11-01: New Symbols from Layers joins the Document Tools add-on (Object › Plug-ins › Document Tools): one symbol of each top-level layer's art (the layers highlighted in the Layers panel when two or more are, else every layer), named after the layer, made as New Symbol makes one; Convert Layers to Symbols also puts an instance of each in place of its layer's art. Empty layers are skipped and reported; one undo step. A VectorCraft addition: headline numbers unchanged.
- 2026-11-01: Document Tools, a built-in add-on (Object › Plug-ins › Document Tools), starts with Save a Timestamped Copy: a copy of the document named `_YYYY-MM-DD_HH-MM` (UTC; `-2`, `-3`… when that name is taken) goes next to it, or into a folder picked for a document never saved, written as File › Save a Copy writes it, so the document keeps its path, title and modified state. Off on the web, which has no clock. A VectorCraft addition: headline numbers unchanged.
- 2026-11-01: Divide into Dashes joins the Path Precision Tools add-on (Object › Plug-ins › Path Precision Tools): the selected paths, or only their direct-selected segments, are cut into separate open paths of a dash length measured along the curve, with an optional gap (left empty, or kept as pieces), each keeping the path's appearance; Fit to Corners and Ends stretches or squeezes the lengths so every run starts and ends on a dash. A dialog with Preview, one undo step, at most 100000 pieces. A VectorCraft addition: headline numbers unchanged.
+- 2026-11-03: Text Tweaker, the first tool of the Type Tools add-on (Object › Plug-ins › Type Tools): one character attribute (size, baseline shift, rotation, horizontal or vertical scale, tracking, leading or stroke weight) goes letter by letter from a start value to an end value along a straight ramp, an ease, a bow, a spike or at random with a seed, set as the Character panel sets it, while the text stays live; a dialog with Preview, one undo step (`addon.type.textTweaker`, #4924). A VectorCraft addition: headline numbers unchanged.
- 2026-11-01: Group Overlapping Objects joins the Arrange Tools add-on (Object › Plug-ins › Arrange Tools): the selected objects whose visual bounds overlap or touch, chains included, go into one group each, within their own layer or group, at the stacking place of their frontmost member; objects that overlap nothing stay as they are. One undo step, a sweep along x so thousands of loose pieces group quickly (at most 20000 objects). A VectorCraft addition: headline numbers unchanged.
- 2026-10-31: Export for Screens works as the reference app's dialog: Artboards and Assets tabs with a grid or list of thumbnails, Clear Selection and Prefix, Create Sub-folders by Scale or Format (on by default), Export PDFs As Single File (the chosen artboards as one PDF's pages, `pdfs: "single"`) or Multiple Files, iOS and Android rows, format presets in a ☰ menu, and a count of the files the export writes (#4895). About 55 community PRs and fixes landed the same day: Find Font, Replace Font, Outline Stroke and Expand leave hidden and locked art alone (with a warning); DXF export writes LINE and ELLIPSE entities and outlines only the strokes a CAD line can't draw; Blob Brush Angle and Roundness; Shift-constrained Perspective Selection; Grid Repeat Options Preview; a gradient mesh from a file budgeted at about a million quads; width-profile strokes keep their shape zoomed out; `.ai`/EPS import fidelity (area type, envelopes, transparency in dictionaries, character styles); PDF import finds hyphenated and CMap-suffixed font names; Windows renders follow the process's core affinity; Enter or Escape in a floating panel's field no longer reaches the canvas (#4803); Properties shows Blend Options for any selected blend (#4817); Artwork Cleanup finds doubled type (#4835) and joins stacked lines into one object (Join Point Text, #4826). Headline numbers unchanged.
- 2026-10-31: Arrange Tools, a built-in add-on (Object › Plug-ins › Arrange Tools): Arrange in Grid lays the selected objects out in rows and columns, a row or a column with gaps, from the selection's top-left or centred on the artboard; Swap Objects swaps two objects' places (and, with Swap Objects and Sizes, their sizes); Replace with Top Object puts a copy of the topmost selected object in place of each of the others, kept, stretched or fitted in proportion; Set Size of Each gives every selected object an exact width and/or height about a reference point; Zoom to Selection fits the view to the selection. Each is one undo step with a previewed dialog where it has options. A VectorCraft addition: headline numbers unchanged.
@@ -149,6 +155,7 @@ Ranked; detail in [docs/roadmap.md](docs/roadmap.md) and [docs/gaps.md](docs/gap
- 2026-10-22: Effect › Sketch › Conté Crayon: a black crayon in the dark areas and a white one in the light areas, on mid-grey paper whose texture (Brick, Burlap, Canvas, Sandstone; Scaling, Relief, Light Direction, Invert) breaks the strokes, with Foreground Level and Background Level; an original approximation, defaults unverified. Every Photoshop-style filter is now in (57/57); the Effect Gallery remains (4–6 h).
- 2026-10-22: Ruby (ふりがな) for live text: `type.ruby` sets or removes a reading over a byte range of the selected type — above it in horizontal type, right of the column in vertical type (or below/left), start/centre/end aligned, at 1–100% of the base size (default half), overhanging or squeezed to the base width. It is saved in the native file, laid out with its line growing (following lines move on), drawn on the canvas, and written in SVG and PDF as outlines where ruby is present. UI panel and type on a path are next. Headline numbers unchanged.
- 2026-10-22: PDF accessibility: titled exports set `/ViewerPreferences << /DisplayDocTitle true >>`, so viewers show the document title rather than the file name and title checks can pass (#3646). Headline numbers unchanged.
+- 2026-10-22: Pen tilt, bearing and barrel rotation (part of #764): Calligraphic and Scatter brushes take Tilt, Bearing and Rotation beside Pressure, the Paintbrush records them along each stroke, and the app reads a pen's tilt and an Art Pen's barrel rotation from XInput2 on Linux under X11 and XWayland and from AppKit's tablet events on macOS. Headline numbers unchanged.
- 2026-10-14: Document fonts register every explicitly supplied craft-fonts family after the existing Japanese, Arabic and Thai prefix; optional empty input remains supported. Headline scores and estimates are unchanged.
@@ -212,6 +219,8 @@ The full earlier record of what landed is kept in [docs/roadmap.md](docs/roadmap
| Date | Change | Summary |
|---|---|---|
+| 2026-11-03 | minor | Progress log row for the Type Tools add-on's Text Tweaker (#4924); headline numbers unchanged. |
+| 2026-11-02 | minor | Closed font-family fields accept wheel input for selected text in Character, Properties and Control (#5253); scores and estimates unchanged. |
| 2026-11-01 | minor | Progress log row for the Color Effects add-on's Find Nearest Swatch (#4923); headline numbers unchanged. |
| 2026-11-01 | minor | Progress log row for the Path Precision Tools add-on's Expand Dashes into Paths (#4922); headline numbers unchanged. |
| 2026-11-01 | minor | Progress log row for the Arrange Tools add-on's Randomize Opacity (#4925); headline numbers unchanged. |
diff --git a/apps/vectorcraft-cli/src/perf.rs b/apps/vectorcraft-cli/src/perf.rs
index ac3a9cf3ae..33815fbf36 100644
--- a/apps/vectorcraft-cli/src/perf.rs
+++ b/apps/vectorcraft-cli/src/perf.rs
@@ -116,7 +116,8 @@ fn edit_drags(n: usize) -> Result<(f64, f64), String> {
let view = vectorcraft_engine::ViewInfo { zoom: 8.0, ..Default::default() };
let err = |e: vectorcraft_engine::EngineError| e.to_string();
let mut drag = |down: Point| -> Result {
- let ev = |kind, y: f64| PointerEvent { kind, pos: down + Vec2::new(0.0, y), mods: Mods::default(), backquote: false, pressure: 1.0 };
+ let ev =
+ |kind, y: f64| PointerEvent { kind, pos: down + Vec2::new(0.0, y), mods: Mods::default(), backquote: false, pressure: 1.0, pen: None };
s.execute("select.anchors", &json!({"id": id.0, "anchors": [[0, 400]]})).map_err(err)?;
s.select_tool("directSelection", view).map_err(err)?;
let undo = s.doc().map_err(err)?.history.undo.len();
@@ -215,7 +216,14 @@ fn deep(n: usize) -> Result<(), String> {
let first = s.doc().map_err(err)?.selection.objects.first().copied();
let at = first.and_then(|id| s.doc().ok()?.doc.node(id)?.geometric_bounds()).map(|b| b.center());
if let Some(down) = at {
- let ev = |kind, dx: f64| PointerEvent { kind, pos: down + Vec2::new(dx, 0.0), mods: Mods::default(), backquote: false, pressure: 1.0 };
+ let ev = |kind, dx: f64| PointerEvent {
+ kind,
+ pos: down + Vec2::new(dx, 0.0),
+ mods: Mods::default(),
+ backquote: false,
+ pressure: 1.0,
+ pen: None,
+ };
s.select_tool("selection", view).map_err(err)?;
s.pointer(&ev(PointerKind::Down, 0.0), view).map_err(err)?;
let mut dx = 0.0;
diff --git a/apps/vectorcraft-web/src/keys.rs b/apps/vectorcraft-web/src/keys.rs
index 8cb27096b4..e2f3ea0b48 100644
--- a/apps/vectorcraft-web/src/keys.rs
+++ b/apps/vectorcraft-web/src/keys.rs
@@ -27,6 +27,19 @@ pub(crate) fn kept_from_browser(key: &str, code: &str, modifiers: Modifiers, alt
vectorcraft_ui_egui::shortcuts::runs_a_shortcut(key, code, modifiers)
}
+/// Leave a paste to its Paste event (#5555). eframe's web runner reports a Cmd+V press both as the
+/// key press and, with the clipboard's text, as a Paste event (the browser's `paste` comes in the
+/// same task as the `keydown`, so both are in one frame's input); the app pastes on each, as egui's
+/// window integration sends only the Paste. With a Paste in `events`, the paste key's press is
+/// dropped; its release stays, so the paste chord is still followed (`PasteChord`). A Cmd+V without
+/// a Paste (a clipboard with no text) keeps its press.
+pub(crate) fn drop_paste_key_presses(events: &mut Vec) {
+ if !events.iter().any(|e| matches!(e, egui::Event::Paste(_))) {
+ return;
+ }
+ events.retain(|e| !matches!(e, egui::Event::Key { key: Key::V, pressed: true, modifiers, .. } if modifiers.command));
+}
+
/// The modifiers of a key event as eframe reports them to egui (its `modifiers_from_kb_event`).
#[cfg(target_arch = "wasm32")]
fn modifiers(e: &web_sys::KeyboardEvent) -> Modifiers {
@@ -115,4 +128,31 @@ mod tests {
assert!(!kept_from_browser("ż", "KeyZ", ctrl_alt, true));
assert!(!kept_from_browser("}", "Digit0", ctrl_alt, true));
}
+
+ fn key(key: Key, pressed: bool, modifiers: Modifiers) -> egui::Event {
+ egui::Event::Key { key, physical_key: None, pressed, repeat: false, modifiers }
+ }
+
+ #[test]
+ fn a_paste_chord_pastes_once() {
+ // Cmd+V and Cmd+Shift+V (Paste in Place): the press goes, the Paste and the release stay.
+ for mods in [cmd(), cmd() | Modifiers::SHIFT] {
+ let mut events = vec![key(Key::V, true, mods), egui::Event::Paste("".into()), key(Key::V, false, mods)];
+ drop_paste_key_presses(&mut events);
+ assert_eq!(events, vec![egui::Event::Paste("".into()), key(Key::V, false, mods)], "{mods:?}");
+ }
+ }
+
+ #[test]
+ fn keys_without_a_paste_stay() {
+ // No text on the clipboard: no Paste event, so the press is the paste chord's only report.
+ let mut events = vec![key(Key::V, true, cmd()), key(Key::V, false, cmd())];
+ drop_paste_key_presses(&mut events);
+ assert_eq!(events.len(), 2);
+ // Typing V, and other chords, beside a paste.
+ let typed = vec![key(Key::V, true, Modifiers::NONE), key(Key::C, true, cmd()), egui::Event::Paste("a".into())];
+ let mut events = typed.clone();
+ drop_paste_key_presses(&mut events);
+ assert_eq!(events, typed);
+ }
}
diff --git a/apps/vectorcraft-web/src/pencil.rs b/apps/vectorcraft-web/src/pencil.rs
index b7140d7e58..88b85e9d50 100644
--- a/apps/vectorcraft-web/src/pencil.rs
+++ b/apps/vectorcraft-web/src/pencil.rs
@@ -23,7 +23,7 @@ use std::cell::RefCell;
use std::rc::Rc;
use egui::{Event, PointerButton, Pos2, TouchDeviceId, TouchId, TouchPhase};
-use vectorcraft_ui_egui::stylus::{PenSample, StylusFeed};
+use vectorcraft_ui_egui::stylus::{PenPose, PenSample, StylusFeed};
use vectorcraft_ui_egui::touch::{self, Source};
#[cfg(target_arch = "wasm32")]
use wasm_bindgen::JsCast as _;
@@ -95,7 +95,7 @@ impl Pointers {
/// A pen moved or pressed with `pressure`, with the end it last pressed with.
fn pen_sample(&self, pressure: f32) {
- self.stylus.set_sample(Some(PenSample { pressure, eraser: self.eraser }));
+ self.stylus.set_sample(Some(PenSample { pressure, eraser: self.eraser, pose: PenPose::default() }));
}
fn touch(&mut self, device: TouchDeviceId, id: i32, phase: TouchPhase, pos: Pos2, force: Option) {
diff --git a/apps/vectorcraft-web/src/web.rs b/apps/vectorcraft-web/src/web.rs
index 859d41ef79..75eb7b3082 100644
--- a/apps/vectorcraft-web/src/web.rs
+++ b/apps/vectorcraft-web/src/web.rs
@@ -378,6 +378,8 @@ impl eframe::App for WebShell {
/// shared input hook before egui runs.
fn raw_input_hook(&mut self, ctx: &egui::Context, raw: &mut egui::RawInput) {
raw.events.extend(self.host.pointers.borrow_mut().take());
+ // A Cmd+V comes as its key and as a Paste: one paste (#5555).
+ crate::keys::drop_paste_key_presses(&mut raw.events);
if let Some(app) = &mut self.app {
app.raw_input_hook(ctx, raw);
}
diff --git a/apps/vectorcraft/Cargo.toml b/apps/vectorcraft/Cargo.toml
index 47d26eb7b6..f462132317 100644
--- a/apps/vectorcraft/Cargo.toml
+++ b/apps/vectorcraft/Cargo.toml
@@ -56,8 +56,9 @@ pollster = "1"
# `GetPointerPenInfo`, which it uses to read the pen's pressure and which end of the pen is down.
# Win32_System_Threading has `GetProcessAffinityMask`, which src/windows_cores.rs uses to count the
# cores the process may run on. Win32_UI_Input_KeyboardAndMouse has `GetKeyState`, which
-# src/caps_lock.rs uses to read whether Caps Lock is on.
-windows = { version = "0.62", features = ["Win32_Graphics_DirectWrite", "Win32_Graphics_Gdi", "Win32_System_Threading", "Win32_UI_Input_KeyboardAndMouse", "Win32_UI_Input_Pointer", "Win32_UI_WindowsAndMessaging"] }
+# src/caps_lock.rs uses to read whether Caps Lock is on. Win32_System_Registry has `RegGetValueW`,
+# which src/host_services.rs uses to read the path PhotoCraft registers under App Paths.
+windows = { version = "0.62", features = ["Win32_Graphics_DirectWrite", "Win32_Graphics_Gdi", "Win32_System_Registry", "Win32_System_Threading", "Win32_UI_Input_KeyboardAndMouse", "Win32_UI_Input_Pointer", "Win32_UI_WindowsAndMessaging"] }
# The renderer's worker count follows those cores (src/windows_cores.rs).
vectorcraft-render = { workspace = true }
diff --git a/apps/vectorcraft/src/clipboard.rs b/apps/vectorcraft/src/clipboard.rs
index 08bb6aa8a9..59b30b7649 100644
--- a/apps/vectorcraft/src/clipboard.rs
+++ b/apps/vectorcraft/src/clipboard.rs
@@ -20,7 +20,7 @@ use std::io::{Cursor, Read};
use std::path::PathBuf;
use vectorcraft_engine::cmd::clipboard::{BITMAP, EPS, FILE_HEAD, Flavour, PDF, PNG, SVG, TEXT, file_flavour};
-use vectorcraft_ui_egui::SystemClipboard;
+use vectorcraft_ui_egui::{ClipboardRead, SystemClipboard};
/// This platform's system clipboard. On Linux, `window`'s Wayland connection carries text where
/// arboard can't open (GNOME has no data-control protocol, a Flatpak there no X11).
@@ -157,6 +157,10 @@ fn copied_file(paths: Vec, mimes: &[&'static str]) -> Option {
None if vectorcraft_engine::file_access::current().is_none() => {}
None => return None,
}
+ // A device or pipe may never end: only a regular file is read whole.
+ if !std::fs::metadata(&path).ok()?.is_file() {
+ return None;
+ }
let mut head = Vec::with_capacity(FILE_HEAD);
std::fs::File::open(&path).ok()?.take(FILE_HEAD as u64).read_to_end(&mut head).ok()?;
let mime = file_flavour(&path.to_string_lossy(), &head, mimes)?;
@@ -172,7 +176,8 @@ mod win {
use clipboard_win::{formats, options::NoClear, raw};
use super::{
- BITMAP, Cursor, Flavour, PNG, SVG, SystemClipboard, TEXT, copied_file, decode_png, dib_image, png_flavour, text_of, windows_formats,
+ BITMAP, ClipboardRead, Cursor, Flavour, PNG, SVG, SystemClipboard, TEXT, copied_file, decode_png, dib_image, png_flavour, text_of,
+ windows_formats,
};
/// The device-independent bitmaps, the one that carries alpha first. Each is there whenever the
@@ -249,10 +254,16 @@ mod win {
// A clipboard manager may have copied our data again as its own.
let Some(ours) = self.text.as_deref() else { return false };
let Ok(_open) = clipboard_win::Clipboard::new_attempts(10) else { return false };
- read_one(TEXT).is_some_and(|f| f.data == ours.as_bytes())
+ read_one(TEXT).and_then(ClipboardRead::flavour).is_some_and(|f| f.data == ours.as_bytes())
}
fn read(&mut self, mimes: &[&'static str]) -> Option {
+ self.read_deferred(mimes)?.flavour()
+ }
+
+ /// A device-independent bitmap is copied off the clipboard here and decoded and encoded
+ /// as PNG by the work that comes back.
+ fn read_deferred(&mut self, mimes: &[&'static str]) -> Option {
let mut files = vec![];
{
let _open = clipboard_win::Clipboard::new_attempts(10).ok()?;
@@ -260,7 +271,7 @@ mod win {
let _ = raw::get_file_list_path(&mut files);
}
// The files are read with the clipboard closed again, not keeping other apps waiting.
- copied_file(files, mimes).or_else(|| {
+ copied_file(files, mimes).map(ClipboardRead::Now).or_else(|| {
let _open = clipboard_win::Clipboard::new_attempts(10).ok()?;
mimes.iter().find_map(|m| read_one(m))
})
@@ -284,16 +295,28 @@ mod win {
})
}
- /// One flavour, while the clipboard is open.
- fn read_one(mime: &'static str) -> Option {
+ /// A device-independent bitmap as a PNG flavour.
+ fn dib_png(dib: &[u8]) -> Option {
+ png_flavour(&dib_image(dib)?)
+ }
+
+ /// Copy both bitmap formats while the clipboard is open, then decode them in preference order.
+ pub(super) fn read_dibs(mut get: impl FnMut(u32) -> Option>) -> Option {
+ let dibs: Vec<_> = DIBS.into_iter().filter_map(&mut get).collect();
+ (!dibs.is_empty()).then_some(ClipboardRead::Later(Box::new(move || dibs.iter().find_map(|dib| dib_png(dib)))))
+ }
+
+ /// One flavour, while the clipboard is open. A device-independent bitmap is copied here, and
+ /// the work that comes back decodes each captured format in preference order.
+ fn read_one(mime: &'static str) -> Option {
let mut data = vec![];
let mime = match mime {
BITMAP if read_registered(PNG, &mut data) => PNG,
BITMAP => {
- return DIBS.into_iter().find_map(|id| {
- data.clear();
- raw::get_vec(id, &mut data).ok()?;
- png_flavour(&dib_image(&data)?)
+ return read_dibs(|id| {
+ let mut dib = vec![];
+ raw::get_vec(id, &mut dib).ok()?;
+ Some(dib)
});
}
TEXT => {
@@ -309,7 +332,7 @@ mod win {
{
data.truncate(end);
}
- (!data.is_empty()).then_some(Flavour { mime, data })
+ (!data.is_empty()).then_some(ClipboardRead::Now(Flavour { mime, data }))
}
}
@@ -322,7 +345,7 @@ mod portable {
use std::sync::atomic::{AtomicBool, Ordering};
use std::time::{Duration, Instant};
- use super::{BITMAP, Flavour, PNG, SystemClipboard, TEXT, copied_file, decode_png, png_flavour, text_of};
+ use super::{BITMAP, ClipboardRead, Flavour, PNG, SystemClipboard, TEXT, copied_file, decode_png, png_flavour, text_of};
/// What our last write put on the clipboard.
enum Ours {
@@ -580,22 +603,27 @@ mod portable {
}
fn read(&mut self, mimes: &[&'static str]) -> Option {
+ self.read_deferred(mimes)?.flavour()
+ }
+
+ /// arboard's image is read here and encoded as PNG by the work that comes back.
+ fn read_deferred(&mut self, mimes: &[&'static str]) -> Option {
let cb = self.cb(Asker::User).ok()?;
if let Some(f) = copied_file(cb.file_list(), mimes) {
- return Some(f);
+ return Some(ClipboardRead::Now(f));
}
mimes.iter().find_map(|m| {
#[cfg(target_os = "macos")]
if let Some(f) = super::mac::read(m) {
- return Some(f);
+ return Some(ClipboardRead::Now(f));
}
match *m {
- TEXT => cb.get_text().ok().filter(|t| !t.is_empty()).map(|t| Flavour { mime: TEXT, data: t.into_bytes() }),
+ TEXT => cb.get_text().ok().filter(|t| !t.is_empty()).map(|t| ClipboardRead::Now(Flavour { mime: TEXT, data: t.into_bytes() })),
BITMAP => {
let img = cb.get_image().ok()?;
- let rgba =
- image::RgbaImage::from_raw(u32::try_from(img.width).ok()?, u32::try_from(img.height).ok()?, img.bytes.into_owned())?;
- png_flavour(&rgba)
+ let (width, height) = (u32::try_from(img.width).ok()?, u32::try_from(img.height).ok()?);
+ let bytes = img.bytes.into_owned();
+ Some(ClipboardRead::Later(Box::new(move || png_flavour(&image::RgbaImage::from_raw(width, height, bytes)?))))
}
_ => None,
}
@@ -1057,6 +1085,28 @@ mod tests {
img.pixels().map(|p| p.0).collect()
}
+ #[test]
+ #[cfg(windows)]
+ fn dib_fallback_captures_both_formats_before_decoding() {
+ use clipboard_win::formats::{CF_DIB, CF_DIBV5};
+
+ let valid = dib(40, 1, 1, 32, 0, &[], &bgra(&[RED]));
+ let mut captured = Vec::new();
+ let read = win::read_dibs(|id| {
+ captured.push(id);
+ match id {
+ CF_DIBV5 => Some(vec![40, 0, 0]),
+ CF_DIB => Some(valid.clone()),
+ _ => None,
+ }
+ })
+ .unwrap();
+ assert_eq!(captured, [CF_DIBV5, CF_DIB]);
+ let flavour = read.flavour().unwrap();
+ assert_eq!(flavour.mime, PNG);
+ assert_eq!(pixels(&decode_png(&flavour.data).unwrap()), [RED]);
+ }
+
#[test]
fn a_screenshot_dib_pastes_opaque_and_upright() {
// CF_DIB as screenshots copy it: 32-bit BI_RGB, bottom row first, the fourth byte zero.
diff --git a/apps/vectorcraft/src/control_server/tests.rs b/apps/vectorcraft/src/control_server/tests.rs
index e3d946ef0a..d991fd6028 100644
--- a/apps/vectorcraft/src/control_server/tests.rs
+++ b/apps/vectorcraft/src/control_server/tests.rs
@@ -58,7 +58,12 @@ fn idle_control_socket_releases_its_worker() {
fn idle_expiry_closes_without_writing_a_line() {
let (mut client, done, worker) = socket_fixture(short_timeouts(), |_, _| panic!("no request expected"));
let mut got = Vec::new();
- client.read_to_end(&mut got).unwrap();
+ match client.read_to_end(&mut got) {
+ // On Windows the server's close can reach the client as a reset.
+ Err(e) if e.kind() == std::io::ErrorKind::ConnectionReset => {}
+ Ok(_) => {}
+ Err(e) => panic!("reading the idle connection: {e}"),
+ }
assert_eq!(String::from_utf8_lossy(&got), "", "the app wrote to an idle connection");
expect_socket_deadline(client, done, worker);
}
@@ -334,7 +339,9 @@ fn tcp_connection_is_closed_after_junk() {
});
let mut c = TcpStream::connect(addr).unwrap();
c.set_read_timeout(Some(WAIT)).unwrap();
- c.write_all(b"{\"id\":7,\"method\":\"x\"}\nhello\n{\"method\":\"y\"}\n").unwrap();
+ // Nothing after the junk line: on Windows, closing a socket with unread input resets the
+ // connection, and the reset can discard the reply before the client reads it.
+ c.write_all(b"{\"id\":7,\"method\":\"x\"}\nhello\n").unwrap();
let mut text = String::new();
c.read_to_string(&mut text).unwrap(); // returns at EOF: the server closed the connection
server.join().unwrap();
diff --git a/apps/vectorcraft/src/gpu.rs b/apps/vectorcraft/src/gpu.rs
index 00f92405e3..d7d917ed42 100644
--- a/apps/vectorcraft/src/gpu.rs
+++ b/apps/vectorcraft/src/gpu.rs
@@ -753,13 +753,22 @@ enum FirstFrame {
Shown,
/// Overdue.
Hung,
+ /// Overdue, but the UI is still building the first frame: the app's own work (on a slow
+ /// machine, or with antivirus reading every font file), not the adapter, which has been given
+ /// nothing to show yet.
+ Busy,
}
-/// The window's start after `frames` frames run, `since` its first frame was due.
-fn first_frame(frames: u64, since: Duration, minimized: bool) -> FirstFrame {
+/// The window's start after `frames` frames run, `since` its first frame was due and
+/// `since_built` the first frame's UI pass ended (`None` while it runs). A frame counts once its
+/// UI pass ends, before it is painted, so the adapter's time starts there: with no frame run, the
+/// UI thread is in the app's code, and starting again without the adapter wouldn't help (#5160).
+fn first_frame(frames: u64, since: Duration, since_built: Option, minimized: bool) -> FirstFrame {
if frames >= 2 || minimized {
FirstFrame::Shown
- } else if since >= FIRST_FRAME_TIMEOUT {
+ } else if frames == 0 {
+ if since >= FIRST_FRAME_TIMEOUT { FirstFrame::Busy } else { FirstFrame::Wait }
+ } else if since_built.unwrap_or(since) >= FIRST_FRAME_TIMEOUT {
FirstFrame::Hung
} else {
FirstFrame::Wait
@@ -767,18 +776,34 @@ fn first_frame(frames: u64, since: Duration, minimized: bool) -> FirstFrame {
}
/// Watch the window's first frame from another thread: once it reaches the screen, clear the start
-/// from [`START_FILE`]; when it hasn't reached the screen [`FIRST_FRAME_TIMEOUT`] after the app was
-/// created ([`Startup::ready`]), start the app again without the adapter, as [`finish`] does for
-/// one that failed, and end this process, whose UI thread is stuck in the graphics driver.
+/// from [`START_FILE`]; when it hasn't reached the screen [`FIRST_FRAME_TIMEOUT`] after its UI pass
+/// ended, start the app again without the adapter, as [`finish`] does for one that failed, and end
+/// this process, whose UI thread is stuck in the graphics driver. A first frame still being built
+/// that long is waited for, with a note in the log.
pub fn watch_first_frame(startup: Arc) {
+ let mut built: Option = None;
+ let mut noted = false;
let watch = move || loop {
std::thread::sleep(Duration::from_millis(250));
let Some(due) = startup.ready.get() else { continue };
let ui = startup.ui.get();
let frames = ui.map_or(0, egui::Context::cumulative_frame_nr);
+ if frames >= 1 && built.is_none() {
+ built = Some(Instant::now());
+ }
let minimized = ui.and_then(|c| c.input(|i| i.viewport().minimized)).unwrap_or(false);
- match first_frame(frames, due.elapsed(), minimized) {
+ match first_frame(frames, due.elapsed(), built.map(|t| t.elapsed()), minimized) {
FirstFrame::Wait => continue,
+ FirstFrame::Busy => {
+ if !noted {
+ log::warn!(
+ "the window's first frame is still being built after {}s: waiting for it (the app's work, not the graphics adapter)",
+ FIRST_FRAME_TIMEOUT.as_secs()
+ );
+ noted = true;
+ }
+ continue;
+ }
FirstFrame::Shown => {
startup.presented();
return;
diff --git a/apps/vectorcraft/src/gpu/tests.rs b/apps/vectorcraft/src/gpu/tests.rs
index b1511a232a..40d84934f3 100644
--- a/apps/vectorcraft/src/gpu/tests.rs
+++ b/apps/vectorcraft/src/gpu/tests.rs
@@ -366,14 +366,19 @@ fn gpus_without_pci_ids_are_told_apart_by_name() {
fn a_first_frame_that_never_reaches_the_screen_hangs_its_adapter() {
let s = Duration::from_secs;
// The second frame began: the first was presented.
- assert_eq!(first_frame(2, s(60), false), FirstFrame::Shown);
- // Still drawing (or presenting) the first frame: waited for, then given up on (#964).
- for frames in [0, 1] {
- assert_eq!(first_frame(frames, s(3), false), FirstFrame::Wait);
- assert_eq!(first_frame(frames, FIRST_FRAME_TIMEOUT, false), FirstFrame::Hung);
- }
+ assert_eq!(first_frame(2, s(60), Some(s(1)), false), FirstFrame::Shown);
+ // The first frame built and not yet presented: waited for, then given up on (#964), counting
+ // from when its UI pass ended.
+ assert_eq!(first_frame(1, s(3), Some(s(1)), false), FirstFrame::Wait);
+ assert_eq!(first_frame(1, FIRST_FRAME_TIMEOUT, Some(FIRST_FRAME_TIMEOUT), false), FirstFrame::Hung);
+ assert_eq!(first_frame(1, s(45), Some(s(5)), false), FirstFrame::Wait, "a first frame built slowly gets its full time to show");
+ assert_eq!(first_frame(1, FIRST_FRAME_TIMEOUT, None, false), FirstFrame::Hung);
+ // The first frame still being built: the app's work, not the adapter's (#5160).
+ assert_eq!(first_frame(0, s(3), None, false), FirstFrame::Wait);
+ assert_eq!(first_frame(0, FIRST_FRAME_TIMEOUT, None, false), FirstFrame::Busy);
+ assert_eq!(first_frame(0, s(600), None, false), FirstFrame::Busy, "never a restart without an adapter");
// A window minimized at the start may not draw again until restored.
- assert_eq!(first_frame(1, s(60), true), FirstFrame::Shown);
+ assert_eq!(first_frame(1, s(60), Some(s(60)), true), FirstFrame::Shown);
// A hung adapter is left out once, like one that failed.
let skip = vec!["Dx12:10de:28a0".to_string()];
assert_eq!(restart_without(true, 1, Some("Dx12:10de:28a0"), &skip), None);
diff --git a/apps/vectorcraft/src/host_services.rs b/apps/vectorcraft/src/host_services.rs
index e25332b61a..2ca282d74c 100644
--- a/apps/vectorcraft/src/host_services.rs
+++ b/apps/vectorcraft/src/host_services.rs
@@ -44,19 +44,50 @@ macro_rules! dialog_settings {
dialog_settings!(rfd::FileDialog, rfd::AsyncFileDialog);
+/// On Linux and the BSDs the dialog is GTK's or the desktop portal's, which match a file type's
+/// `*.ext` patterns case-sensitively.
+const CASE_SENSITIVE_FILTERS: bool =
+ cfg!(any(target_os = "linux", target_os = "freebsd", target_os = "dragonfly", target_os = "netbsd", target_os = "openbsd"));
+
+/// The extensions an open dialog's filter is given for `exts`: with `any_case`, each extension
+/// that has a letter is followed by a pattern with each letter as a `[xX]` pair, so the filter for
+/// `dib` also lists `image.DIB` and `image.Dib`.
+fn open_extensions(exts: &[impl AsRef], any_case: bool) -> Vec {
+ let mut out = Vec::with_capacity(exts.len() * 2);
+ for e in exts {
+ let e = e.as_ref();
+ out.push(e.to_string());
+ if any_case && e.chars().any(|c| c.is_ascii_alphabetic()) {
+ out.push(
+ e.chars()
+ .map(|c| if c.is_ascii_alphabetic() { format!("[{}{}]", c.to_ascii_lowercase(), c.to_ascii_uppercase()) } else { c.to_string() })
+ .collect(),
+ );
+ }
+ }
+ out
+}
+
/// `d` set up for `request`: its title, file types, folder and suggested name.
fn dialog_for(d: D, request: &PickRequest) -> D {
let pick = match request {
PickRequest::Open(pick) | PickRequest::Save(pick) => pick,
PickRequest::OpenMany => {
return fileio::place_filters().fold(d.title(vectorcraft_ui_egui::i18n::t("Place")), |d, (name, exts)| {
- d.filter(vectorcraft_ui_egui::i18n::tr_ctx(vectorcraft_ui_egui::i18n::current(), "file-filter", name), exts)
+ d.filter(
+ vectorcraft_ui_egui::i18n::tr_ctx(vectorcraft_ui_egui::i18n::current(), "file-filter", name),
+ &open_extensions(exts, CASE_SENSITIVE_FILTERS),
+ )
});
}
PickRequest::Folder => return d,
};
+ let any_case = CASE_SENSITIVE_FILTERS && matches!(request, PickRequest::Open(_));
let d = pick.filters.iter().fold(d, |d, (name, exts)| {
- d.filter(vectorcraft_ui_egui::i18n::tr_ctx(vectorcraft_ui_egui::i18n::current(), "file-filter", name.as_str()), exts)
+ d.filter(
+ vectorcraft_ui_egui::i18n::tr_ctx(vectorcraft_ui_egui::i18n::current(), "file-filter", name.as_str()),
+ &open_extensions(exts, any_case),
+ )
});
let d = match &pick.folder {
Some(folder) => d.folder(folder),
@@ -151,6 +182,22 @@ fn reveal_command(path: &str) -> std::process::Command {
c
}
+/// Read a whole file. A device or pipe may never end: only a regular file is read.
+fn read_file(path: &str) -> Result, String> {
+ if !std::fs::metadata(path).map_err(|e| e.to_string())?.is_file() {
+ return Err(format!("{path}: not a file"));
+ }
+ std::fs::read(path).map_err(|e| e.to_string())
+}
+
+#[cfg(test)]
+#[test]
+fn read_file_refuses_what_is_not_a_regular_file() {
+ assert!(read_file(&std::env::temp_dir().to_string_lossy()).is_err());
+ #[cfg(unix)]
+ assert!(read_file("/dev/zero").is_err());
+}
+
/// Write a file the safe way: a failed write keeps the old file ([`fileio::write_atomic`]).
fn write_file(path: &str, bytes: &[u8]) -> Result<(), String> {
fileio::write_atomic(std::path::Path::new(path), bytes).map_err(|e| e.to_string())
@@ -277,7 +324,7 @@ pub(crate) fn services(parent: Parent, ui: egui::Context) -> Services {
// Windows reads it from the pen's pointer messages (`windows_stylus`).
#[cfg(windows)]
stylus: Some(windows_stylus::start()),
- read: Some(Box::new(|p: &str| std::fs::read(p).map_err(|e| e.to_string()))),
+ read: Some(Box::new(read_file)),
write: Some(Box::new(write_file)),
exists: Some(Box::new(|p: &str| std::path::Path::new(p).exists())),
// Background Save and Export write from a worker thread.
@@ -300,6 +347,8 @@ pub(crate) fn services(parent: Parent, ui: egui::Context) -> Services {
reveal: Some(Box::new(reveal)),
// Links panel: Edit Original; Package: Show Package. Relink to Folder and Package pick folders.
open_file: Some(Box::new(open_file)),
+ // Edit Original of a raster image with Use System Defaults for Edit Original off (#5236).
+ open_in_photocraft: Some(Box::new(open_in_photocraft)),
pick_folder: Some(Box::new(move || pick_now(PickRequest::Folder, &p4).into_iter().next())),
// Sample Color from Screen: the system's color sampler.
#[cfg(target_os = "macos")]
@@ -334,3 +383,395 @@ fn open_file(path: &str) -> Result<(), String> {
c.arg(path);
c.spawn().map(|_| ()).map_err(|e| format!("can't open {path}: {e}"))
}
+
+/// Edit Original with Preferences › File Handling › Use System Defaults for Edit Original off
+/// (#5236): open the raster image `path` in PhotoCraft, found only where it installs
+/// ([`find_photocraft`]); `Ok(false)` when it isn't installed. PhotoCraft gets the path as its only
+/// argument and is never started through a shell.
+fn open_in_photocraft(path: &str) -> Result {
+ explorer_safe(path)?;
+ let home = std::env::var_os(if cfg!(windows) { "USERPROFILE" } else { "HOME" }).map(std::path::PathBuf::from);
+ let Some(app) = find_photocraft(home.as_deref(), std::env::var_os("PATH").as_deref()) else { return Ok(false) };
+ #[cfg(target_os = "macos")]
+ let mut c = {
+ let mut c = std::process::Command::new("open");
+ c.arg("-a").arg(&app).arg(path);
+ c
+ };
+ #[cfg(not(target_os = "macos"))]
+ let mut c = {
+ let mut c = std::process::Command::new(&app);
+ c.arg(path);
+ c
+ };
+ // macOS: `open` returns once Launch Services has the request, so a short wait reports an app
+ // it can't open (a folder named `.app` that isn't a bundle). The wait is capped so a stalled
+ // `open` never holds the window: past it, the launch is left to run. Elsewhere the editor
+ // itself runs: waiting would last until it closes.
+ #[cfg(target_os = "macos")]
+ {
+ const WAIT: std::time::Duration = std::time::Duration::from_secs(2);
+ let fail = |why: String| format!("can't open {path} in {}: {why}", app.display());
+ let mut child = c.stderr(std::process::Stdio::piped()).spawn().map_err(|e| fail(e.to_string()))?;
+ let started = std::time::Instant::now();
+ loop {
+ match child.try_wait() {
+ Ok(Some(status)) if status.success() => return Ok(true),
+ Ok(Some(status)) => {
+ let mut why = String::new();
+ if let Some(mut err) = child.stderr.take() {
+ // Best effort: without its message the exit status says why.
+ let _ = std::io::Read::read_to_string(&mut err, &mut why);
+ }
+ let why = why.trim().to_string();
+ return Err(fail(if why.is_empty() { status.to_string() } else { why }));
+ }
+ Ok(None) if started.elapsed() < WAIT => std::thread::sleep(std::time::Duration::from_millis(20)),
+ Ok(None) => {
+ // Reaped off the UI thread once it ends.
+ std::thread::spawn(move || {
+ let _ = child.wait();
+ });
+ return Ok(true);
+ }
+ Err(e) => return Err(fail(e.to_string())),
+ }
+ }
+ }
+ #[cfg(not(target_os = "macos"))]
+ c.spawn().map(|_| true).map_err(|e| format!("can't open {path} in {}: {e}", app.display()))
+}
+
+/// PhotoCraft where it is installed: the first of [`photocraft_candidates`] that is an application.
+pub(crate) fn find_photocraft(home: Option<&std::path::Path>, path_var: Option<&std::ffi::OsStr>) -> Option {
+ photocraft_candidates(home, path_var).into_iter().find(|p| check_app(p).is_ok())
+}
+
+/// Where PhotoCraft may be installed: the Applications folders on macOS; on Windows where its
+/// installer puts it ([`windows_candidates`]); else a `photocraft` program on the `PATH`.
+pub(crate) fn photocraft_candidates(home: Option<&std::path::Path>, path_var: Option<&std::ffi::OsStr>) -> Vec {
+ if cfg!(target_os = "macos") {
+ let mut v = vec![std::path::PathBuf::from("/Applications/PhotoCraft.app")];
+ v.extend(home.map(|h| h.join("Applications/PhotoCraft.app")));
+ return v;
+ }
+ let name = if cfg!(windows) { "photocraft.exe" } else { "photocraft" };
+ let on_path = path_var.map(|p| std::env::split_paths(p).map(|dir| dir.join(name)).collect()).unwrap_or_default();
+ if cfg!(windows) {
+ let folders: Vec = [
+ std::env::var_os("LOCALAPPDATA").map(|d| std::path::PathBuf::from(d).join("Programs")),
+ std::env::var_os("ProgramW6432").map(std::path::PathBuf::from),
+ std::env::var_os("ProgramFiles").map(std::path::PathBuf::from),
+ ]
+ .into_iter()
+ .flatten()
+ .collect();
+ return windows_candidates(registered_photocraft(), &folders, on_path);
+ }
+ on_path
+}
+
+/// Windows: PhotoCraft's installer puts it in `ArtCraft\PhotoCraft` under a folder of
+/// `program_folders` (for the current user `%LOCALAPPDATA%\Programs`, for everyone Program Files)
+/// and registers its path under App Paths, which also covers a folder chosen in setup. So: the
+/// `registered` paths first, then those folders, then `on_path`.
+pub(crate) fn windows_candidates(
+ registered: Vec,
+ program_folders: &[std::path::PathBuf],
+ on_path: Vec,
+) -> Vec {
+ let mut v = registered;
+ for f in program_folders {
+ let p = f.join("ArtCraft").join("PhotoCraft").join("photocraft.exe");
+ if !v.contains(&p) {
+ v.push(p);
+ }
+ }
+ v.extend(on_path);
+ v
+}
+
+/// The paths PhotoCraft's installer registers under App Paths, for the current user and then for
+/// everyone.
+#[cfg(windows)]
+fn registered_photocraft() -> Vec {
+ use windows::Win32::System::Registry::{HKEY_CURRENT_USER, HKEY_LOCAL_MACHINE};
+ [HKEY_CURRENT_USER, HKEY_LOCAL_MACHINE]
+ .into_iter()
+ .filter_map(|hive| registry_default_path(hive, r"Software\Microsoft\Windows\CurrentVersion\App Paths\photocraft.exe"))
+ .collect()
+}
+
+#[cfg(not(windows))]
+fn registered_photocraft() -> Vec {
+ Vec::new()
+}
+
+/// The default `REG_SZ` value of `subkey` under `hive` as a path ([`registered_path`]), or `None`
+/// when the key or the value is missing. The value is read as UTF-16, so a folder name in any
+/// script comes back as stored.
+#[cfg(windows)]
+#[allow(unsafe_code)]
+fn registry_default_path(hive: windows::Win32::System::Registry::HKEY, subkey: &str) -> Option {
+ use windows::Win32::System::Registry::{RRF_RT_REG_SZ, RegGetValueW};
+ use windows::core::PCWSTR;
+ let subkey: Vec = subkey.encode_utf16().chain([0]).collect();
+ let mut size = 0u32;
+ // SAFETY: `subkey` is a NUL-terminated UTF-16 string that outlives the call, a null value name
+ // reads the default value, and with no buffer the call only writes the value's size to `size`.
+ unsafe { RegGetValueW(hive, PCWSTR(subkey.as_ptr()), PCWSTR::null(), RRF_RT_REG_SZ, None, None, Some(&mut size)) }.ok().ok()?;
+ let mut value = vec![0u16; (size as usize).div_ceil(2)];
+ let mut size = u32::try_from(value.len() * 2).ok()?;
+ // SAFETY: as above, and `value` holds the `size` bytes the call may write.
+ unsafe { RegGetValueW(hive, PCWSTR(subkey.as_ptr()), PCWSTR::null(), RRF_RT_REG_SZ, None, Some(value.as_mut_ptr().cast()), Some(&mut size)) }
+ .ok()
+ .ok()?;
+ registered_path(&value)
+}
+
+/// The path in a registry string value read as UTF-16, up to its first NUL, without surrounding
+/// spaces or quotes, like `C:\Program Files\ArtCraft\PhotoCraft\photocraft.exe`.
+#[cfg_attr(not(any(windows, test)), allow(dead_code))]
+pub(crate) fn registered_path(value: &[u16]) -> Option {
+ let end = value.iter().position(|&c| c == 0).unwrap_or(value.len());
+ let text = String::from_utf16(&value[..end]).ok()?;
+ Some(text.trim().trim_matches('"')).filter(|v| !v.is_empty()).map(std::path::PathBuf::from)
+}
+
+/// Is `app` an application Edit Original may start: an `.app` bundle on macOS, an `.exe` on
+/// Windows, an executable file elsewhere? Anything else (a document, a folder, a script on
+/// Windows) found where PhotoCraft installs is not taken for it.
+pub(crate) fn check_app(app: &std::path::Path) -> Result<(), String> {
+ let ext = app.extension().map(|e| e.to_string_lossy().to_ascii_lowercase()).unwrap_or_default();
+ let ok = if cfg!(target_os = "macos") {
+ ext == "app" && app.is_dir()
+ } else if cfg!(windows) {
+ ext == "exe" && app.is_file()
+ } else {
+ executable_file(app)
+ };
+ if ok { Ok(()) } else { Err(format!("{} isn't an application Edit Original can open files in", app.display())) }
+}
+
+#[cfg(unix)]
+fn executable_file(p: &std::path::Path) -> bool {
+ use std::os::unix::fs::PermissionsExt as _;
+ std::fs::metadata(p).is_ok_and(|m| m.is_file() && m.permissions().mode() & 0o111 != 0)
+}
+
+#[cfg(not(unix))]
+fn executable_file(p: &std::path::Path) -> bool {
+ p.is_file()
+}
+
+#[cfg(test)]
+mod open_with_tests {
+ use super::{check_app, find_photocraft, photocraft_candidates, registered_path, windows_candidates};
+
+ /// A fresh, empty folder under the system's temporary folder.
+ fn scratch(name: &str) -> std::path::PathBuf {
+ let d = std::env::temp_dir().join(format!("vc-open-with-{name}-{}", std::process::id()));
+ let _ = std::fs::remove_dir_all(&d);
+ std::fs::create_dir_all(&d).unwrap();
+ d
+ }
+
+ /// #5236: only an application counts as PhotoCraft, never a document, a folder or a missing
+ /// path.
+ #[test]
+ fn only_applications_are_started() {
+ let d = scratch("check");
+ let doc = d.join("notes.txt");
+ std::fs::write(&doc, "hi").unwrap();
+ assert!(check_app(&doc).is_err(), "a document");
+ assert!(check_app(&d).is_err(), "a folder");
+ assert!(check_app(&d.join("Missing.app")).is_err(), "a missing path");
+ if cfg!(target_os = "macos") {
+ let app = d.join("Editor.app");
+ std::fs::create_dir_all(&app).unwrap();
+ assert!(check_app(&app).is_ok(), "an .app bundle");
+ }
+ #[cfg(all(unix, not(target_os = "macos")))]
+ {
+ use std::os::unix::fs::PermissionsExt as _;
+ let tool = d.join("editor");
+ std::fs::write(&tool, "#!/bin/sh\n").unwrap();
+ assert!(check_app(&tool).is_err(), "not executable yet");
+ std::fs::set_permissions(&tool, std::fs::Permissions::from_mode(0o755)).unwrap();
+ assert!(check_app(&tool).is_ok(), "an executable file");
+ }
+ let _ = std::fs::remove_dir_all(&d);
+ }
+
+ /// PhotoCraft is looked for only where it installs.
+ #[test]
+ fn photocraft_is_found_where_it_installs() {
+ let d = scratch("find");
+ if cfg!(target_os = "macos") {
+ let candidates = photocraft_candidates(Some(&d), None);
+ assert_eq!(candidates.first().map(|p| p.to_string_lossy().into_owned()).as_deref(), Some("/Applications/PhotoCraft.app"));
+ assert!(candidates.contains(&d.join("Applications/PhotoCraft.app")), "{candidates:?}");
+ std::fs::create_dir_all(d.join("Applications/PhotoCraft.app")).unwrap();
+ assert!(find_photocraft(Some(&d), None).unwrap().ends_with("PhotoCraft.app"));
+ } else {
+ let bin = d.join("bin");
+ std::fs::create_dir_all(&bin).unwrap();
+ let path_var = std::env::join_paths([&bin]).unwrap();
+ // On Windows an installed PhotoCraft (registered, or in a program folder) comes first, so
+ // there only the `PATH` candidate is checked.
+ if !cfg!(windows) {
+ assert!(find_photocraft(None, Some(&path_var)).is_none(), "not installed");
+ }
+ let exe = bin.join(if cfg!(windows) { "photocraft.exe" } else { "photocraft" });
+ std::fs::write(&exe, "").unwrap();
+ #[cfg(unix)]
+ {
+ use std::os::unix::fs::PermissionsExt as _;
+ std::fs::set_permissions(&exe, std::fs::Permissions::from_mode(0o755)).unwrap();
+ }
+ if cfg!(windows) {
+ assert_eq!(photocraft_candidates(None, Some(&path_var)).last(), Some(&exe));
+ assert!(check_app(&exe).is_ok());
+ } else {
+ assert_eq!(find_photocraft(None, Some(&path_var)), Some(exe));
+ }
+ }
+ let _ = std::fs::remove_dir_all(&d);
+ }
+
+ /// #5327 review: on Windows PhotoCraft is looked for where its installer puts it: the path it
+ /// registers, then `ArtCraft\PhotoCraft` in the per-user and per-machine program folders, then
+ /// the `PATH`.
+ #[test]
+ fn windows_looks_where_the_photocraft_installer_puts_it() {
+ use std::path::PathBuf;
+ let registered = vec![PathBuf::from("D:/Tools/PhotoCraft/photocraft.exe")];
+ let folders = [PathBuf::from("C:/Users/me/AppData/Local/Programs"), PathBuf::from("C:/Program Files"), PathBuf::from("C:/Program Files")];
+ let on_path = vec![PathBuf::from("C:/bin/photocraft.exe")];
+ let exe = |f: &str| PathBuf::from(f).join("ArtCraft").join("PhotoCraft").join("photocraft.exe");
+ assert_eq!(
+ windows_candidates(registered, &folders, on_path),
+ [
+ PathBuf::from("D:/Tools/PhotoCraft/photocraft.exe"),
+ exe("C:/Users/me/AppData/Local/Programs"),
+ exe("C:/Program Files"),
+ PathBuf::from("C:/bin/photocraft.exe"),
+ ]
+ );
+ }
+
+ /// The registered path is read from the UTF-16 value up to its NUL, spaces, quotes and
+ /// characters outside ASCII included; an empty value or one that is not UTF-16 gives no path.
+ #[test]
+ fn the_registered_path_is_read_from_the_utf16_value() {
+ let wide = |s: &str| s.encode_utf16().chain([0, 0]).collect::>();
+ assert_eq!(
+ registered_path(&wide(r"C:\Program Files\ArtCraft\PhotoCraft\photocraft.exe")),
+ Some(std::path::PathBuf::from(r"C:\Program Files\ArtCraft\PhotoCraft\photocraft.exe"))
+ );
+ assert_eq!(
+ registered_path(&wide(" \"C:\\Prögram Fïles\\Тест\\写真\\photocraft.exe\" ")),
+ Some(std::path::PathBuf::from(r"C:\Prögram Fïles\Тест\写真\photocraft.exe"))
+ );
+ assert_eq!(registered_path(&wide("")), None);
+ assert_eq!(registered_path(&[0xD800, 0]), None);
+ }
+
+ /// On Windows a registered path with characters outside the console's code page is read as
+ /// stored, from a scratch key under the current user's hive.
+ #[cfg(windows)]
+ #[test]
+ fn a_registered_path_outside_ascii_is_read_as_stored() {
+ let key = format!(r"Software\VectorCraftTest-app-paths-{}", std::process::id());
+ let path = r"C:\Prögram Fïles\Тест\写真\photocraft.exe";
+ let reg = std::env::var_os("SystemRoot").map(std::path::PathBuf::from).unwrap_or_else(|| r"C:\Windows".into()).join(r"System32\reg.exe");
+ let full = format!(r"HKCU\{key}");
+ let added = std::process::Command::new(®).args(["add", &full, "/ve", "/t", "REG_SZ", "/d", path, "/f"]).output().unwrap();
+ assert!(added.status.success(), "{added:?}");
+ let read = super::registry_default_path(windows::Win32::System::Registry::HKEY_CURRENT_USER, &key);
+ let _ = std::process::Command::new(®).args(["delete", &full, "/f"]).output();
+ assert_eq!(read, Some(std::path::PathBuf::from(path)));
+ assert_eq!(super::registry_default_path(windows::Win32::System::Registry::HKEY_CURRENT_USER, &key), None, "deleted");
+ }
+}
+
+#[cfg(test)]
+mod dialog_tests {
+ use super::{CASE_SENSITIVE_FILTERS, DialogSettings, FilePick, PickRequest, dialog_for, fileio, open_extensions};
+
+ /// The file types a dialog was given, by label.
+ #[derive(Default)]
+ struct Filters(Vec<(String, Vec)>);
+
+ impl DialogSettings for Filters {
+ fn parent(self, _window: &winit::window::Window) -> Self {
+ self
+ }
+ fn title(self, _title: &str) -> Self {
+ self
+ }
+ fn filter(mut self, name: &str, exts: &[impl ToString]) -> Self {
+ self.0.push((name.to_string(), exts.iter().map(ToString::to_string).collect()));
+ self
+ }
+ fn folder(self, _folder: &str) -> Self {
+ self
+ }
+ fn file_name(self, _name: &str) -> Self {
+ self
+ }
+ }
+
+ /// Does the case-sensitive pattern `*.{ext}` match `name`? `ext` may hold literal characters,
+ /// `*` and `[..]` sets.
+ fn matches(ext: &str, name: &str) -> bool {
+ fn here(p: &[char], n: &[char]) -> bool {
+ match p.split_first() {
+ None => n.is_empty(),
+ Some(('*', rest)) => (0..=n.len()).any(|i| here(rest, &n[i..])),
+ Some(('[', rest)) => {
+ let Some(end) = rest.iter().position(|&c| c == ']') else { return false };
+ n.split_first().is_some_and(|(c, n)| rest[..end].contains(c) && here(&rest[end + 1..], n))
+ }
+ Some((c, rest)) => n.split_first().is_some_and(|(d, n)| d == c && here(rest, n)),
+ }
+ }
+ let pattern: Vec = format!("*.{ext}").chars().collect();
+ here(&pattern, &name.chars().collect::>())
+ }
+
+ /// Where filters match case-sensitively, every extension of File › Open and Place lists files
+ /// whose extension is in capitals or mixed case, `image.DIB` and `image.Pns` included.
+ #[test]
+ fn open_and_place_filters_list_extensions_in_any_case() {
+ let all = fileio::open_filters().chain(fileio::place_filters());
+ for (label, exts) in all {
+ let patterns = open_extensions(exts, true);
+ for ext in exts {
+ let mut mixed = ext.to_ascii_uppercase();
+ mixed.replace_range(..1, &ext[..1]);
+ for name in [format!("a.{ext}"), format!("a.{}", ext.to_ascii_uppercase()), format!("a.{mixed}")] {
+ assert!(patterns.iter().any(|p| matches(p, &name)), "{label}: {patterns:?} don't match {name}");
+ }
+ }
+ }
+ assert_eq!(open_extensions(&["dib", "jp2", "*"], true), ["dib", "[dD][iI][bB]", "jp2", "[jJ][pP]2", "*"]);
+ assert_eq!(open_extensions(&["dib", "PNS"], false), ["dib", "PNS"]);
+ }
+
+ /// Open and Place dialogs get the any-case patterns on Linux and the BSDs; a save dialog's file
+ /// types stay as listed.
+ #[test]
+ fn open_dialogs_get_any_case_patterns_where_filters_are_case_sensitive() {
+ let dib = vec![FilePick::filter("BMP", &["bmp", "dib"])];
+ let pick = FilePick { filters: dib.clone(), ..Default::default() };
+ let expected = |any_case: bool| open_extensions(&["bmp", "dib"], any_case);
+ let opened = dialog_for(Filters::default(), &PickRequest::Open(pick.clone())).0;
+ assert_eq!(opened[0].1, expected(CASE_SENSITIVE_FILTERS));
+ let saved = dialog_for(Filters::default(), &PickRequest::Save(pick)).0;
+ assert_eq!(saved, dib);
+ let placed = dialog_for(Filters::default(), &PickRequest::OpenMany).0;
+ let first = fileio::place_filters().next().map(|(_, exts)| open_extensions(exts, CASE_SENSITIVE_FILTERS));
+ assert_eq!(placed.first().map(|(_, exts)| exts.clone()), first);
+ }
+}
diff --git a/apps/vectorcraft/src/mac_tablet.rs b/apps/vectorcraft/src/mac_tablet.rs
index b624262aa4..1d9aabd442 100644
--- a/apps/vectorcraft/src/mac_tablet.rs
+++ b/apps/vectorcraft/src/mac_tablet.rs
@@ -1,6 +1,7 @@
-//! macOS: a drawing tablet's pen pressure (#852). winit 0.30 hands a pen to the window there as a
-//! mouse, without its pressure, so the app reads it from AppKit itself and writes it into the UI's
-//! [`StylusFeed`] (`Services::stylus`), which the canvas reads, as on X11 ([`crate::tablet`]).
+//! macOS: a drawing tablet's pen pressure (#852), tilt and barrel rotation (#764). winit 0.30
+//! hands a pen to the window there as a mouse, without them, so the app reads them from AppKit
+//! itself and writes them into the UI's [`StylusFeed`] (`Services::stylus`), which the canvas
+//! reads, as on X11 ([`crate::tablet`]).
//!
//! A local event monitor (`addLocalMonitorForEventsMatchingMask:handler:`, which AppKit calls "with
//! each event it is about to dispatch" in this app:
@@ -9,9 +10,14 @@
//! it on unchanged:
//! - A mouse event whose `subtype` is `NSEventSubtypeTabletPoint` comes from a pen: its `pressure`
//! (0..1) goes into the feed, kept for the pointer move winit makes of the event
-//! ([`StylusFeed::set_move`]), so each move of a fast stroke has its own pressure. A mouse event
-//! of any other subtype is a mouse's or a trackpad's: the feed is set to `None`.
-//! - An `NSEventTypeTabletPoint` event carries the same pressure without a move.
+//! ([`StylusFeed::set_move`]), so each move of a fast stroke has its own pressure. Its `tilt`
+//! (−1..1 on each axis, ±[`TILT_DEGREES`] at the ends) and its `rotation` go into the feed as the
+//! pen's pose, kept for that move too. AppKit gives a rotation of 0 for a pen that does not read
+//! one and a tilt of 0 for an upright pen, so one event cannot tell a pen without tilt or rotation
+//! from one held upright and unturned. Each reads as none until the pen reports a value other
+//! than 0 after it comes near ([`Pen`]).
+//! A mouse event of any other subtype is a mouse's or a trackpad's: the feed is set to `None`.
+//! - An `NSEventTypeTabletPoint` event carries the same pressure, tilt and rotation without a move.
//! - A tablet proximity event (`NSEventTypeTabletProximity`, or a mouse event of that subtype) says
//! which end of the pen came near (`pointingDeviceType`): the eraser end's samples are marked so,
//! and the canvas switches to the Eraser tool ([`vectorcraft_ui_egui::stylus`]). A puck
@@ -20,12 +26,14 @@
//! The monitor also turns off mouse event coalescing (`NSEvent.mouseCoalescingEnabled`), which
//! merges the drags that queue up between two reads into one: every report of the pen arrives.
//!
-//! The mapping comes from PhotoCraft's `crates/tablet` (`appkit.rs` and `macos.rs`), with the
-//! pressure and the pen's end only. It is plain values, tested on every platform; the monitor
-//! reads them.
+//! The event mapping comes from PhotoCraft's `crates/tablet` (`appkit.rs` and `macos.rs`). The tilt
+//! and rotation follow Apple's `NSEvent` documentation, as [`RawEvent::pose`] describes. The mapping
+//! works on plain values and is tested on every platform; the monitor reads them.
#![cfg_attr(not(target_os = "macos"), allow(dead_code))]
-use vectorcraft_ui_egui::stylus::{PenSample, StylusFeed};
+use vectorcraft_ui_egui::stylus::{PenPose, PenSample, StylusFeed};
+
+use crate::tablet::TILT_DEGREES;
/// `NSEventType` values (AppKit headers).
mod event_type {
@@ -56,6 +64,10 @@ struct RawEvent {
subtype: i16,
/// `pressure` (tablet point events and mouse events of that subtype only).
pressure: f32,
+ /// `tilt` (x, y), each −1..1 (the same events as `pressure`).
+ tilt: (f64, f64),
+ /// `rotation`, in degrees (the same events as `pressure`).
+ rotation: f32,
/// `pointingDeviceType` (proximity events only).
device: usize,
/// `isEnteringProximity` (proximity events only).
@@ -74,6 +86,40 @@ impl RawEvent {
fn point(&self) -> bool {
self.kind == event_type::TABLET_POINT || (self.mouse() && self.subtype == subtype::TABLET_POINT)
}
+
+ /// The pen's tilt and rotation in [`PenPose`]'s units.
+ ///
+ /// AppKit's `tilt` is −1.0..1.0 on each axis and 0.0 on both with the pen perpendicular to the
+ /// tablet. A negative x is a tilt to the left and a positive x a tilt to the right; a negative y
+ /// is a tilt to the top and a positive y a tilt to the bottom
+ /// (). [`PenPose`]'s x is positive
+ /// to the right and its y positive down the page, the same signs, so each axis keeps its sign.
+ /// Apple gives the ends of the range as maximum tilt and does not give them in degrees
+ /// (), so
+ /// ±1.0 is scaled to ±[`TILT_DEGREES`], the degrees the X11 reader ([`crate::tablet`]) gives the
+ /// ends of a tilt range that is not in degrees. A value past ±1.0 is clamped.
+ ///
+ /// AppKit's `rotation` is in degrees, and a device without rotation reports 0.0
+ /// (). Apple's tablet pages give
+ /// no direction for rotation; the Cocoa Event Handling Guide gives the `rotation` accessor's
+ /// degrees as counterclockwise for the rotate gesture
+ /// (),
+ /// and the pen's rotation is taken the same way. [`PenPose`]'s rotation runs clockwise, so the
+ /// angle is negated and brought into 0..360.
+ ///
+ /// The tilt is left out unless `tilts`, and the rotation unless `turns` ([`Pen`]).
+ fn pose(&self, tilts: bool, turns: bool) -> PenPose {
+ let degrees = |v: f64| (v.clamp(-1.0, 1.0) * TILT_DEGREES) as f32;
+ // `0.0 - r` rather than `-r`: a rotation of 0 gives 0, not −0.
+ let rotation = turns.then(|| (0.0 - self.rotation).rem_euclid(360.0));
+ PenPose { tilt: tilts.then(|| [degrees(self.tilt.0), degrees(self.tilt.1)]), rotation }
+ }
+
+ /// Whether the event reports a tilt other than 0, and a rotation other than 0.
+ fn reads(&self) -> (bool, bool) {
+ let read = |v: f64| v.is_finite() && v != 0.0;
+ (read(self.tilt.0) || read(self.tilt.1), read(f64::from(self.rotation)))
+ }
}
/// The events the monitor reads (`NSEventMask` bits are `1 << type`).
@@ -86,7 +132,7 @@ fn event_mask() -> u64 {
enum Update {
/// Nothing: an event the monitor doesn't map.
Keep,
- /// The pressure and end of a pen, or `None` for a mouse.
+ /// The sample of a pen, or `None` for a mouse.
Set(Option),
/// A pen's sample that comes with a pointer move.
Move(PenSample),
@@ -102,10 +148,14 @@ impl Update {
}
}
-/// Which end of the pen is near the tablet.
+/// Which end of the pen is near the tablet, and whether it has reported a tilt or a rotation other
+/// than 0 since it came near: until it has, its tilt or rotation reads as none, since AppKit gives
+/// 0 for a pen without one and for one held upright or unturned.
#[derive(Clone, Copy, Debug, Default, PartialEq)]
struct Pen {
eraser: bool,
+ tilts: bool,
+ turns: bool,
}
impl Pen {
@@ -113,10 +163,16 @@ impl Pen {
if e.proximity() {
// Entering with the tip or the eraser end: it hovers. A puck, or leaving, is a mouse.
self.eraser = e.entering && e.device == device::ERASER;
+ (self.tilts, self.turns) = (false, false);
let pen = e.entering && e.device != device::CURSOR;
- return Update::Set(pen.then_some(PenSample { pressure: 0.0, eraser: self.eraser }));
+ return Update::Set(pen.then_some(PenSample { pressure: 0.0, eraser: self.eraser, ..PenSample::default() }));
}
- let sample = PenSample { pressure: e.pressure, eraser: self.eraser };
+ if e.point() {
+ let (tilts, turns) = e.reads();
+ self.tilts |= tilts;
+ self.turns |= turns;
+ }
+ let sample = PenSample { pressure: e.pressure, eraser: self.eraser, pose: e.pose(self.tilts, self.turns) };
match (e.point(), e.mouse()) {
(true, true) => Update::Move(sample),
(true, false) => Update::Set(Some(sample)),
@@ -187,6 +243,9 @@ mod monitor {
}
if raw.point() {
raw.pressure = e.pressure();
+ let tilt = e.tilt();
+ raw.tilt = (tilt.x, tilt.y);
+ raw.rotation = e.rotation();
}
if raw.proximity() {
raw.device = e.pointingDeviceType().0;
@@ -211,8 +270,14 @@ mod tests {
RawEvent { kind: event_type::TABLET_PROXIMITY, device, entering, ..Default::default() }
}
+ /// A sample of the tip of a pen that has reported no tilt or rotation.
fn tip(pressure: f32) -> PenSample {
- PenSample { pressure, eraser: false }
+ PenSample { pressure, eraser: false, pose: PenPose::default() }
+ }
+
+ /// A sample of the pen near the tablet but not yet read: no pose.
+ fn near(eraser: bool) -> PenSample {
+ PenSample { pressure: 0.0, eraser, pose: PenPose::default() }
}
#[test]
@@ -240,16 +305,45 @@ mod tests {
#[test]
fn proximity_says_which_end_is_near() {
let mut p = Pen::default();
- let eraser = |pressure| PenSample { pressure, eraser: true };
- assert_eq!(p.handle(&proximity(device::ERASER, true)), Update::Set(Some(eraser(0.0))));
+ let eraser = |pressure| PenSample { pressure, eraser: true, pose: PenPose::default() };
+ assert_eq!(p.handle(&proximity(device::ERASER, true)), Update::Set(Some(near(true))));
assert_eq!(p.handle(&pen(DRAG, 0.4)), Update::Move(eraser(0.4)));
assert_eq!(p.handle(&proximity(device::ERASER, false)), Update::Set(None), "it left");
assert_eq!(p.handle(&pen(DRAG, 0.4)), Update::Move(tip(0.4)));
- assert_eq!(p.handle(&proximity(1, true)), Update::Set(Some(tip(0.0))), "the tip");
- assert_eq!(p.handle(&proximity(0, true)), Update::Set(Some(tip(0.0))), "an unknown tool draws as the tip");
+ assert_eq!(p.handle(&proximity(1, true)), Update::Set(Some(near(false))), "the tip");
+ assert_eq!(p.handle(&proximity(0, true)), Update::Set(Some(near(false))), "an unknown tool draws as the tip");
assert_eq!(p.handle(&proximity(device::CURSOR, true)), Update::Set(None), "a puck is a mouse");
let e = RawEvent { kind: 5, subtype: subtype::TABLET_PROXIMITY, device: device::ERASER, entering: true, ..Default::default() };
- assert_eq!(p.handle(&e), Update::Set(Some(eraser(0.0))), "as a mouse event's subtype");
+ assert_eq!(p.handle(&e), Update::Set(Some(near(true))), "as a mouse event's subtype");
+ }
+
+ /// #764: AppKit's tilt (−1..1, x positive to the right, y positive to the bottom) reaches the
+ /// feed in degrees with the same signs, and its rotation, taken as counterclockwise, reaches it
+ /// clockwise.
+ #[test]
+ fn a_pens_tilt_and_rotation_go_into_the_feed() {
+ let mut p = Pen::default();
+ let sample = |pressure, pose| PenSample { pressure, eraser: false, pose };
+ assert_eq!(p.handle(&pen(DRAG, 0.5)), Update::Move(tip(0.5)), "no tilt or rotation reported yet");
+ let leaning = RawEvent { tilt: (0.5, -0.25), rotation: 30.0, ..pen(DRAG, 0.5) };
+ let pose = PenPose { tilt: Some([30.0, -15.0]), rotation: Some(330.0) };
+ assert_eq!(p.handle(&leaning), Update::Move(sample(0.5, pose)));
+ let past_the_ends = RawEvent { tilt: (-4.0, 1.5), rotation: 270.0, ..pen(event_type::TABLET_POINT, 0.8) };
+ let pose = PenPose { tilt: Some([-60.0, 60.0]), rotation: Some(90.0) };
+ assert_eq!(p.handle(&past_the_ends), Update::Set(Some(sample(0.8, pose))), "clamped");
+ let pose = PenPose { tilt: Some([0.0, 0.0]), rotation: Some(0.0) };
+ let Update::Move(upright) = p.handle(&pen(DRAG, 0.6)) else { panic!("a pen's drag is a move") };
+ assert_eq!(upright, sample(0.6, pose), "once reported, 0 is upright and unturned");
+ assert!(upright.pose.rotation.is_some_and(f32::is_sign_positive), "{upright:?}");
+ let feed = StylusFeed::default();
+ p.handle(&RawEvent { tilt: (f64::NAN, 0.0), rotation: -90.0, ..pen(DRAG, 0.3) }).apply(&feed);
+ assert_eq!(feed.pose(), Some(PenPose { tilt: None, rotation: Some(90.0) }), "a tilt that is not a number is left out");
+ p.handle(&proximity(1, true));
+ let tilted = RawEvent { tilt: (0.0, 0.5), ..pen(event_type::TABLET_POINT, 0.8) };
+ let pose = PenPose { tilt: Some([0.0, 30.0]), rotation: None };
+ assert_eq!(p.handle(&tilted), Update::Set(Some(sample(0.8, pose))), "no rotation reported since the pen came near");
+ p.handle(&RawEvent { kind: DRAG, ..Default::default() }).apply(&feed);
+ assert_eq!(feed.pose(), None, "a mouse moved");
}
#[test]
@@ -259,7 +353,8 @@ mod tests {
for e in [pen(DRAG, f32::NAN), pen(DRAG, 4.0), pen(DRAG, -1.0), pen(event_type::TABLET_POINT, 0.3)] {
p.handle(&e).apply(&feed);
}
- assert_eq!((feed.take_moves(), feed.held()), (vec![1.0, 1.0, 0.0], Some(0.3)));
+ let pressures: Vec = feed.take_moves().into_iter().map(|(p, _)| p).collect();
+ assert_eq!((pressures, feed.held()), (vec![1.0, 1.0, 0.0], Some(0.3)));
p.handle(&RawEvent { kind: DRAG, ..Default::default() }).apply(&feed);
assert_eq!(feed.held(), None, "a mouse moved");
}
diff --git a/apps/vectorcraft/src/portal_save.rs b/apps/vectorcraft/src/portal_save.rs
index b6dd3cc8e9..0357829aec 100644
--- a/apps/vectorcraft/src/portal_save.rs
+++ b/apps/vectorcraft/src/portal_save.rs
@@ -96,6 +96,12 @@ fn answer(code: u32, results: &HashMap) -> Result