diff --git a/.github/workflows/print.yml b/.github/workflows/print.yml
index 400a819442..058705ce29 100644
--- a/.github/workflows/print.yml
+++ b/.github/workflows/print.yml
@@ -13,27 +13,27 @@ on:
workflow_dispatch:
permissions:
contents: read
-env:
- CARGO_TERM_COLOR: always
- CARGO_INCREMENTAL: 0
+# A newer push to a PR branch cancels its older run.
+concurrency:
+ group: print-${{ github.ref }}
+ cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
+ # Desktop printing on Windows, through the suite's shared gate. Pull requests restore the cache
+ # but never save one; a manual run on main saves the cache they restore.
windows:
- runs-on: windows-2022
- timeout-minutes: 90
- steps:
- - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- - uses: dtolnay/rust-toolchain@e2a55d2ffb04f378e9626c28d38b36d230d1e12f # master
- with:
- toolchain: stable
- components: clippy
- - uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
- with:
- key: desktop-print
- - run: cargo clippy --locked -p vectorcraft --all-targets -- -D warnings
- - run: cargo test --locked -p vectorcraft
- - name: Check pending submission and queue refusal feedback
- shell: bash
- # A filter that matches nothing still passes, so fail unless some test ran.
- run: |
- cargo test --locked -p vectorcraft-ui-egui --lib -- tests::printps | tee printps.log
- grep -Eq 'test result: ok\. [1-9][0-9]* passed' printps.log || { echo "::error::tests::printps matched no tests"; exit 1; }
+ # Tracks @main so suite-wide CI fixes reach every app without a PR in each repository.
+ uses: storytold/craft-common-actions/.github/workflows/gate.yml@main
+ with:
+ os: '["windows-2022"]'
+ timeout-minutes: 90
+ # As before: printing builds and tests without craft-fonts, nextest or the wasm target.
+ craft-fonts-ref: ""
+ tools: ""
+ targets: ""
+ # A filter that matches nothing still passes, so the printps run fails unless some test ran.
+ command: |
+ cargo clippy --locked -p vectorcraft --all-targets -- -D warnings
+ cargo test --locked -p vectorcraft
+ log="$RUNNER_TEMP/printps.log"
+ cargo test --locked -p vectorcraft-ui-egui --lib -- tests::printps | tee "$log"
+ grep -Eq 'test result: ok\. [1-9][0-9]* passed' "$log" || { echo "::error::tests::printps matched no tests"; exit 1; }
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index d1677e538c..07b3c6b7fe 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -63,6 +63,7 @@ jobs:
needs: git-sources
permissions:
contents: write
+ packages: write
# Intentionally tracked at @main (not SHA-pinned) so org-wide CI improvements, security fixes, and build optimizations propagate without PR churn across all craftapp repos.
uses: storytold/craft-common-actions/.github/workflows/release.yml@main
with:
diff --git a/ASSETS.md b/ASSETS.md
index 5bebefae63..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 | |
@@ -345,6 +348,9 @@ Generated-in-code art is original and has no file to list. This covers the defau
| `examples/ribbons.vectorcraft` | VectorCraft contributors | Original artwork built through the VectorCraft command API | MIT OR Apache-2.0 | |
| `examples/feature-sheet.vectorcraft` | VectorCraft contributors | Original artwork built through the VectorCraft command API | MIT OR Apache-2.0 | |
| `examples/perspective-city.vectorcraft` | VectorCraft contributors | Original artwork built through the VectorCraft command API | MIT OR Apache-2.0 | |
+| `crates/engine/tests/fixtures/jpeg2000/checker.jp2` | VectorCraft contributors | Original test image authored for VectorCraft's tests | MIT OR Apache-2.0 | a 2 × 2 checker encoded with FFmpeg's JPEG 2000 encoder; SHA-256 `3de9c2bb5b8aaec241d939b795002a68eb3d50e41d51c43368000804ad3de057` |
+| `crates/engine/tests/fixtures/jpeg2000/checker-raw.j2k` | VectorCraft contributors | Original test image authored for VectorCraft's tests | MIT OR Apache-2.0 | a 2 × 2 checker encoded with FFmpeg's JPEG 2000 encoder; SHA-256 `76fa51ab8ccbc2534098b26b8e7fe16dd886e2b6298ba52d06a6b1bde9b61d9e` |
+| `crates/engine/tests/fixtures/jpeg2000/checker-300ppi.jp2` | VectorCraft contributors | Original test image authored for VectorCraft's tests | MIT OR Apache-2.0 | a 2 × 2 checker encoded with FFmpeg's JPEG 2000 encoder; SHA-256 `1b1aeed8975d3cdc832da6ecf5855852d07d0c490105121e61a8aefb31af009b` |
## Assets embedded by the PDF backend
@@ -352,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 a1512c6d0d..ae8a3ee6c7 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -705,6 +705,17 @@ dependencies = [
"shlex",
]
+[[package]]
+name = "cfb"
+version = "0.15.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0f13298d9178622b7916ec5d01d470425c04273c8ed07e87b1c38b34c4f4612b"
+dependencies = [
+ "fnv",
+ "uuid",
+ "web-time",
+]
+
[[package]]
name = "cfg-if"
version = "1.0.5"
@@ -959,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",
@@ -992,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",
@@ -1002,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",
@@ -1013,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",
@@ -1026,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",
@@ -1070,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",
@@ -1940,6 +1963,16 @@ dependencies = [
"wasm-bindgen",
]
+[[package]]
+name = "gif"
+version = "0.13.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4ae047235e33e2829703574b54fdec96bfbad892062d97fed2f76022287de61b"
+dependencies = [
+ "color_quant",
+ "weezl 0.1.12",
+]
+
[[package]]
name = "gif"
version = "0.14.2"
@@ -2173,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",
@@ -2182,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",
@@ -2200,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",
@@ -2218,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",
@@ -2233,7 +2266,7 @@ dependencies = [
"rustc-hash 2.1.3",
"smallvec",
"stringprep",
- "zune-jpeg",
+ "zune-jpeg 0.5.15",
]
[[package]]
@@ -2609,14 +2642,14 @@ dependencies = [
"bytemuck",
"byteorder-lite",
"color_quant",
- "gif",
+ "gif 0.14.2",
"image-webp",
"moxcms",
"num-traits",
"png 0.18.1",
"tiff",
- "zune-core",
- "zune-jpeg",
+ "zune-core 0.5.3",
+ "zune-jpeg 0.5.15",
]
[[package]]
@@ -2831,13 +2864,13 @@ 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",
"flate2",
"float-cmp",
- "gif",
+ "gif 0.14.2",
"image-webp",
"imagesize 0.14.0",
"indexmap",
@@ -2852,7 +2885,7 @@ dependencies = [
"tiny-skia-path 0.12.0",
"xmp-writer",
"yoke",
- "zune-jpeg",
+ "zune-jpeg 0.5.15",
]
[[package]]
@@ -4380,12 +4413,15 @@ version = "0.45.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a8928798c0a55e03c9ca6c4c6846f76377427d2c1e1f7e6de3c06ae57942df43"
dependencies = [
+ "gif 0.13.3",
+ "image-webp",
"log",
"pico-args",
"rgb",
"svgtypes 0.15.3",
"tiny-skia",
"usvg 0.45.1",
+ "zune-jpeg 0.4.21",
]
[[package]]
@@ -5490,7 +5526,7 @@ dependencies = [
"half",
"quick-error 2.0.1",
"weezl 0.1.12",
- "zune-jpeg",
+ "zune-jpeg 0.5.15",
]
[[package]]
@@ -6037,7 +6073,7 @@ dependencies = [
[[package]]
name = "vectorcraft"
-version = "0.19.0"
+version = "0.21.0"
dependencies = [
"arboard",
"block2 0.6.2",
@@ -6082,7 +6118,7 @@ dependencies = [
[[package]]
name = "vectorcraft-affinity"
-version = "0.19.0"
+version = "0.21.0"
dependencies = [
"crc32fast",
"flate2",
@@ -6093,7 +6129,7 @@ dependencies = [
[[package]]
name = "vectorcraft-brush"
-version = "0.19.0"
+version = "0.21.0"
dependencies = [
"kurbo 0.13.1",
"serde",
@@ -6105,7 +6141,7 @@ dependencies = [
[[package]]
name = "vectorcraft-cad"
-version = "0.19.0"
+version = "0.21.0"
dependencies = [
"image",
"kurbo 0.13.1",
@@ -6121,7 +6157,7 @@ dependencies = [
[[package]]
name = "vectorcraft-cli"
-version = "0.19.0"
+version = "0.21.0"
dependencies = [
"log",
"objc2-core-foundation",
@@ -6143,7 +6179,7 @@ dependencies = [
[[package]]
name = "vectorcraft-color"
-version = "0.19.0"
+version = "0.21.0"
dependencies = [
"kurbo 0.13.1",
"moxcms",
@@ -6155,7 +6191,7 @@ dependencies = [
[[package]]
name = "vectorcraft-doc"
-version = "0.19.0"
+version = "0.21.0"
dependencies = [
"chrono",
"hayro-ccitt",
@@ -6169,12 +6205,12 @@ dependencies = [
"tiff",
"vectorcraft-color",
"vectorcraft-geom",
- "zune-jpeg",
+ "zune-jpeg 0.5.15",
]
[[package]]
name = "vectorcraft-effects"
-version = "0.19.0"
+version = "0.21.0"
dependencies = [
"image",
"kurbo 0.13.1",
@@ -6190,11 +6226,14 @@ dependencies = [
[[package]]
name = "vectorcraft-engine"
-version = "0.19.0"
+version = "0.21.0"
dependencies = [
+ "cfb",
+ "chrono",
"craft-docpath",
"crc32fast",
"flate2",
+ "hayro-jpeg2000",
"image",
"kurbo 0.13.1",
"log",
@@ -6229,7 +6268,7 @@ dependencies = [
[[package]]
name = "vectorcraft-eps"
-version = "0.19.0"
+version = "0.21.0"
dependencies = [
"fax",
"flate2",
@@ -6245,6 +6284,7 @@ dependencies = [
"vectorcraft-effects",
"vectorcraft-geom",
"vectorcraft-metafile",
+ "vectorcraft-pathops",
"vectorcraft-pdf",
"vectorcraft-render",
"vectorcraft-testkit",
@@ -6253,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",
@@ -6268,7 +6309,7 @@ dependencies = [
[[package]]
name = "vectorcraft-geom"
-version = "0.19.0"
+version = "0.21.0"
dependencies = [
"kurbo 0.13.1",
"proptest",
@@ -6280,7 +6321,7 @@ dependencies = [
[[package]]
name = "vectorcraft-mcp"
-version = "0.19.0"
+version = "0.21.0"
dependencies = [
"image",
"log",
@@ -6299,7 +6340,7 @@ dependencies = [
[[package]]
name = "vectorcraft-metafile"
-version = "0.19.0"
+version = "0.21.0"
dependencies = [
"image",
"kurbo 0.13.1",
@@ -6313,7 +6354,7 @@ dependencies = [
[[package]]
name = "vectorcraft-pathops"
-version = "0.19.0"
+version = "0.21.0"
dependencies = [
"kurbo 0.13.1",
"linesweeper",
@@ -6325,7 +6366,7 @@ dependencies = [
[[package]]
name = "vectorcraft-pdf"
-version = "0.19.0"
+version = "0.21.0"
dependencies = [
"aes",
"chrono",
@@ -6357,7 +6398,7 @@ dependencies = [
[[package]]
name = "vectorcraft-plugins"
-version = "0.19.0"
+version = "0.21.0"
dependencies = [
"serde",
"serde_json",
@@ -6371,10 +6412,10 @@ dependencies = [
[[package]]
name = "vectorcraft-render"
-version = "0.19.0"
+version = "0.21.0"
dependencies = [
"flate2",
- "gif",
+ "gif 0.14.2",
"image",
"jpeg-encoder",
"log",
@@ -6401,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",
@@ -6418,6 +6459,7 @@ dependencies = [
"resvg",
"serde",
"serde_json",
+ "simplecss",
"skrifa 0.47.0",
"svgtypes 0.16.1",
"thiserror 2.0.21",
@@ -6433,7 +6475,7 @@ dependencies = [
[[package]]
name = "vectorcraft-testkit"
-version = "0.19.0"
+version = "0.21.0"
dependencies = [
"fax",
"image",
@@ -6451,7 +6493,7 @@ dependencies = [
[[package]]
name = "vectorcraft-text"
-version = "0.19.0"
+version = "0.21.0"
dependencies = [
"harfrust 0.13.3",
"icu_segmenter",
@@ -6472,7 +6514,7 @@ dependencies = [
[[package]]
name = "vectorcraft-three-d"
-version = "0.19.0"
+version = "0.21.0"
dependencies = [
"vectorcraft-geom",
"vectorcraft-pathops",
@@ -6480,12 +6522,13 @@ dependencies = [
[[package]]
name = "vectorcraft-tools"
-version = "0.19.0"
+version = "0.21.0"
dependencies = [
"image",
"kurbo 0.13.1",
"serde",
"serde_json",
+ "vectorcraft-brush",
"vectorcraft-color",
"vectorcraft-doc",
"vectorcraft-effects",
@@ -6496,7 +6539,7 @@ dependencies = [
[[package]]
name = "vectorcraft-trace"
-version = "0.19.0"
+version = "0.21.0"
dependencies = [
"image",
"kurbo 0.13.1",
@@ -6508,7 +6551,7 @@ dependencies = [
[[package]]
name = "vectorcraft-ui-egui"
-version = "0.19.0"
+version = "0.21.0"
dependencies = [
"bytemuck",
"craft-keymap",
@@ -6546,7 +6589,7 @@ dependencies = [
[[package]]
name = "vectorcraft-web"
-version = "0.19.0"
+version = "0.21.0"
dependencies = [
"eframe",
"egui",
@@ -6713,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]]
@@ -6773,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",
@@ -6784,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",
@@ -6797,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",
]
@@ -7677,7 +7720,7 @@ checksum = "9440ea3e5aeabb0ac63af70daf835274065238cdd0cec83418f417eae38bacee"
[[package]]
name = "xtask"
-version = "0.19.0"
+version = "0.21.0"
dependencies = [
"serde_json",
]
@@ -7950,19 +7993,34 @@ dependencies = [
"simd-adler32",
]
+[[package]]
+name = "zune-core"
+version = "0.4.12"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3f423a2c17029964870cfaabb1f13dfab7d092a62a29a89264f4d36990ca414a"
+
[[package]]
name = "zune-core"
version = "0.5.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d56377fd46368984a170bc5aac5567e52ca5da874caa60bea39fcbca78fb658b"
+[[package]]
+name = "zune-jpeg"
+version = "0.4.21"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "29ce2c8a9384ad323cf564b67da86e21d3cfdff87908bc1223ed5c99bc792713"
+dependencies = [
+ "zune-core 0.4.12",
+]
+
[[package]]
name = "zune-jpeg"
version = "0.5.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "27bc9d5b815bc103f142aa054f561d9187d191692ec7c2d1e2b4737f8dbd7296"
dependencies = [
- "zune-core",
+ "zune-core 0.5.3",
]
[[package]]
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 fd45eb9cdd..8a3c453c5c 100644
--- a/README.md
+++ b/README.md
@@ -205,10 +205,10 @@ drag-and-drop, set **Preferences › Performance › Linux Display Server** to *
the app with `WAYLAND_DISPLAY= vectorcraft`: the window then opens through XWayland, where drops work
(see [`docs/development.md`](docs/development.md#linux-wayland-and-x11)).
-On Linux with Wayland, under KDE Plasma 6.3 or later and under GNOME, VectorCraft doesn't respond to a drawing tablet's
-pen yet (#491, #2028). Open the window through XWayland instead, where the pen works as a mouse and the app reads its
-pressure: set the same preference to **X11 (XWayland)**, or to **X11 (XWayland) When a Pen Is Attached** to use
-XWayland only when a pen is attached as VectorCraft starts, and restart; or start the app with
+On Linux with Wayland, under KDE Plasma 6.3 or later and under GNOME, VectorCraft can't get a drawing tablet's pen
+input on native Wayland yet (#491, #2028). When a pen is attached as VectorCraft starts, the window opens through
+XWayland, where the pen works as a mouse and the app reads its pressure (#4967; `VECTORCRAFT_NATIVE_WAYLAND=1` keeps
+Wayland). For a pen attached later, set the same preference to **X11 (XWayland)** and restart, or start the app with
`WAYLAND_DISPLAY= vectorcraft` (see [`docs/development.md`](docs/development.md#linux-wayland-and-x11)).
### Use it from Claude Code and other agents
@@ -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 e7d8f0bbad..6cf80d3628 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-10-23 · **Change:** minor (OpenType SVG colour fonts draw and export as vector art; previously: COLR colour fonts (v0 and v1) draw and export as vector art; previously: G2: the Effect Gallery shipped (#2883): Effect › Effect Gallery… browses the Artistic, Brush Strokes, Distort, Sketch, Stylize and Texture filters, edits each filter's settings, builds an ordered stack (add, reorder, hide, remove) with a live canvas preview, and OK applies it as separate appearance effects in one undo step; remaining: filter thumbnails and a preview area inside the dialog; G2 estimate 4–6 → 1–2 h; Raster effects 82% → 85% (power-user view 49% → 52%), estimated, a modest move because the named missing dialog landed without thumbnails or an in-dialog preview; previously: colour emoji fonts with bitmap glyphs (`sbix`, `CBDT`) draw and export; headline numbers unchanged; previously:; Affinity import AF.5: master pages, tables, paragraph formats, shadows, glows, outlines, overlays and embedded documents; ruby (ふりがな) for live text: `type.ruby` sets or removes a reading over a byte range, above or below (right of the column in vertical type), aligned, sized and overhanging or squeezed; saved natively, laid out with line growth, drawn on the canvas and in SVG/PDF (outlines where ruby is present); headline numbers unchanged; previously:; 3D: original Standard, Diffuse, Top Left and Right lighting presets; command access, effective-setting recognition and preview/history; scores and estimates unchanged; Print: Japanese paper sizes in the Print dialog's Media list — JIS B4 257 × 364 mm, JIS B5 182 × 257 mm and JIS B6 128 × 182 mm beside the ISO B4/B5 (which keep their ISO 216 sizes), はがき, 往復はがき, 封筒 長形3号/長形4号/角形2号/角形3号 and 四六判; about 90 community PRs of 2026-10-19: Objects on Path, the Simplify slider, Pencil Edit Selected Paths in the middle of a path, Georgian, and more; Background Export progress dialog with Cancel, #2564; about 85 community PRs of 2026-10-18: Justification…, Word .docx placed as area type, CCITT Group 3 TIFF, Roman Hanging Punctuation, blend spines edited with the Anchor Point tool, shadows and glows in stack order, coloured 3D lights, a Dutch catalog completed; 3D lighting: one to ten colored lights, smooth colored Inflate, legacy white-light appearance preserved; surface batching and restored seam minimum; scores and estimates unchanged; about 145 community PRs of 2026-10-17: image-decode overflow guards, opaque floating panels, MCP export cancel and progress, editable Illustrator EPS import, scoped `doc_inspect`, Dutch, Danish and Indonesian, Simplified Chinese messages, screen-reader names; headline numbers unchanged; about 160 community PRs of 2026-10-15/16: PDF import crash fixes, Dimension tool, legacy `.ai` save, Intertwine, web pen input, Image Trace fixes, `.ai`/EPS/PDF import fidelity, Bulgarian, Greek, Swedish and Finnish catalogs; 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,19 @@ Ranked; detail in [docs/roadmap.md](docs/roadmap.md) and [docs/gaps.md](docs/gap
## Progress log
+- 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).
+- 2026-11-01: Sort Objects joins the Arrange Tools add-on (Object › Plug-ins › Arrange Tools): the selected objects are sorted by width, height, area, position, opacity or stacking order (small to large, large to small or at random) and take another of those in that order, trading their values or stepping them evenly, as one undo step (`addon.arrange.sort`, #4917).
+- 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.
- 2026-10-30: Gradient panel presets: a Presets menu applies one of the built-in gradient libraries' presets (grouped by theme) or a saved one to the gradient behind the active proxy, keeping its placement, as one undo step; the panel menu saves the current gradient as a preset, kept with the preferences, and deletes saved ones (`gradient.presets.list/apply/save/delete`).
- 2026-10-23: Pathfinder › Trap: the Pathfinder panel's Trap… and Effect › Pathfinder › Trap… add a thin overprinting strip of the lighter colour inside the darker one where two solid colours meet, so misregistered plates leave no gap ([trapping](https://helpx.adobe.com/illustrator/using/trapping.html)), with Thickness, Height/Width, Tint Reduction, Traps with Process Color and Reverse Traps. Illustrator effects 49/50 (SVG Filters remains); Live vector effects hours 6–10 → 4–8; headline numbers unchanged.
- 2026-10-23: OpenType SVG colour fonts draw as vector art: each glyph's SVG document is read by the SVG importer, in the text's colours where it asks for them, and draws, exports and outlines as COLR glyphs do; all colour font formats are now drawn.
@@ -139,6 +154,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.
@@ -202,6 +218,18 @@ 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. |
+| 2026-11-01 | minor | Progress log row for the Arrange Tools add-on's Sort Objects (#4917); headline numbers unchanged. |
+| 2026-11-01 | minor | Progress log row for the Document Tools add-on's New Symbols from Layers (#4927); headline numbers unchanged. |
+| 2026-11-01 | minor | Progress log row for the Document Tools add-on's Save a Timestamped Copy (#4926); headline numbers unchanged. |
+| 2026-11-01 | minor | Progress log row for Divide into Dashes (Path Precision Tools add-on, #4950); headline numbers unchanged. |
+| 2026-11-01 | minor | Progress log row for Group Overlapping Objects (Arrange Tools add-on, #4928); headline numbers unchanged. |
+| 2026-10-31 | minor | Progress log row for Export for Screens laid out as the reference app's (#4895) and the 2026-10-31 community landings; headline numbers unchanged. |
+| 2026-10-31 | minor | Progress log row for the Arrange Tools add-on; headline numbers unchanged. |
| 2026-10-29 | minor | Progress log row for the Linux Flatpak clipboard's core Wayland protocol text fallback; headline numbers unchanged. |
| 2026-10-29 | minor | Progress log row for the Linux clipboard retry backoff; headline numbers unchanged. |
| 2026-10-23 | minor | Progress log row for Pathfinder › Trap; Live vector effects hours 6–10 → 4–8; 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/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/Cargo.toml b/apps/vectorcraft/Cargo.toml
index 7af8c51eff..f462132317 100644
--- a/apps/vectorcraft/Cargo.toml
+++ b/apps/vectorcraft/Cargo.toml
@@ -55,8 +55,10 @@ pollster = "1"
# read a pen's barrel button from its pointer messages. Win32_UI_Input_Pointer has
# `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.
-windows = { version = "0.62", features = ["Win32_Graphics_DirectWrite", "Win32_Graphics_Gdi", "Win32_System_Threading", "Win32_UI_Input_Pointer", "Win32_UI_WindowsAndMessaging"] }
+# 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. 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 }
@@ -90,8 +92,8 @@ pollster = "1"
winit = { version = "0.30", default-features = false, features = ["wayland-csd-adwaita-notitle"] }
# A drawing tablet's pen pressure under X11 and XWayland (src/tablet.rs): XInput2 raw events on a
# second X connection, x11rb's pure-Rust `RustConnection`. MIT OR Apache-2.0, already in the build
-# through winit with the `xinput` feature.
-x11rb = { version = "0.13", default-features = false, features = ["xinput"] }
+# through winit with the `xinput` feature. XKB reads Caps Lock's locked modifier state (src/caps_lock.rs).
+x11rb = { version = "0.13", default-features = false, features = ["xinput", "xkb"] }
# Asks the Wayland compositor which GPU it draws with (linux-dmabuf feedback, src/compositor_gpu.rs),
# so Automatic draws on that one. Both are already in the build through winit.
diff --git a/apps/vectorcraft/src/app.rs b/apps/vectorcraft/src/app.rs
index 05c756a0c0..423fb53fc7 100644
--- a/apps/vectorcraft/src/app.rs
+++ b/apps/vectorcraft/src/app.rs
@@ -1,6 +1,8 @@
#[cfg(all(target_os = "macos", feature = "accessibility", feature = "wgpu"))]
use super::gpu;
use super::prefs::{save_prefs, save_prefs_soon};
+#[cfg(not(target_os = "macos"))]
+use super::single_instance;
#[cfg(all(windows, not(target_vendor = "win7")))]
use super::windows_stylus;
use super::{App, VectorcraftApp, file_access, window};
@@ -66,6 +68,9 @@ impl eframe::App for App {
// macOS converts the frame from sRGB to the display's profile (#2249).
#[cfg(all(target_os = "macos", feature = "wgpu"))]
super::mac_color_space::tag(ui);
+ if let Some(on) = self.host_caps_lock.read_transition() {
+ self.app.set_caps_lock(on);
+ }
file_access::unconfined(|| self.app.ui(ui));
// Preferences are written when confirmed, not only at exit: a session ended any other way
// (the system shutting down, the process ended or crashing) used to lose them (#1747).
@@ -105,11 +110,13 @@ impl App {
vectorcraft_ui_egui::background::wait_all(&mut self.app);
return;
}
- // Files from the Finder and the Dock wait while a file dialog is open: what asked for it runs
- // again on its document when it answers.
- #[cfg(target_os = "macos")]
+ // Files from the Finder and the Dock (macOS) or from later launches (#4892) wait while a file
+ // dialog is open: what asked for it runs again on its document when it answers.
if !self.app.file_dialog_open() {
+ #[cfg(target_os = "macos")]
let files = open_documents::take();
+ #[cfg(not(target_os = "macos"))]
+ let files = single_instance::take();
if !files.is_empty() {
bring_window_forward(ctx);
}
@@ -147,15 +154,15 @@ fn end_before_teardown(frames: u64) {
}
}
-/// Show the window when files are opened from the Finder or the Dock: a minimized window comes back
-/// out of the Dock and the app takes focus, as a document-based Mac app does (#3769).
-#[cfg_attr(not(target_os = "macos"), allow(dead_code))]
+/// Show the window when files are opened from the Finder or the Dock, or handed over by a later
+/// launch (#4892): a minimized window comes back and the app takes focus, as a document-based app
+/// does (#3769).
pub(crate) fn bring_window_forward(ctx: &egui::Context) {
ctx.send_viewport_cmd(egui::ViewportCommand::Minimized(false));
ctx.send_viewport_cmd(egui::ViewportCommand::Focus);
}
-/// Open files handed to the app (command line, macOS Finder and Dock) as documents. A file that
+/// Open files handed to the app (command line, macOS Finder and Dock, later launches) as documents. A file that
/// can't be opened is reported to the user and on stderr; the others still open.
pub(crate) fn open_files(app: &mut VectorcraftApp, files: Vec) {
for f in files {
diff --git a/apps/vectorcraft/src/caps_lock.rs b/apps/vectorcraft/src/caps_lock.rs
new file mode 100644
index 0000000000..231a37e037
--- /dev/null
+++ b/apps/vectorcraft/src/caps_lock.rs
@@ -0,0 +1,216 @@
+//! Read the host's Caps Lock state, which gives the drawing tools the precise crosshair while it is on.
+
+/// Only host transitions replace a value set by a script through `view.capsLock`.
+#[derive(Default)]
+pub struct HostCapsLock {
+ previous: Option,
+ #[cfg(target_os = "linux")]
+ x11: Option,
+}
+
+#[cfg(target_os = "linux")]
+struct X11CapsLock {
+ connection: x11rb::rust_connection::RustConnection,
+ locked: bool,
+ initial_sequence: u16,
+}
+
+impl HostCapsLock {
+ pub fn new(window: Option<&winit::window::Window>) -> Self {
+ #[cfg(target_os = "linux")]
+ let x11 = window.and_then(x11_connection);
+ #[cfg(not(target_os = "linux"))]
+ let _ = window;
+ Self {
+ previous: None,
+ #[cfg(target_os = "linux")]
+ x11,
+ }
+ }
+
+ pub fn read_transition(&mut self) -> Option {
+ #[cfg(target_os = "linux")]
+ let current = match self.x11.as_mut() {
+ Some(state) => match state.poll() {
+ Some(locked) => Some(locked),
+ None => {
+ self.x11 = None;
+ None
+ }
+ },
+ None => {
+ // Native Wayland does not expose the seat's XKB lock bit through winit or egui.
+ None
+ }
+ };
+ #[cfg(any(target_os = "macos", windows))]
+ let current = Some(read());
+ // This platform has no lock-state reader.
+ #[cfg(not(any(target_os = "macos", windows, target_os = "linux")))]
+ let current = None;
+ self.transition(current)
+ }
+
+ fn transition(&mut self, reading: Option) -> Option {
+ reading.and_then(|current| self.observe(current))
+ }
+
+ fn observe(&mut self, current: bool) -> Option {
+ if self.previous.replace(current) == Some(current) { None } else { Some(current) }
+ }
+}
+
+#[cfg(target_os = "linux")]
+fn x11_connection(window: &winit::window::Window) -> Option {
+ use winit::raw_window_handle::{HasWindowHandle as _, RawWindowHandle};
+ use x11rb::protocol::xkb;
+ if !matches!(window.window_handle().ok()?.as_raw(), RawWindowHandle::Xlib(_) | RawWindowHandle::Xcb(_)) {
+ return None;
+ }
+ let (connection, _) = x11rb::connect(None).ok()?;
+ let supported = x11rb::protocol::xkb::use_extension(&connection, 1, 0).ok()?.reply().ok()?.supported;
+ if !supported {
+ return None;
+ }
+ // Subscribe before the initial read so changes during setup remain queued.
+ xkb::select_events(
+ &connection,
+ xkb::ID::USE_CORE_KBD.into(),
+ xkb::EventType::default(),
+ xkb::EventType::default(),
+ xkb::MapPart::default(),
+ xkb::MapPart::default(),
+ &xkb::SelectEventsAux {
+ state_notify: Some(xkb::SelectEventsAuxStateNotify {
+ affect_state: xkb::StatePart::MODIFIER_LOCK,
+ state_details: xkb::StatePart::MODIFIER_LOCK,
+ }),
+ ..Default::default()
+ },
+ )
+ .ok()?
+ .check()
+ .ok()?;
+ let (locked, initial_sequence) = read_x11(&connection)?;
+ Some(X11CapsLock { connection, locked, initial_sequence })
+}
+
+#[cfg(target_os = "linux")]
+impl X11CapsLock {
+ fn poll(&mut self) -> Option {
+ use x11rb::connection::Connection as _;
+ use x11rb::protocol::Event;
+ while let Some(event) = self.connection.poll_for_event().ok()? {
+ if let Event::XkbStateNotify(state) = event
+ // Events queued before the initial GetState reply must not replace that newer snapshot.
+ && state.sequence.wrapping_sub(self.initial_sequence) < 0x8000
+ {
+ self.locked = lock_modifier_is_set(state.locked_mods);
+ }
+ }
+ Some(self.locked)
+ }
+}
+
+#[cfg(target_os = "linux")]
+fn read_x11(connection: &x11rb::rust_connection::RustConnection) -> Option<(bool, u16)> {
+ use x11rb::protocol::xkb;
+ let state = xkb::get_state(connection, xkb::ID::USE_CORE_KBD.into()).ok()?.reply().ok()?;
+ Some((lock_modifier_is_set(state.locked_mods), state.sequence))
+}
+
+#[cfg(target_os = "linux")]
+fn lock_modifier_is_set(modifiers: x11rb::protocol::xproto::ModMask) -> bool {
+ use x11rb::protocol::xproto::ModMask;
+ u16::from(modifiers) & u16::from(ModMask::LOCK) != 0
+}
+
+#[cfg(target_os = "macos")]
+const MAC_CAPS_LOCK: usize = 1 << 16;
+
+#[cfg(target_os = "macos")]
+fn mac_flags_have_caps_lock(flags: usize) -> bool {
+ flags & MAC_CAPS_LOCK != 0
+}
+
+#[cfg(target_os = "macos")]
+pub fn read() -> bool {
+ mac_flags_have_caps_lock(objc2_app_kit::NSEvent::modifierFlags_class().bits())
+}
+
+#[cfg(windows)]
+fn windows_state_has_caps_lock(state: i16) -> bool {
+ state & 1 != 0
+}
+
+#[cfg(windows)]
+#[allow(unsafe_code)]
+pub fn read() -> bool {
+ // GetKeyState reports the toggle bit for the calling UI thread's keyboard state.
+ use windows::Win32::UI::Input::KeyboardAndMouse::{GetKeyState, VK_CAPITAL};
+ // SAFETY: `GetKeyState` takes a virtual-key code by value and reads no caller memory.
+ windows_state_has_caps_lock(unsafe { GetKeyState(i32::from(VK_CAPITAL.0)) })
+}
+
+// Querying XWayland for a native Wayland window would read a different keyboard.
+
+#[cfg(test)]
+mod tests {
+ #[test]
+ fn no_host_reader_preserves_scripted_value_and_next_reading_transitions() {
+ let mut host = super::HostCapsLock::default();
+ let mut session = vectorcraft_engine::Session::new();
+ session.execute("view.capsLock", &serde_json::json!({"on": true})).unwrap();
+ if let Some(on) = host.transition(None) {
+ session.execute("view.capsLock", &serde_json::json!({"on": on})).unwrap();
+ }
+ assert!(session.caps_lock);
+ assert_eq!(host.transition(Some(false)), Some(false));
+ }
+
+ #[cfg(target_os = "linux")]
+ #[test]
+ fn no_x11_reader_has_no_transition() {
+ assert_eq!(super::HostCapsLock::default().read_transition(), None);
+ }
+
+ #[test]
+ fn scripted_value_survives_unchanged_host_until_transition() {
+ let mut host = super::HostCapsLock::default();
+ let mut session = vectorcraft_engine::Session::new();
+ if let Some(on) = host.observe(false) {
+ session.execute("view.capsLock", &serde_json::json!({"on": on})).unwrap();
+ }
+ session.execute("view.capsLock", &serde_json::json!({"on": true})).unwrap();
+ if let Some(on) = host.observe(false) {
+ session.execute("view.capsLock", &serde_json::json!({"on": on})).unwrap();
+ }
+ assert!(session.caps_lock);
+ session.execute("view.capsLock", &serde_json::json!({"on": false})).unwrap();
+ if let Some(on) = host.observe(true) {
+ session.execute("view.capsLock", &serde_json::json!({"on": on})).unwrap();
+ }
+ assert!(session.caps_lock);
+ if let Some(on) = host.observe(false) {
+ session.execute("view.capsLock", &serde_json::json!({"on": on})).unwrap();
+ }
+ assert!(!session.caps_lock);
+ }
+
+ #[cfg(target_os = "macos")]
+ #[test]
+ fn mac_modifier_flags_map_caps_lock() {
+ assert!(!super::mac_flags_have_caps_lock(0));
+ assert!(!super::mac_flags_have_caps_lock(1 << 17));
+ assert!(super::mac_flags_have_caps_lock(1 << 16));
+ assert!(super::mac_flags_have_caps_lock((1 << 16) | (1 << 17)));
+ }
+
+ #[cfg(windows)]
+ #[test]
+ fn windows_key_state_maps_toggle_bit() {
+ assert!(!super::windows_state_has_caps_lock(0));
+ assert!(!super::windows_state_has_caps_lock(i16::MIN));
+ assert!(super::windows_state_has_caps_lock(1));
+ }
+}
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..aad5d7d083 100644
--- a/apps/vectorcraft/src/control_server/tests.rs
+++ b/apps/vectorcraft/src/control_server/tests.rs
@@ -334,7 +334,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 431d403463..00f92405e3 100644
--- a/apps/vectorcraft/src/gpu.rs
+++ b/apps/vectorcraft/src/gpu.rs
@@ -182,11 +182,14 @@ fn any_hardware(kinds: &[DeviceType]) -> bool {
kinds.iter().any(|k| *k != DeviceType::Cpu)
}
-/// The largest texture side to ask the device for, which bounds the window's surface: the
-/// adapter's own limit when it is above eframe's `default` (8192 px), so a window larger than
-/// that keeps its surface (#1459). Never below `default`, which is what was asked for before.
-pub fn surface_limit(default: u32, adapter: u32) -> u32 {
- default.max(adapter)
+/// The limits to ask the device for: what eframe `asked` for, lowered to what the `adapter` offers
+/// wherever it offers less, so a GPU short of one of them still gets a device (#2105). The texture
+/// side, which bounds the window's surface, is the adapter's own, above eframe's 8192 px when the
+/// adapter allows more, so a window larger than that keeps its surface (#1459).
+pub fn device_limits(asked: wgpu::Limits, adapter: &wgpu::Limits) -> wgpu::Limits {
+ let mut limits = asked.or_worse_values_from(adapter);
+ limits.max_texture_dimension_2d = adapter.max_texture_dimension_2d;
+ limits
}
/// One adapter, as [`adapter_order`] sees it.
diff --git a/apps/vectorcraft/src/gpu/tests.rs b/apps/vectorcraft/src/gpu/tests.rs
index 3d13b51579..b1511a232a 100644
--- a/apps/vectorcraft/src/gpu/tests.rs
+++ b/apps/vectorcraft/src/gpu/tests.rs
@@ -5,11 +5,34 @@ fn gpu(name: &str, backend: Backend, device_type: DeviceType) -> Candidate {
}
/// #1459: a 9048 px wide window (two display scales' ratio past 8192) fits an adapter that
-/// takes 16384 px textures; an adapter with less than eframe asks for changes nothing.
+/// takes 16384 px textures.
#[test]
fn the_surface_may_be_as_large_as_the_adapter_allows() {
- assert_eq!(surface_limit(8192, 16384), 16384);
- assert_eq!(surface_limit(8192, 4096), 8192);
+ let adapter = wgpu::Limits { max_texture_dimension_2d: 16384, ..wgpu::Limits::default() };
+ let asked = wgpu::Limits { max_texture_dimension_2d: 8192, ..wgpu::Limits::default() };
+ assert_eq!(device_limits(asked, &adapter).max_texture_dimension_2d, 16384);
+}
+
+/// #2105: a GPU that offers less than eframe asks for on any limit (here a Raspberry Pi 5's V3D 7.1:
+/// 15 inter-stage variables on Vulkan, 4096 px textures on OpenGL) gets a device with what it
+/// offers, instead of failing and leaving the window to the software rasterizer. A GPU that offers
+/// more is asked for no more than before, except for the texture side.
+#[test]
+fn the_device_asks_for_no_more_than_the_adapter_offers() {
+ let asked = wgpu::Limits { max_texture_dimension_2d: 8192, ..wgpu::Limits::default() };
+ let vulkan = wgpu::Limits { max_inter_stage_shader_variables: 15, max_texture_dimension_2d: 7680, ..wgpu::Limits::default() };
+ let limits = device_limits(asked.clone(), &vulkan);
+ assert_eq!((limits.max_inter_stage_shader_variables, limits.max_texture_dimension_2d), (15, 7680));
+ assert!(limits.check_limits(&vulkan), "{limits:?}");
+ let gl = wgpu::Limits { max_texture_dimension_2d: 4096, ..wgpu::Limits::downlevel_webgl2_defaults() };
+ let webgl2 = wgpu::Limits { max_texture_dimension_2d: 8192, ..wgpu::Limits::downlevel_webgl2_defaults() };
+ let limits = device_limits(webgl2.clone(), &gl);
+ assert_eq!(limits.max_texture_dimension_2d, 4096);
+ assert!(limits.check_limits(&gl), "{limits:?}");
+ let ample = wgpu::Limits { max_texture_dimension_2d: 8192, ..wgpu::Limits::default() };
+ assert_eq!(device_limits(asked.clone(), &le), asked);
+ let better = wgpu::Limits { max_inter_stage_shader_variables: 31, max_texture_dimension_2d: 8192, ..wgpu::Limits::default() };
+ assert_eq!(device_limits(asked.clone(), &better), asked, "never more than eframe asked for");
}
fn names(c: &[Candidate], order: &[usize]) -> Vec {
diff --git a/apps/vectorcraft/src/host_services.rs b/apps/vectorcraft/src/host_services.rs
index e25332b61a..379d6fd242 100644
--- a/apps/vectorcraft/src/host_services.rs
+++ b/apps/vectorcraft/src/host_services.rs
@@ -151,6 +151,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 +293,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 +316,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 +352,314 @@ 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");
+ }
+}
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/main.rs b/apps/vectorcraft/src/main.rs
index 1e2ab4fae6..980d3826bb 100644
--- a/apps/vectorcraft/src/main.rs
+++ b/apps/vectorcraft/src/main.rs
@@ -1,7 +1,10 @@
//! VectorCraft desktop app.
//!
//! Usage: `vectorcraft [--control [--automation-read-root ]... [--automation-write-root ]...]
-//! [--in-window-menus] [files…]`, `vectorcraft --version`, `vectorcraft --help` (or `-h`)
+//! [--in-window-menus] [--new-instance] [files…]`, `vectorcraft --version`, `vectorcraft --help` (or `-h`)
+//!
+//! Files given while VectorCraft already runs open in that window, unless `--new-instance` is given
+//! (Windows and Linux; `single_instance`).
//!
//! `--in-window-menus` (or `VECTORCRAFT_IN_WINDOW_MENUS=1`) keeps the menus inside the window on
//! macOS instead of the macOS menu bar (`mac_menu`).
@@ -16,6 +19,7 @@
#![cfg_attr(all(target_os = "windows", not(debug_assertions)), windows_subsystem = "windows")]
mod automation_args;
+mod caps_lock;
mod clipboard;
#[cfg(feature = "wgpu")]
mod compositor_gpu;
@@ -45,6 +49,8 @@ mod open_documents;
mod portal_save;
mod prefs_dir;
mod printing;
+#[cfg(not(target_os = "macos"))]
+mod single_instance;
#[cfg(windows)]
mod system_fonts;
mod tablet;
@@ -89,6 +95,7 @@ use titlebar::{custom_titlebar, native_options};
struct App {
app: VectorcraftApp,
+ host_caps_lock: caps_lock::HostCapsLock,
/// Reported by wgpu when the window's graphics device is lost (a driver reset).
graphics_loss: GraphicsLoss,
/// The graphics device was lost and the unsaved changes are kept for Data Recovery.
@@ -120,7 +127,9 @@ Options:
(may be given more than once)
--in-window-menus Keep the menus inside the window on macOS
(or VECTORCRAFT_IN_WINDOW_MENUS=1)
- --version Print the version and exit
+ --new-instance Open the files in a new window even when VectorCraft
+ already runs (Windows and Linux)
+ --version Print the version and exit
-h, --help Print this help and exit
Without a window (converting, scripting, the MCP server), use vectorcraft-cli:
@@ -144,6 +153,7 @@ fn main() -> std::process::ExitCode {
automation_args::AutomationArgs::new(root_env("VECTORCRAFT_AUTOMATION_READ_ROOT"), root_env("VECTORCRAFT_AUTOMATION_WRITE_ROOT"));
let mut files = Vec::new();
let mut in_window_menus = std::env::var_os("VECTORCRAFT_IN_WINDOW_MENUS").is_some_and(|v| !v.is_empty() && v != "0");
+ let mut new_instance = false;
let mut args = std::env::args().skip(1);
while let Some(a) = args.next() {
match roots_args.consume(&a, &mut args).and_then(|root| if root { Ok(true) } else { control.consume(&a, &mut args) }) {
@@ -156,6 +166,7 @@ fn main() -> std::process::ExitCode {
}
match a.as_str() {
"--in-window-menus" => in_window_menus = true,
+ "--new-instance" => new_instance = true,
"--version" => {
println!("vectorcraft {}", env!("CARGO_PKG_VERSION"));
return std::process::ExitCode::SUCCESS;
@@ -185,6 +196,15 @@ fn main() -> std::process::ExitCode {
};
// Before desktop services, so every start-up warning is recorded (`logging`).
let logger = logging::install();
+ // Files opened from the file manager while VectorCraft runs open in its window (#4892). Before
+ // the log file is attached: a launch that hands its files over leaves the running app's log be.
+ #[cfg(not(target_os = "macos"))]
+ let instance = match single_instance::start(control_port.is_some(), new_instance, &files) {
+ single_instance::Start::Forwarded => return std::process::ExitCode::SUCCESS,
+ single_instance::Start::Running(primary) => primary,
+ };
+ #[cfg(target_os = "macos")]
+ let _ = new_instance;
vectorcraft_ui_egui::i18n::detect_system_lang_in_background();
// Before the first render: the cores the process may run on.
#[cfg(windows)]
@@ -270,15 +290,15 @@ fn main() -> std::process::ExitCode {
let options = native_options(custom_titlebar);
// winit picks Wayland whenever `WAYLAND_DISPLAY` is set; Preferences › Performance › Linux
// Display Server › X11 opens the window through XWayland instead, where file drops work (#1151),
- // and X11 (XWayland) When a Pen Is Attached does so when a pen is attached, where the pen draws (#2028).
+ // and the other choices do so when a pen is attached, where the pen draws (#2028, #4967).
#[cfg(target_os = "linux")]
let options = {
let mut options = options;
let pref = saved.as_ref().and_then(|ui| ui.engine_prefs.get("linuxDisplayServer")).and_then(serde_json::Value::as_str);
if xwayland::wanted(pref, |name| std::env::var_os(name), xwayland::pen_attached) {
if xwayland::x11_libraries_found() {
- if pref == Some("x11WithPen") {
- log::info!("pen found: opening the window through XWayland (Preferences › Performance › Linux Display Server)");
+ if pref != Some("x11") {
+ log::info!("pen found: opening the window through XWayland, where the pen works (VECTORCRAFT_NATIVE_WAYLAND=1 keeps Wayland)");
} else {
log::info!("opening the window through XWayland (Preferences › Performance › Linux Display Server)");
}
@@ -326,14 +346,15 @@ fn main() -> std::process::ExitCode {
// losing the device before the first frame (#1194). `WGPU_DX12_COMPILER` picks another.
create.instance_descriptor.backend_options.dx12.shader_compiler =
eframe::wgpu::Dx12Compiler::from_env().unwrap_or(eframe::wgpu::Dx12Compiler::Fxc);
- // The window's surface may be as large as the adapter allows, not eframe's fixed
- // 8192 px: a window stretched over several monitors, or grown by a display scale
- // change, otherwise fails to configure its surface and the app closes (#1459).
+ // The device asks for no more than the adapter offers, so a GPU short of one of
+ // eframe's limits still gets a device (#2105). The window's surface may be as large as
+ // the adapter allows, not eframe's fixed 8192 px: a window stretched over several
+ // monitors, or grown by a display scale change, otherwise fails to configure its
+ // surface and the app closes (#1459).
let device = create.device_descriptor.clone();
create.device_descriptor = std::sync::Arc::new(move |adapter: &eframe::wgpu::Adapter| {
let mut descriptor = device(adapter);
- let limit = &mut descriptor.required_limits.max_texture_dimension_2d;
- *limit = gpu::surface_limit(*limit, adapter.limits().max_texture_dimension_2d);
+ descriptor.required_limits = gpu::device_limits(descriptor.required_limits, &adapter.limits());
descriptor
});
}
@@ -457,7 +478,10 @@ fn main() -> std::process::ExitCode {
}
}
#[cfg(not(target_os = "macos"))]
- let _ = in_window_menus;
+ {
+ let _ = in_window_menus;
+ single_instance::set_ui(&cc.egui_ctx);
+ }
app.services.native_input_hook = native_input_hook(&app);
file_access::unconfined(|| open_files(&mut app, files));
// The first frame is due from now (`gpu::watch_first_frame`).
@@ -466,6 +490,7 @@ fn main() -> std::process::ExitCode {
// The content and the pointer stay aligned on Windows (#1758).
let window_frame = window_frame::service(cc, custom_titlebar);
Ok(Box::new(App {
+ host_caps_lock: caps_lock::HostCapsLock::new(winit_window.as_deref()),
app,
graphics_loss,
graphics_lost: false,
@@ -478,6 +503,10 @@ fn main() -> std::process::ExitCode {
}),
)
});
+ // The window is gone: later launches start their own app, including the one a graphics
+ // failure starts again below.
+ #[cfg(not(target_os = "macos"))]
+ drop(instance);
#[cfg(feature = "wgpu")]
let outcome = gpu::finish(outcome, &startup);
#[cfg(not(feature = "wgpu"))]
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