diff --git a/Cargo.lock b/Cargo.lock index 5c9393ef10..14d5119325 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1134,7 +1134,7 @@ dependencies = [ [[package]] name = "craft" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "craft-automation", "craft-behavior", @@ -1175,7 +1175,7 @@ dependencies = [ [[package]] name = "craft-affinity" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "crc32fast", "flate2", @@ -1186,7 +1186,7 @@ dependencies = [ [[package]] name = "craft-appkit" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "block2 0.6.2", "objc2-app-kit 0.3.2", @@ -1196,7 +1196,7 @@ dependencies = [ [[package]] name = "craft-atomic" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "rustix 1.1.6", ] @@ -1204,7 +1204,7 @@ dependencies = [ [[package]] name = "craft-automation" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "base64 0.23.1", "craft-behavior", @@ -1229,7 +1229,7 @@ dependencies = [ [[package]] name = "craft-behavior" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "accesskit", "bitflags 2.13.2", @@ -1247,7 +1247,7 @@ dependencies = [ [[package]] name = "craft-browse" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "craft-behavior", "craft-docpath", @@ -1265,7 +1265,7 @@ dependencies = [ [[package]] name = "craft-cdr" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "crc32fast", "flate2", @@ -1274,7 +1274,7 @@ dependencies = [ [[package]] name = "craft-cloud-ui" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "egui", ] @@ -1282,7 +1282,7 @@ dependencies = [ [[package]] name = "craft-cms" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "md-5", "rayon", @@ -1291,12 +1291,12 @@ dependencies = [ [[package]] name = "craft-codepage" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" [[package]] name = "craft-color-ui" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "craft-behavior", "craft-cms", @@ -1316,7 +1316,7 @@ dependencies = [ [[package]] name = "craft-control" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "getrandom 0.3.4", "serde", @@ -1326,7 +1326,7 @@ dependencies = [ [[package]] name = "craft-dds" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "rayon", ] @@ -1334,7 +1334,7 @@ dependencies = [ [[package]] name = "craft-dialogs" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "block2 0.6.2", "craft-atomic", @@ -1359,7 +1359,7 @@ dependencies = [ [[package]] name = "craft-docpath" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "serde", ] @@ -1367,7 +1367,7 @@ dependencies = [ [[package]] name = "craft-draw" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "craft-behavior", "craft-color-ui", @@ -1386,7 +1386,7 @@ dependencies = [ [[package]] name = "craft-dxf" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "craft-codepage", "encoding_rs", @@ -1398,12 +1398,12 @@ dependencies = [ [[package]] name = "craft-eps" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" [[package]] name = "craft-font-catalog" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "fontique", "harfrust 0.13.3", @@ -1418,7 +1418,7 @@ dependencies = [ [[package]] name = "craft-font-manager" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "craft-behavior", "craft-font-catalog", @@ -1437,7 +1437,7 @@ dependencies = [ [[package]] name = "craft-font-store" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "cap-primitives", "craft-atomic", @@ -1459,12 +1459,12 @@ dependencies = [ [[package]] name = "craft-fonts-build" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" [[package]] name = "craft-gif" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "gif", ] @@ -1472,7 +1472,7 @@ dependencies = [ [[package]] name = "craft-gzip" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "flate2", ] @@ -1480,7 +1480,7 @@ dependencies = [ [[package]] name = "craft-host" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "bitflags 2.13.2", "craft-i18n", @@ -1493,7 +1493,7 @@ dependencies = [ [[package]] name = "craft-i18n" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "chrono", "fixed_decimal", @@ -1521,7 +1521,7 @@ dependencies = [ [[package]] name = "craft-image-codecs" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "craft-dds", "craft-jpeg", @@ -1548,7 +1548,7 @@ dependencies = [ [[package]] name = "craft-imaging" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "craft-behavior", "craft-color-ui", @@ -1566,7 +1566,7 @@ dependencies = [ [[package]] name = "craft-jpeg" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "thiserror 2.0.21", ] @@ -1574,7 +1574,7 @@ dependencies = [ [[package]] name = "craft-jxl" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "brotli-decompressor 5.0.3", "jixel", @@ -1585,7 +1585,7 @@ dependencies = [ [[package]] name = "craft-keymap" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "craft-host", "craft-i18n", @@ -1600,7 +1600,7 @@ dependencies = [ [[package]] name = "craft-layers" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "craft-behavior", "craft-i18n", @@ -1614,7 +1614,7 @@ dependencies = [ [[package]] name = "craft-menu" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "craft-behavior", "craft-host", @@ -1632,7 +1632,7 @@ dependencies = [ [[package]] name = "craft-metadata" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "brotli-decompressor 6.3.2", "chrono", @@ -1644,7 +1644,7 @@ dependencies = [ [[package]] name = "craft-metafile" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "encoding_rs", "image", @@ -1655,7 +1655,7 @@ dependencies = [ [[package]] name = "craft-mime" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "chrono", "craft-codepage", @@ -1665,7 +1665,7 @@ dependencies = [ [[package]] name = "craft-pages" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "craft-behavior", "craft-keymap", @@ -1681,7 +1681,7 @@ dependencies = [ [[package]] name = "craft-pdf" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "hayro-interpret", "hayro-syntax", @@ -1693,7 +1693,7 @@ dependencies = [ [[package]] name = "craft-platform" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "async-channel", "async-io", @@ -1724,7 +1724,7 @@ dependencies = [ [[package]] name = "craft-plotter" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "kurbo 0.13.1", "thiserror 2.0.21", @@ -1733,7 +1733,7 @@ dependencies = [ [[package]] name = "craft-print" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "craft-behavior", "craft-host", @@ -1757,7 +1757,7 @@ dependencies = [ [[package]] name = "craft-proof" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "log", "miniz_oxide 0.9.1", @@ -1768,7 +1768,7 @@ dependencies = [ [[package]] name = "craft-ps" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "craft-eps", "flate2", @@ -1782,7 +1782,7 @@ dependencies = [ [[package]] name = "craft-psd" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "encoding_rs", "flate2", @@ -1793,7 +1793,7 @@ dependencies = [ [[package]] name = "craft-quit" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "dispatch2", "egui", @@ -1806,7 +1806,7 @@ dependencies = [ [[package]] name = "craft-review" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "base64 0.23.1", "craft-behavior", @@ -1825,7 +1825,7 @@ dependencies = [ [[package]] name = "craft-settings" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "craft-atomic", "craft-host", @@ -1842,7 +1842,7 @@ dependencies = [ [[package]] name = "craft-stream-codecs" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "fax", "hayro-ccitt", @@ -1853,7 +1853,7 @@ dependencies = [ [[package]] name = "craft-svg" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "craft-image-codecs", "craft-xml", @@ -1874,7 +1874,7 @@ dependencies = [ [[package]] name = "craft-table" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "craft-behavior", "craft-keymap", @@ -1886,7 +1886,7 @@ dependencies = [ [[package]] name = "craft-text" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "craft-behavior", "craft-font-manager", @@ -1911,7 +1911,7 @@ dependencies = [ [[package]] name = "craft-theme" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "bitflags 2.13.2", "craft-tracked", @@ -1926,7 +1926,7 @@ dependencies = [ [[package]] name = "craft-theme-store" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "craft-atomic", "craft-behavior", @@ -1941,7 +1941,7 @@ dependencies = [ [[package]] name = "craft-tiff" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "serde", "thiserror 2.0.21", @@ -1951,7 +1951,7 @@ dependencies = [ [[package]] name = "craft-time" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "serde", "thiserror 2.0.21", @@ -1960,7 +1960,7 @@ dependencies = [ [[package]] name = "craft-timeline" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "craft-behavior", "craft-keymap", @@ -1975,12 +1975,12 @@ dependencies = [ [[package]] name = "craft-tracked" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" [[package]] name = "craft-ui" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "craft-cloud-ui", "craft-ui-canvas", @@ -1994,7 +1994,7 @@ dependencies = [ [[package]] name = "craft-ui-canvas" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "craft-behavior", "craft-i18n", @@ -2010,7 +2010,7 @@ dependencies = [ [[package]] name = "craft-ui-contract" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "accesskit", "craft-behavior", @@ -2048,7 +2048,7 @@ dependencies = [ [[package]] name = "craft-ui-macros" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -2059,7 +2059,7 @@ dependencies = [ [[package]] name = "craft-ui-panels" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "craft-behavior", "craft-host", @@ -2077,7 +2077,7 @@ dependencies = [ [[package]] name = "craft-ui-patterns" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "craft-behavior", "craft-host", @@ -2098,7 +2098,7 @@ dependencies = [ [[package]] name = "craft-ui-shell" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "craft-behavior", "craft-host", @@ -2119,7 +2119,7 @@ dependencies = [ [[package]] name = "craft-ui-widgets" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "craft-behavior", "craft-host", @@ -2138,7 +2138,7 @@ dependencies = [ [[package]] name = "craft-update" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "chrono", "craft-host", @@ -2167,7 +2167,7 @@ dependencies = [ [[package]] name = "craft-vectorcraft-format" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "flate2", "serde", @@ -2178,7 +2178,7 @@ dependencies = [ [[package]] name = "craft-wayland" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "raw-window-handle", "wayland-backend", @@ -2188,7 +2188,7 @@ dependencies = [ [[package]] name = "craft-web-api" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "js-sys", "serde_json", @@ -2199,7 +2199,7 @@ dependencies = [ [[package]] name = "craft-win32" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "winsafe", ] @@ -2207,7 +2207,7 @@ dependencies = [ [[package]] name = "craft-window" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "craft-appkit", "craft-atomic", @@ -2239,7 +2239,7 @@ dependencies = [ [[package]] name = "craft-xml" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "quick-xml 0.41.0", "serde", @@ -3507,7 +3507,7 @@ checksum = "9f4d0e94ddd48749f06bbe4e5389fb9799a0c45bcaf00495042076ef05e3241a" [[package]] name = "hayro-cmap" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "brotli", "hayro-postscript", @@ -3516,7 +3516,7 @@ dependencies = [ [[package]] name = "hayro-interpret" version = "0.7.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "bitflags 2.13.2", "hayro-cmap", @@ -3534,7 +3534,7 @@ dependencies = [ [[package]] name = "hayro-jbig2" version = "0.3.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "fearless_simd", "hayro-ccitt", @@ -3552,12 +3552,12 @@ dependencies = [ [[package]] name = "hayro-postscript" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" [[package]] name = "hayro-syntax" version = "0.7.2" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "flate2", "hayro-ccitt", @@ -4488,7 +4488,7 @@ dependencies = [ [[package]] name = "krilla" version = "0.8.2" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "base64 0.22.1", "bumpalo", @@ -4645,7 +4645,7 @@ checksum = "d4a5ff6bcca6c4867b1c4fd4ef63e4db7436ef363e0ad7531d1558856bae64f4" [[package]] name = "linesweeper" version = "0.5.0" -source = "git+https://github.com/storytold/craft-libs?rev=6fcf61c816c399508a60c7029a59e2c7b6139e0b#6fcf61c816c399508a60c7029a59e2c7b6139e0b" +source = "git+https://github.com/storytold/craft-libs?rev=b0d422cf0c23baccdaca314b916458a89c0952e0#b0d422cf0c23baccdaca314b916458a89c0952e0" dependencies = [ "arrayvec", "kurbo 0.13.1", diff --git a/Cargo.toml b/Cargo.toml index e7eb351554..51693818bb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,44 +11,44 @@ rust-version = "1.95" repository = "https://github.com/storytold/vectorcraft" [workspace.dependencies] -craft-cms = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } -craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b", default-features = false, features = ["interpret", "write"] } -craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } -craft-proof = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } +craft-cms = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" } +craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0", default-features = false, features = ["interpret", "write"] } +craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" } +craft-proof = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" } # 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 = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } -craft-gzip = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } +craft-vectorcraft-format = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" } +craft-gzip = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" } # Native Affinity documents (craft-libs#914). -craft-affinity = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } +craft-affinity = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" } # Bounded CDR (v1-v27) and CMX (32-bit) reader (craft-libs#778). -craft-cdr = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } +craft-cdr = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" } # SVG parsing, limits, SVGZ and writer (craft-libs#778). -craft-svg = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b", features = ["tree"] } -craft-mime = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } +craft-svg = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0", features = ["tree"] } +craft-mime = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" } # EPS container, previews, ASCII85 and DSC comments (craft-libs#778). -craft-eps = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } +craft-eps = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" } # DXF tags, reader and writer (craft-libs#778, #926, #927). -craft-plotter = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } -craft-dxf = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } +craft-plotter = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" } +craft-dxf = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" } # WMF, EMF and EMF+ reader (craft-libs#778). -craft-metafile = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } -craft-xml = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } -craft-image-codecs = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } -craft-gif = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } -craft-tiff = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } -craft-ps = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b", default-features = false, features = ["read", "write"] } -craft-psd = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } -craft-stream-codecs = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } -craft-jxl = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } -craft-codepage = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } +craft-metafile = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" } +craft-xml = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" } +craft-image-codecs = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" } +craft-gif = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" } +craft-tiff = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" } +craft-ps = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0", default-features = false, features = ["read", "write"] } +craft-psd = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" } +craft-stream-codecs = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" } +craft-jxl = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" } +craft-codepage = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" } # The framework facade (`craft::ui`, `craft::settings`, `craft::platform`, ...). No default features: each crate names # the members it imports. -craft = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } +craft = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" } # Below the egui layer, so not through the facade: the colour harmony rules and their settings (craft-color-ui # without its `ui` feature), the colour type they work in, and the craft-fonts tables the text crate's build writes. -craft-color-ui = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } -craft-theme = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } -craft-fonts-build = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } +craft-color-ui = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" } +craft-theme = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" } +craft-fonts-build = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" } # internal vectorcraft-geom = { path = "crates/geom" } vectorcraft-color = { path = "crates/color" } @@ -191,13 +191,13 @@ lto = "thin" codegen-units = 1 [patch.crates-io] -hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } -hayro-interpret = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } -hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } -hayro-cmap = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } -hayro-postscript = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } -krilla = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } -linesweeper = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b" } +hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" } +hayro-interpret = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" } +hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" } +hayro-cmap = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" } +hayro-postscript = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" } +krilla = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" } +linesweeper = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0" } ecolor = { git = "https://github.com/storytold/egui.git", rev = "b15ffe9bfc2c8e6748533b32b708e10abaf2afec" } emath = { git = "https://github.com/storytold/egui.git", rev = "b15ffe9bfc2c8e6748533b32b708e10abaf2afec" } epaint = { git = "https://github.com/storytold/egui.git", rev = "b15ffe9bfc2c8e6748533b32b708e10abaf2afec" } diff --git a/ROADMAP.md b/ROADMAP.md index 12f4bb334f..4d415cc0ba 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -2,7 +2,7 @@ **Stage: alpha** · next: beta, ~13 points (ready for real work ~62% → ~75%, and reliable `.ai` exchange) and ~170–270 h away -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-15 · **Change:** minor (G5: built-in Neon & Glow graphic style library (Cyan Neon, Magenta Laser, Amber Tube, Electric Lime, Pulse Violet, Cobalt Phosphor); G5 estimate unchanged (3–13 h); previously: Tech Circuit brush library, G5; previously: docs tidy-up, no content change: stray notes at the top moved into the revision table; scores and estimates unchanged; previously minor: Raster effects 85% → 88%, gallery thumbnails and in-dialog preview in; headline numbers unchanged; Symbols area ~87% → ~88%: dynamic instance parts take opacity, blend, gradient and pattern on the canvas; G5 docs sync for Overlap and Pattern auto corners; previously minor: Tools stays beside the canvas with left-side panels; Hindi catalog draft complete under the translation tests; contributor loanword terminology reviewed; wider proofreading welcome; Compound Shapes add-on, beyond Illustrator; scores and estimates unchanged; Contour add-on, beyond Illustrator; scores and estimates unchanged; new gradients follow document color mode; scores and estimates unchanged) · **Target:** Adobe Illustrator 2026 (30.x) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-22 · **Change:** minor (Upcoming: G11 names what is left (#864's unit preference, #885), not the fixed Shape Builder regions and Asset Export borders, with docs/roadmap.md's 6–13 h, and the Essentials row names Shape Builder's remaining depth, #8314; previously: G5: built-in Neon & Glow graphic style library (Cyan Neon, Magenta Laser, Amber Tube, Electric Lime, Pulse Violet, Cobalt Phosphor); G5 estimate unchanged (3–13 h); previously: Tech Circuit brush library, G5; previously: docs tidy-up, no content change: stray notes at the top moved into the revision table; scores and estimates unchanged; previously minor: Raster effects 85% → 88%, gallery thumbnails and in-dialog preview in; headline numbers unchanged; Symbols area ~87% → ~88%: dynamic instance parts take opacity, blend, gradient and pattern on the canvas; G5 docs sync for Overlap and Pattern auto corners; previously minor: Tools stays beside the canvas with left-side panels; Hindi catalog draft complete under the translation tests; contributor loanword terminology reviewed; wider proofreading welcome; Compound Shapes add-on, beyond Illustrator; scores and estimates unchanged; Contour add-on, beyond Illustrator; scores and estimates unchanged; 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 @@ -35,7 +35,7 @@ blocking it ([Alpha gate](docs/roadmap.md#alpha-gate)). |---|---:|---:|---:|---| | **Full Illustrator** (ready for real work; decides the stage) | **~62%** (57–67%) | **~340–560 h** | ~95–160 h | the mainstream work below, plus 3D (50–85 h), raster effects (23–39 h), advanced type (20–28 h), generative AI (30–60 h), localization (50–85 h) and ecosystem | | **Mainstream illustrator** | **~65%** (60–70%) | **~230–380 h** | ~65–110 h | the interaction-fidelity pass (60–90 h), hardening and QA (30–50 h), stability (20–35 h), performance budgets (15–25 h), `.ai` exchange (10–20 h), the remaining depth of the everyday areas | -| **Essentials user** | **~75%** (70–80%) | **~60–105 h** | ~25–45 h | launch and stability on Windows (20–35 h), in-app help and onboarding (8–15 h), basic QA (10–15 h), Shape Builder regions (4–8 h), UI polish | +| **Essentials user** | **~75%** (70–80%) | **~60–105 h** | ~25–45 h | launch and stability on Windows (20–35 h), in-app help and onboarding (8–15 h), basic QA (10–15 h), Shape Builder depth (4–8 h; #937's reproduced case is fixed, unconfirmed on the reporter's file), UI polish | Hours are Opus 5.5 agent wall-clock hours, calibrated from this repo's merged-PR timestamps (e.g. 0.7–1.2 h per Photoshop-style filter, ~0.8 h per medium feature); see [calibration](docs/target-app-parity.md#calibration). @@ -119,7 +119,7 @@ Ranked; detail in [docs/roadmap.md](docs/roadmap.md) and [docs/gaps.md](docs/gap 1. **Interaction-fidelity pass** (G1), tool by tool from [ui-parity.md](docs/ui-parity.md): 60–90 h. 2. **`.ai` files from real users** (G9): layer structure, guides, speed: 10–20 h. 3. **Launch and stability on real machines** (G10): 20–35 h. -4. **Core-tool correctness** (G11: Shape Builder regions, Asset Export borders): 8–15 h. +4. **Core-tool correctness** (G11: the unit preference reverting to points, #864, SVG export units fixed; a Transform effect in a fill's or stroke's own effects, #885; Shape Builder regions and Asset Export borders are fixed): 6–13 h. 5. **Then:** type core and advanced type (G4), the Illustrator 2026 additions (G13), 3D (G3). The Effect Gallery's filter thumbnails and in-dialog preview are in (G2). ## Progress log @@ -251,6 +251,7 @@ The full earlier record of what landed is kept in [docs/roadmap.md](docs/roadmap | Date | Change | Summary | |---|---|---| +| 2026-11-22 | minor | Upcoming: the G11 item names what is left, the unit preference reverting to points (#864; SVG export units are fixed) and a Transform effect in a fill's or stroke's own effects (#885), instead of Shape Builder regions and Asset Export borders, which are fixed (#937, #983 / #1037); its estimate follows docs/roadmap.md and docs/gaps.md, 8–15 → 6–13 h, #8314. The Essentials readiness row's Shape Builder item names what its 4–8 h still covers (checking #937's fix on the reporter's file, still unconfirmed). Headline numbers unchanged. | | 2026-11-15 | minor | Graphic Styles: built-in Neon & Glow graphic style library (Cyan Neon, Magenta Laser, Amber Tube, Electric Lime, Pulse Violet, Cobalt Phosphor); G5 estimate unchanged (3–13 h). | | 2026-11-14 | minor | Tech Circuit adds three original procedural brushes (Circuit Trace, Bus Lines, Terminal Nodes); ten built-in brush libraries. G5 remaining estimate 3–13 h (estimated); parity scores and headline totals unchanged. | | 2026-11-14 | minor | Gujarati (#6613): contributor proofreading completed for all 387 additions, with 11 wording corrections; 4,673 reviewed catalog rows. Status/error messages remain partial; web selection requires a bundled Gujarati face. Scores and estimates unchanged. | diff --git a/apps/vectorcraft-web/Cargo.toml b/apps/vectorcraft-web/Cargo.toml index 8cca976717..6a5d1de9b7 100644 --- a/apps/vectorcraft-web/Cargo.toml +++ b/apps/vectorcraft-web/Cargo.toml @@ -27,7 +27,7 @@ log = { workspace = true } # `wgpu` pulls egui-wgpu's defaults: WebGPU plus the WebGL2 fallback. eframe = { workspace = true, features = ["default_fonts", "wgpu", "accesskit"] } # The page command API (storytold/craft-libs#413): the request plumbing behind window.vectorcraft. -craft-web-api = { git = "https://github.com/storytold/craft-libs", rev = "6fcf61c816c399508a60c7029a59e2c7b6139e0b", version = "0.1.0" } +craft-web-api = { git = "https://github.com/storytold/craft-libs", rev = "b0d422cf0c23baccdaca314b916458a89c0952e0", version = "0.1.0" } wasm-bindgen = "0.2" serde_json = { workspace = true } diff --git a/apps/vectorcraft/src/gpu.rs b/apps/vectorcraft/src/gpu.rs index e79f7b522a..200bbf3095 100644 --- a/apps/vectorcraft/src/gpu.rs +++ b/apps/vectorcraft/src/gpu.rs @@ -398,6 +398,31 @@ pub fn adapter_order( order.into_iter().map(|(i, _)| i).collect() } +/// [`adapter_order`] without the adapters a restart left out after they failed (`skip`) and those +/// that crashed an earlier start (`crashed`), and `true` when that left none and the ones that +/// crashed are tried again. A crash record can't stop a start that has no other adapter to try: +/// the record may be from a start ended from outside before its first frame (#9183), which looks +/// the same as a crash in the driver. An adapter in `skip` failed in this run of the app and +/// stays left out. +pub fn order_leaving_out( + candidates: &[Candidate], + power: PowerPreference, + displays: &[DisplayGpu], + compositor: Option<(u32, u32)>, + named: Option<&str>, + skip: &[String], + crashed: &[String], +) -> (Vec, bool) { + let left_out: Vec = skip.iter().chain(crashed).cloned().collect(); + let order = adapter_order(candidates, power, displays, compositor, named, &left_out); + if !order.is_empty() || crashed.is_empty() { + return (order, false); + } + let again = adapter_order(candidates, power, displays, compositor, named, skip); + let retried = !again.is_empty(); + (again, retried) +} + /// wgpu's own ranking for a power preference: the preferred kind of GPU, the other kind, unknown, /// virtual, software. fn power_rank(t: DeviceType, power: PowerPreference) -> u8 { @@ -845,10 +870,9 @@ pub fn selector( ) -> NativeAdapterSelectorMethod { let named = std::env::var(NAME_ENV).ok(); let skip = skipped(); - let left_out: Vec = skip.iter().chain(&crashed).cloned().collect(); Arc::new(move |adapters, surface| { let candidates: Vec = adapters.iter().map(|a| Candidate::new(a, surface)).collect(); - let order = adapter_order(&candidates, power, &displays, compositor, named.as_deref(), &left_out); + let (order, retried) = order_leaving_out(&candidates, power, &displays, compositor, named.as_deref(), &skip, &crashed); let listed: Vec = candidates .iter() .map(|c| { @@ -872,6 +896,9 @@ pub fn selector( }) .collect(); log::info!("graphics adapters: {}", listed.join("; ")); + if retried { + log::warn!("every graphics adapter that can show the window crashed an earlier start: trying them again"); + } let first = order.first().and_then(|&i| adapters.get(i).zip(candidates.get(i))); let Some((adapter, chosen)) = first else { startup.none_left(); diff --git a/apps/vectorcraft/src/gpu/tests.rs b/apps/vectorcraft/src/gpu/tests.rs index f424280b30..fe4a4ddcc5 100644 --- a/apps/vectorcraft/src/gpu/tests.rs +++ b/apps/vectorcraft/src/gpu/tests.rs @@ -827,3 +827,17 @@ fn pci_ids_reject_a_sign_in_the_hex_digits() { assert_eq!(pci_ids("PCI\\VEN_+10DE&DEV_2204"), None); assert_eq!(pci_ids("PCI\\VEN_10DE&DEV_+2204"), None); } + +/// #9183: a Mac lists one adapter. A start ended from outside before its first frame left it +/// recorded as crashed, and the next start left it out and had nothing to draw on. It is tried +/// again when nothing else is left; an adapter a restart left out after it failed stays out, and +/// with another adapter to try, the one that crashed is still left out. +#[test] +fn an_adapter_that_crashed_an_earlier_start_is_tried_again_when_no_other_is_left() { + let mac = [gpu("Apple M6", Backend::Metal, DeviceType::IntegratedGpu)]; + let crashed = vec![mac[0].key.clone()]; + assert_eq!(order_leaving_out(&mac, PowerPreference::LowPower, &[], None, None, &[], &crashed), (vec![0], true)); + assert_eq!(order_leaving_out(&mac, PowerPreference::LowPower, &[], None, None, &crashed, &crashed), (vec![], false)); + let two = [gpu("Apple M6", Backend::Metal, DeviceType::IntegratedGpu), gpu("llvmpipe", Backend::Gl, DeviceType::Cpu)]; + assert_eq!(order_leaving_out(&two, PowerPreference::LowPower, &[], None, None, &[], &crashed), (vec![1], false)); +} diff --git a/crates/doc/src/units.rs b/crates/doc/src/units.rs index 728c8aa816..f65fa1fd10 100644 --- a/crates/doc/src/units.rs +++ b/crates/doc/src/units.rs @@ -96,6 +96,18 @@ impl Unit { _ => None, } } + /// The SVG length unit an export writes this unit's sizes in: the unit itself when SVG has it, + /// else an SVG unit of the same kind (inches for feet and yards, centimeters for meters, + /// millimeters for Q and Ha). `None` for points and pixels. + pub fn svg_unit(self) -> Option { + match self { + Unit::Millimeters | Unit::Centimeters | Unit::Inches | Unit::Picas => Some(self), + Unit::FeetInches | Unit::Feet | Unit::Yards => Some(Unit::Inches), + Unit::Meters => Some(Unit::Centimeters), + Unit::Q | Unit::Ha => Some(Unit::Millimeters), + Unit::Points | Unit::Pixels => None, + } + } pub const fn label(self) -> &'static str { match self { Unit::Points => "Points", diff --git a/crates/engine/src/cmd/fileio/eps.rs b/crates/engine/src/cmd/fileio/eps.rs index 5067b1c6d5..0ff99200c8 100644 --- a/crates/engine/src/cmd/fileio/eps.rs +++ b/crates/engine/src/cmd/fileio/eps.rs @@ -33,7 +33,7 @@ pub fn specs() -> Vec { "Export EPS", [], None, - "{path?, level?: 2|3 (default; PostScript language level: 3 writes smooth gradients and masks transparent image pixels out, 2 steps gradients and writes those pixels white), previewFormat?: none|tiffBw|tiffColor (default: a TIFF preview other apps show), transparentPreview?: true (else on white), overprints?: preserve (default)|discard, flattenerPreset?: \"medium\" (default; high, low or a saved preset: flattener.presets.list), flattener?: {the options of object.flattenTransparency over the preset}, embedFonts?: true (type is always written as outlines, so no fonts are needed), includeLinkedFiles?: false (the embedded document keeps linked images whole, not just their previews), thumbnails?: true (a PNG thumbnail in the file), cmykPostScript?: true (RGB documents written in CMYK), compatibleGradients?: false (stepped gradients at level 3 too), selectedOnly?: false, useArtboards?: true (one file per chosen artboard, artboards?/range?, {stem}_{artboard}.eps, the bounding box the artboard; with two or more, also the central file {stem}.eps first: the whole document, the bounding box the visible art; none when no art shows) | false (one file, the bounding box the visible art, y up from the first artboard's bottom-left corner, even when artboards are named; the default when none are named), format?: \"eps\", artboard?: i | artboards?: [i…] | range?: \"1-3, 5\" (the artboards written; naming them without useArtboards works as useArtboards: true)} → {path, bytes, warnings, files?}; no path → {dataBase64, …}. Transparency is flattened with the preset (EPS has none); the native document rides along in comments, for reopening the file as it was. Same as document.export {format: eps}. A key EPS doesn't take, and an unknown key inside flattener, are refused", + "{path?, level?: 2|3 (default; PostScript language level: 3 writes smooth gradients and masks transparent image pixels out, 2 steps gradients and writes those pixels white), previewFormat?: none|tiffBw|tiffColor (default: a TIFF preview other apps show), transparentPreview?: true (else on white), overprints?: preserve (default; paper white fills and strokes knock out with document.setup discardWhiteOverprint; white linked to a spot swatch that has a color, at a tint above 0%, still overprints)|discard, flattenerPreset?: \"medium\" (default; high, low or a saved preset: flattener.presets.list), flattener?: {the options of object.flattenTransparency over the preset}, embedFonts?: true (type is always written as outlines, so no fonts are needed), includeLinkedFiles?: false (the embedded document keeps linked images whole, not just their previews), thumbnails?: true (a PNG thumbnail in the file), cmykPostScript?: true (RGB documents written in CMYK), compatibleGradients?: false (stepped gradients at level 3 too), selectedOnly?: false, useArtboards?: true (one file per chosen artboard, artboards?/range?, {stem}_{artboard}.eps, the bounding box the artboard; with two or more, also the central file {stem}.eps first: the whole document, the bounding box the visible art; none when no art shows) | false (one file, the bounding box the visible art, y up from the first artboard's bottom-left corner, even when artboards are named; the default when none are named), format?: \"eps\", artboard?: i | artboards?: [i…] | range?: \"1-3, 5\" (the artboards written; naming them without useArtboards works as useArtboards: true)} → {path, bytes, warnings, files?}; no path → {dataBase64, …}. Transparency is flattened with the preset (EPS has none); the native document rides along in comments, for reopening the file as it was. Same as document.export {format: eps}. A key EPS doesn't take, and an unknown key inside flattener, are refused", has_doc, export_eps )] diff --git a/crates/engine/src/cmd/fileio/tests_eps.rs b/crates/engine/src/cmd/fileio/tests_eps.rs index e37fd2be37..83037b5f9e 100644 --- a/crates/engine/src/cmd/fileio/tests_eps.rs +++ b/crates/engine/src/cmd/fileio/tests_eps.rs @@ -212,11 +212,29 @@ fn flattening_cropped_art_keeps_the_art_under_its_hidden_part() { fn overprints_are_kept_or_discarded() { let mut s = session(100.0, 100.0, 1); let id = s.execute("shape.rectangle", &json!({"x": 10, "y": 10, "width": 30, "height": 30})).unwrap()["id"].as_u64().unwrap(); + s.execute("paint.setFill", &json!({"ids": [id], "color": {"c": 100, "m": 0, "y": 0, "k": 0}})).unwrap(); s.execute("attributes.set", &json!({"ids": [id], "overprintFill": true})).unwrap(); let kept = postscript(&b64(&s.execute("document.exportEps", &json!({"previewFormat": "none"})).unwrap())); assert!(kept.contains("true op\n"), "{kept}"); let dropped = postscript(&b64(&s.execute("document.exportEps", &json!({"previewFormat": "none", "overprints": "discard"})).unwrap())); assert!(!dropped.contains("true op")); + + // A white fill or stroke that overprints knocks out with Discard White Overprint (on by + // default), and overprints without it, as in PDF export. + let white = json!({"c": 0, "m": 0, "y": 0, "k": 0}); + let filled = [json!({"ids": [id], "color": white}), json!({"ids": [id], "none": true})]; + let stroked = [json!({"ids": [id], "none": true}), json!({"ids": [id], "color": white})]; + for (i, [fill, stroke]) in [filled, stroked].iter().enumerate() { + s.execute("paint.setFill", fill).unwrap(); + s.execute("paint.setStroke", stroke).unwrap(); + s.execute("attributes.set", &json!({"ids": [id], "overprintFill": i == 0, "overprintStroke": i == 1})).unwrap(); + s.execute("document.setup", &json!({"discardWhiteOverprint": true})).unwrap(); + let knocked_out = postscript(&b64(&s.execute("document.exportEps", &json!({"previewFormat": "none"})).unwrap())); + assert!(!knocked_out.contains("true op"), "{i}: {knocked_out}"); + s.execute("document.setup", &json!({"discardWhiteOverprint": false})).unwrap(); + let overprinted = postscript(&b64(&s.execute("document.exportEps", &json!({"previewFormat": "none"})).unwrap())); + assert!(overprinted.contains("true op\n"), "{i}: {overprinted}"); + } } #[test] diff --git a/crates/engine/src/cmd/layer.rs b/crates/engine/src/cmd/layer.rs index 73c92877e9..1782e60f9c 100644 --- a/crates/engine/src/cmd/layer.rs +++ b/crates/engine/src/cmd/layer.rs @@ -156,7 +156,7 @@ pub fn specs() -> Vec { "Artboard Options…", ["Window", "Artboards"], None, - "{index | artboards: [{index, name?, color?, guideLabel?, locked?, showCenterMark?, showCrossHairs?, showVideoSafeAreas?, videoRulerPixelAspectRatio?, x?, y?, width?, height?}…] (several artboards in one undo step, each with its own fields; the art inside each before any of them changes goes with it, and an object inside several goes with the first listed that moves or scales its art), name?, color?: color (\"#rrggbb\", {c,m,y,k}, … as the paint commands take, #rrggbbaa and #rgba refused: the background color the canvas draws the artboard's paper in, multiplied with the Simulate Colored Paper color while that is on; exports and print leave it out) | null (no background color), guideLabel?: name | \"#rrggbb\" | null (the guide label: the canvas draws the artboard's own guides (guide.add with artboard) in this color instead of the guide color preference, selected ones still in the selection color; a layer color's name spelled exactly as Layer Options lists it (\"Light Blue\", \"Red\", …) or #rrggbb; null for none, which new artboards and older files have; screen-only, so exports and print leave it out; it can change on a locked artboard; an invalid value anywhere in the list changes nothing), locked?: bool (the Artboards panel's lock column: a locked artboard keeps its rectangle (a new x, y, width or height is an error unless locked is false), can't be moved, deleted or cut, and Rearrange and Fit to Artwork Bounds leave it as it is; the art on it (each object of a layer or sublayer whose bounds with strokes overlap it, a group as one object) acts as locked art until it is unlocked: clicks, marquees, select.set, select.all and the tools pass over it (art drawn or pasted onto it stays selected and editable until a selection leaves it out or it is moved off the locked artboards), it is deselected, and when another artboard moves or scales it stays unless lockedAndHidden), showCenterMark?: bool (Artboard Options' Show Center Mark: the canvas draws a mark at the artboard's center), showCrossHairs?: bool (Show Cross Hairs: the canvas draws a line from the middle of each side through the center), showVideoSafeAreas?: bool (Show Video Safe Areas: the canvas draws the action-safe area 3.5% and the title-safe area 5% in from each edge, as EBU R 95 sets them; the three are screen-only, as the artboard's edges are: exports and print leave them out), videoRulerPixelAspectRatio?: number 0.1–10 (Video Ruler Pixel Aspect Ratio: the width of one video pixel over its height, which View › Rulers › Show Video Rulers counts the artboard in; default 1, square pixels), x?, y?, width?, height?, moveArt?: bool (default false; a position-only change moves the contained art with its artboard), scaleArt?: bool (Scale Artwork with Artboard: resized, the artboard takes the art fully inside it (locked and hidden art only with lockedAndHidden?: bool, default prefs moveLockedWithArtboard) and its guides from its old rectangle onto the new one, each side by its own ratio; strokes/corners/patterns as object.scale), strokes?: bool, corners?: bool, patterns?: bool (the three as object.scale, for art that moves or scales with the artboard), lockedAndHidden?: bool (locked and hidden art moves along; default: the preference; recorded in the journal so a replay matches)} → null, or with scaleArt {scaled: the art scaled}; no undo step when nothing changes", + "{index | artboards: [{index, name?, color?, guideLabel?, locked?, showCenterMark?, showCrossHairs?, showVideoSafeAreas?, videoRulerPixelAspectRatio?, x?, y?, width?, height?}…] (several artboards in one undo step, each with its own fields; the art inside each before any of them changes goes with it, and an object inside several goes with the first listed that moves or scales its art), name?, color?: color (\"#rrggbb\", {c,m,y,k}, … as the paint commands take, #rrggbbaa and #rgba refused: the background color the canvas draws the artboard's paper in, multiplied with the Simulate Colored Paper color while that is on. Supported artboard exports and printing include it by default. This includes raster exports with `selectedOnly: true` when the output area is an artboard. Set `includeArtboardFill: false` on the export or print command to omit it. Exports cropped to selection bounds, artwork bounds, or an explicit raster region leave it out, as do formats that do not support artboard fills) | null (no background color), guideLabel?: name | \"#rrggbb\" | null (the guide label: the canvas draws the artboard's own guides (guide.add with artboard) in this color instead of the guide color preference, selected ones still in the selection color; a layer color's name spelled exactly as Layer Options lists it (\"Light Blue\", \"Red\", …) or #rrggbb; null for none, which new artboards and older files have; screen-only, so exports and print leave it out; it can change on a locked artboard; an invalid value anywhere in the list changes nothing), locked?: bool (the Artboards panel's lock column: a locked artboard keeps its rectangle (a new x, y, width or height is an error unless locked is false), can't be moved, deleted or cut, and Rearrange and Fit to Artwork Bounds leave it as it is; the art on it (each object of a layer or sublayer whose bounds with strokes overlap it, a group as one object) acts as locked art until it is unlocked: clicks, marquees, select.set, select.all and the tools pass over it (art drawn or pasted onto it stays selected and editable until a selection leaves it out or it is moved off the locked artboards), it is deselected, and when another artboard moves or scales it stays unless lockedAndHidden), showCenterMark?: bool (Artboard Options' Show Center Mark: the canvas draws a mark at the artboard's center), showCrossHairs?: bool (Show Cross Hairs: the canvas draws a line from the middle of each side through the center), showVideoSafeAreas?: bool (Show Video Safe Areas: the canvas draws the action-safe area 3.5% and the title-safe area 5% in from each edge, as EBU R 95 sets them; the three are screen-only, as the artboard's edges are: exports and print leave them out), videoRulerPixelAspectRatio?: number 0.1–10 (Video Ruler Pixel Aspect Ratio: the width of one video pixel over its height, which View › Rulers › Show Video Rulers counts the artboard in; default 1, square pixels), x?, y?, width?, height?, moveArt?: bool (default false; a position-only change moves the contained art with its artboard), scaleArt?: bool (Scale Artwork with Artboard: resized, the artboard takes the art fully inside it (locked and hidden art only with lockedAndHidden?: bool, default prefs moveLockedWithArtboard) and its guides from its old rectangle onto the new one, each side by its own ratio; strokes/corners/patterns as object.scale), strokes?: bool, corners?: bool, patterns?: bool (the three as object.scale, for art that moves or scales with the artboard), lockedAndHidden?: bool (locked and hidden art moves along; default: the preference; recorded in the journal so a replay matches)} → null, or with scaleArt {scaled: the art scaled}; no undo step when nothing changes", has_doc, artboard_set ), diff --git a/crates/engine/src/script/include.rs b/crates/engine/src/script/include.rs index a024949a35..ae6b41b1a1 100644 --- a/crates/engine/src/script/include.rs +++ b/crates/engine/src/script/include.rs @@ -326,7 +326,7 @@ impl Files { /// The options a file of this run is parsed with, preprocessor lines aside. pub(crate) fn options(&self) -> Options { - Options { max_source_units: MAX_TOTAL_BYTES, es2015: self.es2015, ..Options::default() } + Options { max_source_units: MAX_TOTAL_BYTES, es2015: self.es2015, e4x: true, ..Options::default() } } /// The `JSINCLUDE` folders of this process: absolute folders separated by `;`. diff --git a/crates/engine/src/script/mod.rs b/crates/engine/src/script/mod.rs index 00d0a3a371..fdec594f69 100644 --- a/crates/engine/src/script/mod.rs +++ b/crates/engine/src/script/mod.rs @@ -2009,7 +2009,7 @@ impl Session { // A `.js` script reads ECMAScript 2015; `eval`, `Function`, includes and `$.evalFile` read // code the way the script does. let es2015 = include::es2015_script(request.file.as_deref()); - let options = Options { max_source_units: include::MAX_TOTAL_BYTES.saturating_mul(2), es2015, ..Options::default() }; + let options = Options { max_source_units: include::MAX_TOTAL_BYTES.saturating_mul(2), es2015, e4x: true, ..Options::default() }; let strict = options.strict; // A kept engine reads each run's code the way that run's script does. let mut realm = match realm { diff --git a/crates/engine/src/tests/script_run.rs b/crates/engine/src/tests/script_run.rs index fa0c2e35cc..56bc5854a1 100644 --- a/crates/engine/src/tests/script_run.rs +++ b/crates/engine/src/tests/script_run.rs @@ -391,6 +391,40 @@ fn a_js_script_reads_optional_chains_and_coalescing_and_a_jsx_script_does_not() let _ = std::fs::remove_dir_all(&dir); } +#[test] +fn every_script_reads_e4x_and_has_the_xml_objects() { + let dir = fresh_folder("e4x"); + let write = |name: &str, text: &str| { + let p = dir.join(name); + std::fs::write(&p, text).unwrap(); + p.to_string_lossy().into_owned() + }; + let mut s = two_docs(); + let path = |p: &str| json!({"path": p}); + // Script text: literals, selectors, for each and the four constructors. + let text = "var x = 12;\n\ + vc.log(x.item.length() + ' ' + x.item.(@id == 'b').toString() + ' ' + x..item[0].@id);\n\ + var sum = 0; for each (var i in x.item) sum += Number(i); vc.log(sum);\n\ + vc.log(new XML('').b.length() + new XMLList('').length());\n\ + vc.log(new Namespace('p', 'urn:p').prefix + ' ' + new QName('urn:q', 'n').localName + ' ' + isXMLName('ok'));\n\ + vc.log(typeof setDefaultXMLNamespace + ' ' + (1 < 2));\n"; + let r = run(&mut s, text).unwrap(); + assert_eq!(r["log"], json!(["2 2 a", 3, 3, "p n true", "function true"]), "{r}"); + // A .js file, a file it includes, eval, Function and $.evalFile read XML as well. + write("lib.jsxinc", "var fromLib = .@n.toString();\n"); + write("more.jsx", "{fromLib}.toString();\n"); + let modern = "#include \"lib.jsxinc\"\nlet tag = {fromLib};\nvc.log(tag.toString());\n\ + vc.log(eval('5').toString());\nvc.log(new Function('return 6.toString()')());\n\ + vc.log($.evalFile(File($.fileName).parent + '/more.jsx'));\n"; + let r = s.execute("script.run", &path(&write("modern.js", modern))).unwrap(); + assert_eq!(r["log"], json!(["7", "5", "6", "7"]), "{r}"); + // A named engine first made by a .js run gives a later .jsx run the XML objects too. + s.execute("script.run", &path(&write("first.js", "#targetengine xmlkept\nlet k = 1;"))).unwrap(); + let later = s.execute("script.run", &path(&write("second.jsx", "#targetengine xmlkept\nvc.log(XML('2').toString());"))).unwrap(); + assert_eq!(later["log"], json!(["2"]), "{later}"); + let _ = std::fs::remove_dir_all(&dir); +} + /// A new empty folder for test `name`. fn fresh_folder(name: &str) -> std::path::PathBuf { let dir = std::env::temp_dir().join(format!("vc-script-run-{name}-{}", std::process::id())); diff --git a/crates/engine/tests/it/script_host_vs_scriptcheck.rs b/crates/engine/tests/it/script_host_vs_scriptcheck.rs index 60239864d7..2ec927bd48 100644 --- a/crates/engine/tests/it/script_host_vs_scriptcheck.rs +++ b/crates/engine/tests/it/script_host_vs_scriptcheck.rs @@ -2,8 +2,8 @@ //! the tables below, and each name that reaches outside the document has the `outside` id //! `script.check` (`vectorcraft-scriptcheck`) gives it. The names are read from a run: the own //! properties of the global object, of each object or function it holds and of each function's -//! `prototype`, with a setter listed again as `name=`. The names a plain `vectorcraft_js::Realm` also -//! has are the language's, which reach files and other apps only through the host; `eval` and +//! `prototype`, with a setter listed again as `name=`. The names a plain `vectorcraft_js::Realm` with +//! E4X also has are the language's, which reach files and other apps only through the host; `eval` and //! `Function` still have rows, since they run code the checker can't read. A name the host adds //! without a row fails the test. @@ -11,7 +11,7 @@ use std::collections::BTreeSet; use serde_json::json; use vectorcraft_engine::Session; -use vectorcraft_js::{DirectiveName, JsValue, Realm}; +use vectorcraft_js::{DirectiveName, JsValue, Options, Realm}; use vectorcraft_scriptcheck::{Limits, check}; /// The names that reach outside the document: each with a script that uses it and the `outside` id @@ -110,9 +110,9 @@ fn host_names() -> BTreeSet { text.lines().map(str::to_string).collect() } -/// The names a plain JavaScript engine has. +/// The names a plain JavaScript engine with E4X has. fn language_names() -> BTreeSet { - match Realm::new().run(LIST) { + match Realm::with_options(Options { e4x: true, ..Options::default() }, vectorcraft_js::Limits::default()).run(LIST) { Ok(JsValue::String(text)) => text.lines().map(str::to_string).collect(), other => panic!("no list: {other:?}"), } diff --git a/crates/eps/src/print/tests.rs b/crates/eps/src/print/tests.rs index e560f7ab8d..f32bebaa4c 100644 --- a/crates/eps/src/print/tests.rs +++ b/crates/eps/src/print/tests.rs @@ -132,6 +132,15 @@ fn over(under: Option, art: &[Node]) -> Document { /// Ink `ink`'s plate of `d` as the print plan separates it for PostScript, and as a PostScript /// separation at `level` read back, both drawn at 1 px a point. fn plate_of(d: &Document, ink: &str, level: Level) -> (Image, Image) { + let area = Rect::new(0.0, 0.0, 200.0, 100.0); + let (plate, out) = separation(d, ink, level); + let back = crate::import(&out.bytes).unwrap().document; + (render_region(&plate, area, 1.0), render_region(&back, area, 1.0)) +} + +/// Ink `ink`'s plate of `d` as the print plan separates it for PostScript, and that plate written +/// as a PostScript separation at `level`. +fn separation(d: &Document, ink: &str, level: Level) -> (Document, EpsOutput) { let area = Rect::new(0.0, 0.0, 200.0, 100.0); let settings = serde_json::from_value(serde_json::json!({"output": {"mode": "separations"}})).unwrap(); let plan = vectorcraft_pdf::plan(d, &vectorcraft_pdf::PrintOptions { settings, postscript: true, ..Default::default() }).unwrap(); @@ -151,8 +160,7 @@ fn plate_of(d: &Document, ink: &str, level: Level) -> (Image, Image) { }; let out = print(&[page], &[0], &PrintJob { level, ..PrintJob::default() }).unwrap(); assert!(level == Level::Three || !text(&out).contains("shfill"), "Level 2 has no smooth shadings"); - let back = crate::import(&out.bytes).unwrap().document; - (render_region(plate, area, 1.0), render_region(&back, area, 1.0)) + (plate.clone(), out) } /// Ink `ink`'s PostScript plate of `art` over a page of 100% `ink` (`under`), checked against the @@ -234,6 +242,44 @@ fn an_overprinting_gradient_keeps_the_ink_below_where_it_puts_none_on_a_postscri assert_keeps_the_ink_below(&cases); } +/// With Discard White Overprint, a process white fill or stroke marked to overprint knocks out the +/// cyan below it on the Cyan plate and is written without overprinting, as in composite output. +/// Without the setting, and for a white linked to a spot swatch with a color at a tint above 0%, +/// the cyan below it prints. +#[test] +fn white_overprints_knock_out_on_postscript_plates_with_discard_white_overprint() { + let cyan = Paint::solid(Color::cmyk(1.0, 0.0, 0.0, 0.0)); + let white = Paint::solid(Color::cmyk(0.0, 0.0, 0.0, 0.0)); + let spot_white = Paint::Solid { color: Color::cmyk(0.0, 0.0, 0.0, 0.0), swatch: Some("White Ink".into()), tint: 1.0 }; + // The fill is sampled in the rectangle's middle, the stroke on its top edge. + let (fill_at, stroke_at) = ((100, 50), (100, 10)); + let cases = [ + ("process white fill", overprinting(white.clone(), Paint::None), fill_at, true, true), + ("process white stroke", overprinting(Paint::None, white.clone()), stroke_at, true, true), + ("process white fill without the setting", overprinting(white.clone(), Paint::None), fill_at, false, false), + ("process white stroke without the setting", overprinting(Paint::None, white), stroke_at, false, false), + ("spot white fill", overprinting(spot_white.clone(), Paint::None), fill_at, true, false), + ("spot white stroke", overprinting(Paint::None, spot_white), stroke_at, true, false), + ]; + let mut failed = vec![]; + for (name, art, (x, y), discard, knocks_out) in cases { + let mut d = over(Some(cyan.clone()), &[art]); + d.swatches.push(Swatch { name: "White Ink".into(), paint: Paint::solid(Color::cmyk(0.0, 0.0, 0.0, 0.0)), global: true, spot: true }); + d.setup.discard_white_overprint = discard; + for level in [Level::Three, Level::Two] { + let (_, printed) = plate_of(&d, "Cyan", level); + let paper = printed.over_white(x, y)[0] >= 254; + if paper != knocks_out { + failed.push(format!("{name} at level {level:?}: knocked out {paper}, expected {knocks_out}")); + } + if text(&separation(&d, "Cyan", level).1).contains("true op") { + failed.push(format!("{name} at level {level:?}: overprints on the plate")); + } + } + } + assert!(failed.is_empty(), "{failed:#?}"); +} + #[test] fn an_overprinting_gradient_with_a_hard_stop_at_an_end_keeps_the_ink_below_on_a_postscript_plate() { // Two stops at an end, one with cyan and one without: Level 2's bands pad with the end stop, diff --git a/crates/eps/src/scene.rs b/crates/eps/src/scene.rs index 1193839d0b..8452decdf6 100644 --- a/crates/eps/src/scene.rs +++ b/crates/eps/src/scene.rs @@ -298,6 +298,8 @@ pub(crate) struct Scene<'a> { /// The gradient being painted overprints on a plate: where it is paper white it puts none of /// the plate's ink down, and the plate below it is left as it is ([`Self::inked_spans`]). keep_below: bool, + /// Overprinting is on in the page's graphics state ([`Self::overprint_on`]). + overprinting: bool, /// The print job's fonts: type in a solid fill is shown through them (`None`: drawn as /// outlines). fonts: Option<&'a RefCell>, @@ -336,6 +338,7 @@ impl<'a> Scene<'a> { nest: 0, plate: false, keep_below: false, + overprinting: false, fonts: None, used: UsedGlyphs::new(), used_order: vec![], @@ -535,11 +538,30 @@ impl<'a> Scene<'a> { } } - /// Turn overprinting on for one paint (when overprints are preserved); `false` when it stays off. + /// Whether a fill or stroke of `paint` marked to overprint (`overprint`) does: not when it is + /// paper white with Discard White Overprint in Output (Document Setup); a spot white still + /// overprints ([`Self::spot_ink`]). On a plate the colors are already the plate's coverage, and + /// the plate's document has already turned overprinting off for each white the setting knocks + /// out, so white is not checked there. + fn overprints(&self, overprint: bool, paint: &Paint) -> bool { + let discarded = !self.plate && self.doc.setup.discard_white_overprint && vectorcraft_doc::overprint::is_white(paint) && !self.spot_ink(paint); + overprint && !discarded + } + + /// Whether `paint` is a tint above 0% of a spot swatch with a solid color, which the page writes + /// as a Separation ink of its own ([`Self::spot_space`]); a link is judged by the first swatch of + /// its name. + fn spot_ink(&self, paint: &Paint) -> bool { + matches!(paint, Paint::Solid { swatch: Some(name), tint, .. } if *tint > 0.0 && self.doc.swatch(name).is_some_and(|s| s.spot && s.paint.color().is_some())) + } + + /// Turn overprinting on for one paint (when overprints are preserved); `false` when it stays off + /// or is already on (a pattern's tiles inside an overprinting pattern fill). fn overprint_on(&mut self, overprint: bool) -> bool { - let on = overprint && self.o.overprint == Overprint::Preserve; + let on = overprint && self.o.overprint == Overprint::Preserve && !self.overprinting; if on { self.line("true op"); + self.overprinting = true; } on } @@ -547,6 +569,7 @@ impl<'a> Scene<'a> { fn overprint_off(&mut self, on: bool) { if on { self.line("false op"); + self.overprinting = false; } } @@ -611,7 +634,9 @@ impl<'a> Scene<'a> { && vectorcraft_doc::overprint::is_white(p) && vectorcraft_doc::overprint::DiscardWhite::of(self.doc).discards(p); let on = self.overprint_on(n.colorize_overprints() && !discarded); - self.colorized_image(im, blob, p, on); + // Inside an overprinting pattern fill the image overprints with its tiles. + let overprinting = self.overprinting; + self.colorized_image(im, blob, p, overprinting); self.overprint_off(on); } _ => self.image(&im.key, blob, im.width, im.height, im.xf), @@ -729,7 +754,8 @@ impl<'a> Scene<'a> { match item { AppearanceItem::Fill(fl) if fl.visible && !fl.paint.is_none() => { self.note_item(fl.opacity, fl.blend); - self.fill(bp, rule, &fl.paint, bounds, fl.overprint); + let overprint = self.overprints(fl.overprint, &fl.paint); + self.fill(bp, rule, &fl.paint, bounds, overprint); } AppearanceItem::Stroke(st) if st.visible && !st.paint.is_none() && st.width > 0.0 && st.width.is_finite() => { self.stroke(bp, rule, st, bounds); @@ -812,6 +838,7 @@ impl<'a> Scene<'a> { return; } self.note_item(st.opacity, st.blend); + let overprint = self.overprints(st.overprint, &st.paint); let paint_bounds = st.paint_bounds(bounds); let area_paint = match &st.paint { Paint::Pattern { .. } => true, @@ -822,7 +849,7 @@ impl<'a> Scene<'a> { // The area the stroke paints, as Outline Stroke makes it, painted with the pattern's // tiles or the freeform's image. let region = stroke::outline_region(&PathData::from_bezpath(bp), rule, st).to_bezpath(); - self.fill(®ion, FillRule::NonZero, &st.paint, paint_bounds, st.overprint); + self.fill(®ion, FillRule::NonZero, &st.paint, paint_bounds, overprint); return; } let w = stroke::for_writer(bp, st); @@ -847,7 +874,7 @@ impl<'a> Scene<'a> { }; match &w.shape { WrittenShape::Stroke { width } => { - let on = self.overprint_on(st.overprint); + let on = self.overprint_on(overprint); self.line_style(st, *width); match &st.paint { Paint::Solid { color, swatch, tint } => { @@ -861,7 +888,7 @@ impl<'a> Scene<'a> { self.line("q"); push_path(&mut self.body, bp); self.line("strokepath W"); - self.paint_overprinting(st.overprint, p, paint_bounds, w.reach(st, bounds)); + self.paint_overprinting(overprint, p, paint_bounds, w.reach(st, bounds)); self.line("Q"); } } @@ -874,14 +901,14 @@ impl<'a> Scene<'a> { push_path(&mut self.body, &ws.clip); self.body.push_str(clip_op(FillRule::NonZero)); for (shape, paint) in &ws.slices { - self.fill(shape, FillRule::NonZero, paint, shape.bounding_box(), st.overprint); + self.fill(shape, FillRule::NonZero, paint, shape.bounding_box(), overprint); } self.line("Q"); } } WrittenShape::Fill(outlines) => { for o in outlines { - self.fill(o, FillRule::NonZero, &st.paint, paint_bounds, st.overprint); + self.fill(o, FillRule::NonZero, &st.paint, paint_bounds, overprint); } } } @@ -989,12 +1016,13 @@ impl<'a> Scene<'a> { if bp.elements().is_empty() { continue; } + let overprint = self.overprints(run.style.overprint_fill, &run.style.fill); if fonts.is_none() { - self.fill(&bp, FillRule::NonZero, &run.style.fill, layout.bounds, run.style.overprint_fill); + self.fill(&bp, FillRule::NonZero, &run.style.fill, layout.bounds, overprint); } else { - self.show(&shown, &run.style.fill, run.style.overprint_fill); + self.show(&shown, &run.style.fill, overprint); if !art.elements().is_empty() { - self.fill(&art, FillRule::NonZero, &run.style.fill, layout.bounds, run.style.overprint_fill); + self.fill(&art, FillRule::NonZero, &run.style.fill, layout.bounds, overprint); } } if run.style.has_stroke() { @@ -1014,7 +1042,8 @@ impl<'a> Scene<'a> { match item { AppearanceItem::Fill(fl) if fl.visible && !fl.paint.is_none() => { self.note_item(fl.opacity, fl.blend); - self.fill(bp, FillRule::NonZero, &fl.paint, tb, fl.overprint); + let overprint = self.overprints(fl.overprint, &fl.paint); + self.fill(bp, FillRule::NonZero, &fl.paint, tb, overprint); } AppearanceItem::Stroke(st) if st.visible && !st.paint.is_none() && st.width > 0.0 && st.width.is_finite() => { self.stroke(bp, FillRule::NonZero, st, tb); diff --git a/crates/eps/src/tests.rs b/crates/eps/src/tests.rs index f505dbc0ec..3b45578deb 100644 --- a/crates/eps/src/tests.rs +++ b/crates/eps/src/tests.rs @@ -448,6 +448,106 @@ fn spot_colours_are_separations_and_overprints_are_kept_or_dropped() { assert!(!page_of(&d, &EpsOptions { overprint: Overprint::Discard, ..opts(&d) }).contains("true op")); } +/// Whether overprinting is on at each fill a page paints, by its `true op` and `false op` lines. +fn overprint_at_fills(page: &str) -> Vec { + let mut on = false; + let mut fills = vec![]; + for line in page.lines() { + match line { + "true op" => on = true, + "false op" => on = false, + l if l == "f" || l.ends_with(" f") || l.ends_with(" f*") || l == "f*" => fills.push(on), + _ => {} + } + } + fills +} + +#[test] +fn tiles_overprint_with_their_overprinting_pattern() { + // A rectangle filled with an overprinting pattern whose tile is a white square marked to + // overprint and then a cyan one that is not. + let mut d = doc_with(|_| vec![]); + let square = |d: &mut Document, paint: Paint, overprint: bool| { + let mut n = path(d, shapes::rectangle(Rect::new(0.0, 0.0, 10.0, 10.0)), paint, Paint::None, 0.0); + if let Some(AppearanceItem::Fill(f)) = n.appearance.items.first_mut() { + f.overprint = overprint; + } + Arc::new(n) + }; + let tile = vec![square(&mut d, Paint::solid(Color::WHITE), true), square(&mut d, Paint::solid(Color::cmyk(1.0, 0.0, 0.0, 0.0)), false)]; + d.patterns.push(vectorcraft_doc::PatternDef::new("tile", tile)); + let mut n = red_rect(&mut d); + if let Some(AppearanceItem::Fill(f)) = n.appearance.items.first_mut() { + f.paint = Paint::Pattern { pattern: "tile".into(), xf: Affine::IDENTITY }; + f.overprint = true; + } + let layer = d.layers[0].id; + d.insert(Some(layer), 0, n).unwrap(); + // The whole pattern overprints, as in PDF export: the white square's own mark does not turn + // overprinting off for the cyan square after it, and Discard White Overprint applies to the + // pattern fill, not to its tiles. + let fills = overprint_at_fills(&page_of(&d, &opts(&d))); + assert!(!fills.is_empty() && fills.iter().all(|&on| on), "{fills:?}"); + // On a plate too. + let plate = crate::scene::Scene::new(&d, &opts(&d)).on_plate(true).run(); + let fills = overprint_at_fills(&plate.body); + assert!(!fills.is_empty() && fills.iter().all(|&on| on), "{fills:?}"); +} + +/// A white character fill, and a white fill of the type object itself, marked to overprint knock +/// out with Discard White Overprint and overprint without it. +#[test] +fn white_type_fills_knock_out_with_discard_white_overprint() { + use vectorcraft_doc::{CharStyle, FillLayer, TextObject}; + let white = Paint::solid(Color::WHITE); + let char_fill = CharStyle { size: 30.0, fill: white.clone(), overprint_fill: true, ..CharStyle::default() }; + let object_fill = CharStyle { size: 30.0, fill: Paint::None, ..CharStyle::default() }; + for (i, style) in [char_fill, object_fill].into_iter().enumerate() { + let mut d = doc_with(|d| { + let mut n = Node::new(d.alloc_id(), NodeKind::Text(Box::new(TextObject::point(Point::new(20.0, 100.0), "AB", style)))); + if i == 1 { + n.appearance.items = vec![AppearanceItem::Fill(FillLayer { overprint: true, ..FillLayer::new(white.clone()) })]; + } + vec![n] + }); + let fills = overprint_at_fills(&page_of(&d, &opts(&d))); + assert!(!fills.is_empty() && fills.iter().all(|&on| !on), "{i}: {fills:?}"); + d.setup.discard_white_overprint = false; + let fills = overprint_at_fills(&page_of(&d, &opts(&d))); + assert!(!fills.is_empty() && fills.iter().all(|&on| on), "{i}: {fills:?}"); + } +} + +/// Discard White Overprint applies to paper white only: a white fill linked to a spot swatch +/// still overprints, at 100% and 50%; one linked to a global process swatch, at a 0% tint of a +/// spot swatch, or to a spot swatch without a color (written as process) knocks out. +#[test] +fn spot_white_fills_overprint_with_discard_white_overprint() { + let white = Paint::solid(Color::WHITE); + let cases = [ + (true, white.clone(), 1.0, true), + (true, white.clone(), 0.5, true), + (false, white.clone(), 1.0, false), + (true, white.clone(), 0.0, false), + (true, Paint::None, 1.0, false), + ]; + for (spot, swatch, tint, overprints) in cases { + let mut d = doc_with(|_| vec![]); + d.swatches.push(Swatch { name: "White Ink".into(), paint: swatch, global: true, spot }); + let mut n = red_rect(&mut d); + if let Some(AppearanceItem::Fill(f)) = n.appearance.items.first_mut() { + f.paint = Paint::Solid { color: Color::WHITE, swatch: Some("White Ink".into()), tint }; + f.overprint = true; + } + let layer = d.layers[0].id; + d.insert(Some(layer), 0, n).unwrap(); + assert!(d.setup.discard_white_overprint); + let fills = overprint_at_fills(&page_of(&d, &opts(&d))); + assert_eq!(fills, vec![overprints], "spot: {spot}, tint: {tint}, expected to overprint: {overprints}"); + } +} + const GOLD: Color = Color::Cmyk { c: 0.0, m: 0.2, y: 0.8, k: 0.1 }; const LEAF: Color = Color::Cmyk { c: 1.0, m: 0.0, y: 1.0, k: 0.0 }; @@ -1253,6 +1353,27 @@ fn an_overprinting_colorized_image_writes_only_its_process_inks() { assert!(ps.contains("VCdn0 setcolorspace") && ps.contains("/DeviceCMYK setcolorspace"), "{ps}"); } +/// An overprinting colorized image in the tile of an overprinting pattern fill is written in only +/// the process inks it puts down, as it is outside a pattern, so the inks below it stay. +#[test] +fn an_overprinting_colorized_image_in_an_overprinting_pattern_writes_only_its_process_inks() { + let mut d = overprinting_colorized_doc(vec![0, 128, 255], Color::cmyk(1.0, 0.0, 0.0, 0.0), true); + let id = d.layers[0].children().unwrap()[0].id; + let image = d.remove(id).unwrap(); + d.patterns.push(vectorcraft_doc::PatternDef::new("tile", vec![image])); + let mut n = red_rect(&mut d); + if let Some(AppearanceItem::Fill(f)) = n.appearance.items.first_mut() { + f.paint = Paint::Pattern { pattern: "tile".into(), xf: Affine::IDENTITY }; + f.overprint = true; + } + let layer = d.layers[0].id; + d.insert(Some(layer), 0, n).unwrap(); + for level in Level::ALL { + let ps = page_of(&d, &EpsOptions { level, ..opts(&d) }); + assert!(ps.contains("true op") && ps.contains("VCdn0 setcolorspace") && !ps.contains("/DeviceCMYK setcolorspace"), "{level:?}: {ps}"); + } +} + /// On a separation plate, an overprinting colorized image whose color puts none of the plate's ink /// down is drawn as nothing, so the ink below stays; one that knocks out, or whose overprint is /// discarded, is drawn as paper. (The plate's colors come from the separator, which has already diff --git a/crates/pdf/src/print/plates.rs b/crates/pdf/src/print/plates.rs index 38e46654cf..f93b7a4d8a 100644 --- a/crates/pdf/src/print/plates.rs +++ b/crates/pdf/src/print/plates.rs @@ -238,8 +238,9 @@ impl<'a> Separator<'a> { /// Overprinting fills and strokes of `a`'s subtree with a Normal blending mode, and /// overprinting character fills and strokes, that put none of ink `plate` down leave its plate - /// as it is: they are drawn as nothing on it (paper white ones that `discard_white` knocks out - /// aside, [`DiscardWhite::discards`]). A writer without blending modes (PostScript) then keeps the ink below them, + /// as it is: they are drawn as nothing on it. Paper white ones that `discard_white` knocks out + /// ([`DiscardWhite::discards`]) stop overprinting instead, and knock out the ink below them on + /// the plate as in composite output. A writer without blending modes (PostScript) then keeps the ink below them, /// where it would draw their Darken as a knockout. One that puts any ink down is drawn, and on /// a PostScript plate its ink replaces the ink below, as a nonzero component of an overprinting /// color replaces the backdrop's with overprint mode 1 (ISO 32000-1, 11.7.4.2). On a @@ -259,6 +260,9 @@ impl<'a> Separator<'a> { } let image = whole && n.extras().colorize.as_deref().is_some_and(|p| self.no_ink(plate, p)); for it in &mut n.appearance.items { + if it.overprint() && discard_white.discards(it.paint()) { + *it.overprint_mut() = false; + } let normal = match it { AppearanceItem::Fill(l) => l.blend == BlendMode::Normal, AppearanceItem::Stroke(l) => l.blend == BlendMode::Normal, @@ -274,6 +278,8 @@ impl<'a> Separator<'a> { } if let NodeKind::Text(t) = &mut n.kind { for r in &mut t.runs { + r.style.overprint_fill &= !discard_white.discards(&r.style.fill); + r.style.overprint_stroke &= !discard_white.discards(&r.style.stroke); if inkless(r.style.overprint_fill, &r.style.fill) { r.style.fill = Paint::None; } else if r.style.overprint_fill { diff --git a/crates/scriptcheck/src/catalog.rs b/crates/scriptcheck/src/catalog.rs index 82fd61084b..dc4249b6a6 100644 --- a/crates/scriptcheck/src/catalog.rs +++ b/crates/scriptcheck/src/catalog.rs @@ -164,7 +164,7 @@ features! { DollarEnv "dollar.env" Files, DollarEvalFile "dollar.evalFile" Files, DynamicCode "dynamicCode" Language, - E4x "e4x" HostOnly, + E4x "e4x" Language, ExternalObject "externalObject" HostOnly, FileDialog "file.dialog" Files, FileExecute "file.execute" Files, @@ -186,6 +186,6 @@ features! { SelectTool "selectTool" HostOnly, Socket "socket" HostOnly, UnitValue "unitValue" Language, - Xml "xml" HostOnly, + Xml "xml" Language, Xmp "xmp" HostOnly, } diff --git a/crates/scriptcheck/src/lib.rs b/crates/scriptcheck/src/lib.rs index 2bd8c60fba..e74d299aaa 100644 --- a/crates/scriptcheck/src/lib.rs +++ b/crates/scriptcheck/src/lib.rs @@ -109,7 +109,8 @@ impl Kind { /// A kind of help a script needs from the app that runs it. #[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum Need { - /// The script language's own objects and directives (`$`, `alert`, `UnitValue`, `#target`). + /// The script language's own objects, syntax and directives (`$`, `alert`, `UnitValue`, E4X + /// with the `XML` object, `#target`). Language, /// The reference app's document model (`app.activeDocument…`). Dom, @@ -120,7 +121,7 @@ pub enum Need { /// Dialogs and windows of its own. Dialogs, /// Features only the reference app has (palettes, messages to other apps, network - /// connections, native code, E4X, actions). + /// connections, native code, actions). HostOnly, } diff --git a/crates/scriptcheck/src/tests.rs b/crates/scriptcheck/src/tests.rs index fec22ed62d..45f5d02d02 100644 --- a/crates/scriptcheck/src/tests.rs +++ b/crates/scriptcheck/src/tests.rs @@ -1550,6 +1550,13 @@ fn application_methods_are_features_not_members() { assert_eq!(r.needs, [Need::MenuCommands, Need::HostOnly]); } +#[test] +fn e4x_and_the_xml_object_need_only_the_language() { + let r = report("var x = ;\nvar y = new XML(s);\nfor each (var v in x.b) {}\n"); + assert!(feature(&r, "e4x").is_some() && feature(&r, "xml").is_some()); + assert_eq!(r.needs, [Need::Language]); +} + #[test] fn type_names_compared_or_created_are_listed() { let r = report(concat!( diff --git a/crates/svg/src/export.rs b/crates/svg/src/export.rs index 84b2efa32b..e0f5540b7d 100644 --- a/crates/svg/src/export.rs +++ b/crates/svg/src/export.rs @@ -195,9 +195,9 @@ fn write(doc: &Document, opts: &ExportOptions, native: Option<&[u8]>, id_prefix: root = root.attr("version", "1.2").attr("baseProfile", "tiny"); } if !opts.responsive { - if let Some(suffix) = doc.units.svg_suffix() { - let w_val = physical_num(doc.units.from_pt(rect.width())); - let h_val = physical_num(doc.units.from_pt(rect.height())); + if let Some((unit, suffix)) = doc.units.svg_unit().and_then(|u| Some((u, u.svg_suffix()?))) { + let w_val = physical_num(unit.from_pt(rect.width())); + let h_val = physical_num(unit.from_pt(rect.height())); root = root.attr("width", format_args!("{w_val}{suffix}")).attr("height", format_args!("{h_val}{suffix}")); } else { root = root.attr("width", &ww).attr("height", &hh); diff --git a/crates/svg/tests/it/import_units.rs b/crates/svg/tests/it/import_units.rs index 0140741aeb..91138d8a93 100644 --- a/crates/svg/tests/it/import_units.rs +++ b/crates/svg/tests/it/import_units.rs @@ -192,3 +192,28 @@ fn export_physical_units_writes_unit_suffixes() { let back = import(&s).unwrap(); assert_eq!(back.units, Unit::Millimeters); } + +/// The `width` of `svg`'s root as a length in points, read by the SVG and CSS absolute units +/// (96 px per inch). `None` when it has no unit an SVG reader takes as physical. +fn root_width_in_points(svg: &str) -> Option { + let start = svg.find("().ok().map(|v| v * points_per_unit) +} + +#[test] +fn every_physical_document_unit_exports_its_printed_size() { + // 100 inches by 50: feet, yards, meters, Q and Ha have no SVG unit of their own. + for unit in [Unit::Feet, Unit::FeetInches, Unit::Yards, Unit::Meters, Unit::Q, Unit::Ha, Unit::Inches, Unit::Millimeters] { + let mut d = Document::new(7200.0, 3600.0); + d.units = unit; + let s = export(&d, &ExportOptions::default()); + let width = root_width_in_points(&s).unwrap_or_else(|| panic!("{unit:?}: no physical width in {s}")); + assert!((width - 7200.0).abs() < 0.01, "{unit:?}: {width} pt in {s}"); + let back = import(&s).unwrap(); + assert!(close_rect(back.artboards[0].rect, d.artboards[0].rect), "{unit:?}: {:?}", back.artboards[0].rect); + } +} diff --git a/crates/text/src/fontdb/build.rs b/crates/text/src/fontdb/build.rs index 38f5aece65..b3f6fbbff8 100644 --- a/crates/text/src/fontdb/build.rs +++ b/crates/text/src/fontdb/build.rs @@ -83,6 +83,7 @@ pub(super) fn make_face(bytes: FontBytes, index: u32, spec: FaceStyle, path: Opt unencoded: std::sync::OnceLock::new(), char_list: std::sync::OnceLock::new(), named_chars: std::sync::OnceLock::new(), + glyph_names: std::sync::OnceLock::new(), }) } diff --git a/crates/text/src/fontdb/face.rs b/crates/text/src/fontdb/face.rs index c418d40308..85633460dc 100644 --- a/crates/text/src/fontdb/face.rs +++ b/crates/text/src/fontdb/face.rs @@ -210,6 +210,8 @@ pub struct FontFace { pub(super) char_list: std::sync::OnceLock>, /// [`Self::name_owner`]'s glyph names to characters, read once. pub(super) named_chars: std::sync::OnceLock>, + /// [`Self::glyph_name`]'s names by glyph id, read once. + pub(super) glyph_names: std::sync::OnceLock>>>, } impl vectorcraft_doc::FileFontFace for FontFace { diff --git a/crates/text/src/fontdb/gsub.rs b/crates/text/src/fontdb/gsub.rs index 7529a82929..2fef163351 100644 --- a/crates/text/src/fontdb/gsub.rs +++ b/crates/text/src/fontdb/gsub.rs @@ -589,11 +589,23 @@ impl FontFace { } /// The name of glyph `gid` from the font's `post` or `CFF` table: `None` for a glyph past the - /// face's glyphs, or when the font has no names (the ids are then `gid12`). + /// face's glyphs, or when the font has no names (the ids are then `gid12`). The names are read + /// once for the face, in one pass over the table. pub fn glyph_name(&self, gid: u32) -> Option { - let font = self.skrifa()?; - let name = font.glyph_names().get(skrifa::GlyphId::new(gid))?; - (!name.is_synthesized()).then(|| name.as_str().to_string()) + let names = self.glyph_names.get_or_init(|| { + let Some(font) = self.skrifa() else { return Vec::new() }; + let names = font.glyph_names(); + let mut out = vec![None; names.num_glyphs() as usize]; + for (id, name) in names.iter() { + if let Some(slot) = out.get_mut(id.to_u32() as usize) + && !name.is_synthesized() + { + *slot = Some(Box::from(name.as_str())); + } + } + out + }); + names.get(usize::try_from(gid).ok()?)?.as_deref().map(str::to_string) } /// The kinds of glyph the face's `GSUB` table gives ([`GlyphCategoryKind`]), in the order of @@ -651,6 +663,28 @@ mod tests { assert!(face.glyph_categories().is_empty()); } + /// The names read in one pass are the names the font gives each glyph id, for every bundled + /// face, and a glyph past the face's glyphs has none. + #[test] + fn glyph_names_read_once_match_each_glyphs_own_name() { + let db = super::super::FontDb::with_font_dirs(vec![]); + let mut checked = 0; + for family in db.families() { + for style in db.styles(&family) { + let Some(face) = db.face(&family, &style) else { continue }; + let Some(font) = face.skrifa() else { continue }; + let names = font.glyph_names(); + for gid in 0..face.glyph_count() { + let own = names.get(skrifa::GlyphId::new(gid)).filter(|n| !n.is_synthesized()).map(|n| n.as_str().to_string()); + assert_eq!(face.glyph_name(gid), own, "{family} {style}: glyph {gid}"); + checked += 1; + } + assert_eq!(face.glyph_name(face.glyph_count()), None, "{family} {style}"); + } + } + assert!(checked > 0, "the bundled faces have glyphs"); + } + #[test] fn kinds_round_trip_through_their_ids() { for kind in GlyphCategoryKind::all() { diff --git a/crates/ui-egui/src/app.rs b/crates/ui-egui/src/app.rs index 299f4c22d5..2f25c3ea4d 100644 --- a/crates/ui-egui/src/app.rs +++ b/crates/ui-egui/src/app.rs @@ -6,10 +6,10 @@ use craft::platform::clock::monotonic_ms; use craft::theme::variant::Tone; use craft::ui::buttons::{ActiveLook, PushButtonLook}; use craft::ui::choice::ChoiceLook; -use craft::ui::contract::{Bind, CaptionInk, GlyphColon, LinkLabelInk, LinkLabelUnderline, QuietHeader, SectionRhythm}; +use craft::ui::contract::{Bind, CaptionInk, GlyphColon, LinkLabelInk, LinkLabelUnderline, MoveBandCursor, QuietHeader, SectionRhythm}; use craft::ui::docking::IconGroupSeparator; use craft::ui::list::{CommandHighlight, ThumbRows}; -use craft::ui::menu::MenuTitlePad; +use craft::ui::menu::MenuTitleLook; use craft::ui::patterns::form_dialogs::PresetCardLook; use craft::ui::runtime::env::{RootEnv, Scale, ScrubDrags, WindowKey}; use craft::ui::runtime::frame::{FrameInput, FrameOutput}; @@ -19,7 +19,7 @@ use craft::ui::sections::{DialogButtonLook, QuietTitleRow}; use craft::ui::shell::embed::CloseDecision; use craft::ui::shell::{AppShell, CanvasPanel, Slot}; use craft::ui::style::TrackFill; -use craft::ui::tabs::DocumentTabLook; +use craft::ui::tabs::{DocumentTabLook, TabCloseLook}; use craft::ui::text::{NumberLook, NumberPrecision}; use vectorcraft_engine::cmd::clipboard::PASTE_ORDER; use vectorcraft_engine::cmd::toast::Level; @@ -741,10 +741,14 @@ pub(crate) fn root_env(prefs: &vectorcraft_engine::Prefs, native_ppp: f32) -> Ro root.values.set(ThumbRows::Tight); // The Layers Objects search field fills the filter bar up to its Filter button, as production's did. root.values.set(ObjectsSearch::Fill); - // The menu bar's titles stand as close as production's, which share the line with the bar's other controls. - root.values.set(MenuTitlePad::Control); + // The menu bar's titles are production's egui buttons: a push button high, 2 points beside the text, rounded. + root.values.set(MenuTitleLook::Button); + // The title bar and the panel headers keep the arrow, over the menu titles too, as production's did. + root.values.set(MoveBandCursor::Arrow); // Document tabs show their title and its `*` in the label's semibold face, as production drew them. root.values.set(DocumentTabLook::Semibold); + // A document tab's × is a small glyph that brightens under the pointer, with no fill, as production drew it. + root.values.set(TabCloseLook::Glyph); // A collapsed panel column's icon groups stand apart by a hairline, as production drew them. root.values.set(IconGroupSeparator::Rule); // New Document's preset cards show blank paper on a flat card, as production drew them. diff --git a/crates/ui-egui/src/canvas/home.rs b/crates/ui-egui/src/canvas/home.rs index 556574d1ba..d95cdc02e1 100644 --- a/crates/ui-egui/src/canvas/home.rs +++ b/crates/ui-egui/src/canvas/home.rs @@ -1,11 +1,13 @@ -use craft::behavior::IconId; -use craft::ui::buttons::{Button, ControlPlace, LinkLook}; -use craft::ui::contract::{Bind, Gap, Props as _, Show as _, ShowContainer as _}; -use craft::ui::display::{Shade, Text}; -use craft::ui::layout_components::{Row, Stack}; -use craft::ui::runtime::env::{Overrides, with_env}; -use craft::ui::shell::{RecentFile, StartAction, StartLayout, StartLink, StartScreen, Template}; -use craft::ui::style::TypeRole; +use craft::behavior::{ColumnWidth, IconId}; +use craft::ui::buttons::{Link, LinkLook}; +use craft::ui::contract::{Bind, Gap, Pad, Props as _, Show as _, ShowContainer as _, clicked}; +use craft::ui::display::Text; +use craft::ui::layout::CellAlign; +use craft::ui::layout_components::{Grid, Stack}; +use craft::ui::runtime::env::{Env, Overrides, with_env}; +use craft::ui::sections::Section; +use craft::ui::shell::{RecentFile, StartAction, StartLayout, StartLink, StartPlace, StartScreen, Template}; +use craft::ui::style::{SurfaceKind, TypeRole}; use super::{Ui, VectorcraftApp, json}; @@ -15,6 +17,10 @@ const TEMPLATES: [&str; 6] = ["Letter", "A4", "Web 1920×1080", "Phone 390×844" /// The icons of the three `community::link_urls` links, in their order. const LINK_ICONS: [&str; 3] = ["globe", "external-link", "git-branch"]; +/// The Learn cards across a full-width column, and across a narrower one. +const FOUR: &[ColumnWidth] = &[ColumnWidth::fill(1.0); 4]; +const TWO: &[ColumnWidth] = &[ColumnWidth::fill(1.0); 2]; + /// The Home screen (`app.home`; with no document open, unless its preference is off). pub(super) fn home(app: &mut VectorcraftApp, ui: &mut Ui, rect: egui::Rect) { let recent: Vec = crate::io::recent_files(app) @@ -37,16 +43,14 @@ pub(super) fn home(app: &mut VectorcraftApp, ui: &mut Ui, rect: egui::Rect) { for ((label, url), icon) in crate::community::link_urls(app).into_iter().zip(LINK_ICONS) { links.push(StartLink::url(tl!(label), Some(IconId::new(icon)), url)); } - // The column shows no view switch or sort; the bindings hold copies so the Learn section can borrow the app. - let (mut view, mut sort) = (app.ui.home_view, app.ui.home_sort); let mut pressed = None; - let mut learn = |ui: &mut Ui| learn(app, ui, &mut pressed); let mut child = ui.new_child(egui::UiBuilder::new().max_rect(rect).layout(egui::Layout::top_down(egui::Align::Min))); // Production's community links read in the accent alone, with no underline. let plain_links = |overrides: &mut Overrides| { overrides.values.set(LinkLook::Plain); }; - let start = StartScreen::new(Bind::bound(&mut view), Bind::bound(&mut sort), &recent) + // Learn follows the presets, which stand right under New and Open as in production 0.24.1. + let start = StartScreen::new(Bind::bound(&mut app.ui.home_view), Bind::bound(&mut app.ui.home_sort), &recent) .layout(StartLayout::Column) .title(tl!("Welcome to VectorCraft")) .subtitle(tl!("Vector illustration — fast, open, scriptable.")) @@ -57,15 +61,13 @@ pub(super) fn home(app: &mut VectorcraftApp, ui: &mut Ui, rect: egui::Rect) { .templates_title(tl!("Quickly start a new file")) .links(&links) .links_title(tl!("Community")) - .app_section(tl!("Learn"), &mut learn); + .section(StartPlace::AfterSections, |ui, _| learn(ui, &mut pressed)); let out = with_env(&mut child, plain_links, |ui| start.show(ui)); - app.ui.home_view = view; - app.ui.home_sort = sort; for action in out.actions { run_action(app, action); } - if let Some(id) = pressed - && let Err(e) = app.run("learn.show", json!({ "tutorial": id })) + if let Some((command, args)) = pressed + && let Err(e) = app.run(command, args) { app.status(e); } @@ -92,31 +94,36 @@ fn run_action(app: &mut VectorcraftApp, action: StartAction) { } } -/// The Home screen's Learn section: the Quick skill guide card, which shows the Learn panel's list -/// of skills, and the Learn panel's tutorials under their skills (each title dim over its tutorials), each a button -/// that shows the panel at its steps (`learn.show`), as tall as New and Open and a page heading's gap apart, as -/// production spaced them. The start screen may run this twice in a pass, so it only draws and records the tutorial -/// pressed in `pressed`. -fn learn(app: &mut VectorcraftApp, ui: &mut Ui, pressed: &mut Option<&'static str>) { - use crate::panels::learn::{catalog, guide_card}; - let _ = Stack::new().gap(Gap::PageHeading).fill_width().show(ui, |ui, _| { - guide_card(app, ui); // PLAN: assumed `guide_card(app, ui)` as document-panels-w18 leaves it, on `Button::detail`. - for skill in catalog::SKILLS { - let _ = Stack::new().gap(Gap::Stack).fill_width().show(ui, |ui, _| { - let _ = Text::new(skill.title).role(TypeRole::Label).shade(Shade::Muted).show(ui); - let place = |overrides: &mut Overrides| { - overrides.values.set(ControlPlace::PageAction); - }; - let _ = with_env(ui, place, |ui| { - Row::new().show(ui, |ui, _| { - for tutorial in skill.tutorials { - if Button::new(tutorial.title).id_salt(tutorial.id).show(ui).clicked() { - *pressed = Some(tutorial.id); +/// The Home screen's Learn section, after the new-file presets: a Column page section whose heading row ends in the +/// Quick skill guide link, which shows the Learn panel's list of skills (`learn.skills`), over a card per skill: its +/// title over its tutorials as links, each showing the panel at its steps (`learn.show`). The four cards stand in one +/// row in a column at its full `size.page.column` width, and two by two in a narrower one. The start screen may run +/// this twice in a pass, so it only draws and records the command chosen in `pressed`. +fn learn(ui: &mut Ui, pressed: &mut Option<(&'static str, serde_json::Value)>) { + use crate::panels::learn::catalog::SKILLS; + let (mut guide, mut tutorial) = (false, None); + let across = if ui.available_width() + 0.5 >= Env::of(ui).tokens.size.page.column { FOUR } else { TWO }; + let section = Section::fixed(tl!("Learn")).quiet_header().header_gap(Gap::PageHeading); + let _ = section.controls(|ui, _| guide |= clicked(&Link::new(tl!("Quick skill guide")).show(ui))).show(ui, |ui, _| { + let _ = Grid::new(across).gap(Gap::Section).cells(CellAlign::Top).fill_width().show(ui, |ui, _| { + for skill in SKILLS { + let card = Stack::new().surface(SurfaceKind::Raised).pad(Pad::Regular).gap(Gap::Stack).fill_width(); + let _ = card.show(ui, |ui, _| { + let _ = Text::new(skill.title).role(TypeRole::BodyStrong).show(ui); + let _ = Stack::new().gap(Gap::PageLink).show(ui, |ui, _| { + for t in skill.tutorials { + if clicked(&Link::new(t.title).id_salt(t.id).show(ui)) { + tutorial = Some(t.id); } } - }) + }); }); - }); - } + } + }); }); + if guide { + *pressed = Some(("learn.skills", json!({}))); + } else if let Some(id) = tutorial { + *pressed = Some(("learn.show", json!({ "tutorial": id }))); + } } diff --git a/crates/ui-egui/src/canvas/selection.rs b/crates/ui-egui/src/canvas/selection.rs index 2018e50323..96be3fcc89 100644 --- a/crates/ui-egui/src/canvas/selection.rs +++ b/crates/ui-egui/src/canvas/selection.rs @@ -2,7 +2,8 @@ //! centre point, point type's origin, the key anchor). Each rule is a function of the app that returns what to draw; //! `show` hands the results to the framework's controls, which keep what they stroke between passes. -use std::collections::hash_map::DefaultHasher; +use std::collections::HashMap; +use std::collections::hash_map::{DefaultHasher, Entry}; use std::hash::{Hash, Hasher}; use craft::behavior::Input; @@ -316,13 +317,32 @@ pub(super) fn anchors(app: &VectorcraftApp, st: &DocState, tool: &str, tool_poin primary.and_then(|key| chosen.iter().find(|(k, _)| *k == key)).map(|(_, knots)| knots.clone()).unwrap_or_default(), segment.map(|(_, at)| at), ); - for (key, knots) in chosen.into_iter().filter(|(key, _)| Some(*key) != primary) { - selection = selection.also(key, knots); - } + selection.others = by_key(chosen.into_iter().filter(|(key, _)| Some(*key) != primary)); out.selection = selection; out } +/// `listed` with the lists of a repeated key joined, each key where it first appears: what +/// [`PathSelection::also`] makes of the entries added one at a time, found with one lookup per entry. +fn by_key(listed: impl IntoIterator)>) -> Vec<(K, Vec)> { + let mut at: HashMap = HashMap::new(); + let mut out: Vec<(K, Vec)> = Vec::new(); + for (key, items) in listed { + match at.entry(key) { + Entry::Occupied(seen) => { + if let Some((_, held)) = out.get_mut(*seen.get()) { + held.extend(items); + } + } + Entry::Vacant(new) => { + new.insert(out.len()); + out.push((key, items)); + } + } + } + out +} + /// The outline of the object under the pointer at document point `at`, at view `zoom`, for Smart Guides › Object /// Highlighting: the object a click of the selection tools would pick, unless the click keeps the selection (the /// object, or with the Selection tool selected art inside it, is selected) or the object has too many points. diff --git a/crates/ui-egui/src/canvas/selection/tests.rs b/crates/ui-egui/src/canvas/selection/tests.rs index fdca4b2a9e..4f5e469a63 100644 --- a/crates/ui-egui/src/canvas/selection/tests.rs +++ b/crates/ui-egui/src/canvas/selection/tests.rs @@ -558,3 +558,34 @@ fn an_empty_selection_has_no_marks() { let st = app.session.active().unwrap(); assert_eq!(dots(&app, st).centers.len() + dots(&app, st).origins.len(), 0); } + +/// A path key that counts the comparisons made with it. +#[derive(Clone, Copy, Debug)] +struct Counted<'a>(u64, &'a std::cell::Cell); + +impl PartialEq for Counted<'_> { + fn eq(&self, other: &Self) -> bool { + self.1.set(self.1.get() + 1); + self.0 == other.0 + } +} + +impl Eq for Counted<'_> {} + +impl Hash for Counted<'_> { + fn hash(&self, state: &mut H) { + self.0.hash(state); + } +} + +// Grouping the selected anchors of 2,000 paths compares each key a bounded number of times, not once per path listed +// before it, and joins a repeated path's anchors where the path first appears, as `PathSelection::also` does. +#[test] +fn grouping_selected_anchors_by_path_compares_each_path_a_bounded_number_of_times() { + let compared = std::cell::Cell::new(0); + let listed = (0..2000u64).map(|key| (Counted(key, &compared), vec![key])).chain([(Counted(5, &compared), vec![9])]); + let grouped = by_key(listed); + assert_eq!(grouped.iter().map(|(key, _)| key.0).collect::>(), (0..2000).collect::>()); + assert_eq!(grouped[5].1, vec![5, 9]); + assert!(compared.get() < 2 * 2001, "{} comparisons for 2,001 entries", compared.get()); +} diff --git a/crates/ui-egui/src/dialogs/char_style_options.rs b/crates/ui-egui/src/dialogs/char_style_options.rs index 0cd18ff6e7..f1d1b618af 100644 --- a/crates/ui-egui/src/dialogs/char_style_options.rs +++ b/crates/ui-egui/src/dialogs/char_style_options.rs @@ -437,16 +437,17 @@ fn case_from_attrs(attrs: &Map) -> Option<&'static str> { /// and a final `%` in the percent fields or `°` in Character Rotation. fn typed_number(key: &str, text: &str) -> Option { let text = text.trim().replace('\u{2212}', "-"); - let text = vectorcraft_doc::decimal_point(&text); let mark = match key { "size" | "leading" | "baseline_shift" | "tcyUpDown" | "tcyLeftRight" | "stroke_width" => { - return vectorcraft_doc::Unit::Points.parse(&text); + return vectorcraft_doc::Unit::Points.parse(&vectorcraft_doc::decimal_point(&text)); } "h_scale" | "v_scale" | "tsume" | "fill_tint" | "stroke_tint" => Some('%'), "rotation" => Some('°'), _ => None, }; - vectorcraft_doc::parse_number(mark.and_then(|m| text.strip_suffix(m)).unwrap_or(&text)) + // The suffix comes off before the comma is read, so `1,000%` is refused as `1,000` is. + let number = mark.and_then(|m| text.strip_suffix(m)).unwrap_or(&text); + vectorcraft_doc::parse_number(&vectorcraft_doc::decimal_point(number)) } fn optional_number(d: &Values, key: &str) -> Result, String> { diff --git a/crates/ui-egui/src/dialogs/char_style_options/tests.rs b/crates/ui-egui/src/dialogs/char_style_options/tests.rs index 44d443b361..048e16077d 100644 --- a/crates/ui-egui/src/dialogs/char_style_options/tests.rs +++ b/crates/ui-egui/src/dialogs/char_style_options/tests.rs @@ -529,13 +529,25 @@ fn number_fields_take_field_arithmetic() { ("leading", "1 in", 72.0), ("baseline_shift", "\u{2212}2", -2.0), ("kerning", "12,5", 12.5), + ("h_scale", "12,5%", 12.5), + ("rotation", "12,5°", 12.5), ]; for (key, text, want) in typed { let (mut d, _) = dialog_for(json!({})); put(&mut d, key, json!(text)); assert_eq!(optional_number(&Values::new(&d), key), Ok(Some(json!(want))), "{key} {text}"); } - for (key, text) in [("size", "12°"), ("leading", "50%"), ("tracking", "10%"), ("rotation", "45%"), ("h_scale", "1%2"), ("size", "1e3")] { + for (key, text) in [ + ("size", "12°"), + ("leading", "50%"), + ("tracking", "10%"), + ("rotation", "45%"), + ("h_scale", "1%2"), + ("size", "1e3"), + ("h_scale", "1,000"), + ("h_scale", "1,000%"), + ("rotation", "1,000°"), + ] { let (mut d, _) = dialog_for(json!({})); put(&mut d, key, json!(text)); assert!(optional_number(&Values::new(&d), key).is_err(), "{key} {text}"); diff --git a/crates/ui-egui/src/panels/align.rs b/crates/ui-egui/src/panels/align.rs index 53c5273d55..8cc25394cb 100644 --- a/crates/ui-egui/src/panels/align.rs +++ b/crates/ui-egui/src/panels/align.rs @@ -306,7 +306,7 @@ fn bar_items(buttons: impl Iterator) -> BarItems { /// Align panel's Align To says (the key object while there is one), as its own buttons do (#789), /// and the selected artboards with the Artboard tool chosen. pub(crate) fn align_buttons(_app: &mut VectorcraftApp, ui: &mut Ui) { - Row::new().show(ui, |ui, _| { + Row::new().wrap(true).show(ui, |ui, _| { for (icon, b) in align_icons() { command_button(ui, bar_glyph(b).unwrap_or(icon), b); } diff --git a/crates/ui-egui/src/panels/attributes.rs b/crates/ui-egui/src/panels/attributes.rs index 11fe0a02bf..516194a51b 100644 --- a/crates/ui-egui/src/panels/attributes.rs +++ b/crates/ui-egui/src/panels/attributes.rs @@ -154,7 +154,7 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) { }); if !part_hidden(app, OPTIONS_KEY) { Divider::horizontal().show(ui); - Row::new().show(ui, |ui, _| { + Row::new().wrap(true).show(ui, |ui, _| { let center = [("dc-center-hide", tl!("Don't Show Center"), false), ("dc-center-show", tl!("Show Center"), true)]; acts.extend(pair(ui, tl!("Show Center"), has, info.show_center, center).map(|v| ("attributes.set", json!({ "showCenter": v })))); let dir = [("dc-dir-off", tl!("Reverse Path Direction Off"), false), ("dc-dir-on", tl!("Reverse Path Direction On"), true)]; @@ -170,7 +170,7 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) { let maps = ImageMap::ALL.map(|m| Entry::new(m, m.label())); let name = side_name(tl!("Image Map:")); Field::new(name.clone()).show(ui, |ui, _| { - Row::new().show(ui, |ui, _| { + Row::new().wrap(true).show(ui, |ui, _| { let pick = Select::new(name.clone(), Bind::given(or_mixed(info.image_map)), &maps).enabled(has).show(ui); acts.extend(pick.events.committed().map(|m| ("attributes.set", json!({ "imageMap": m })))); let browser = Button::new(tl!("Browser")).enabled(url.is_some()).tooltip(tl!("Open the URL in the web browser")).show(ui); diff --git a/crates/ui-egui/src/panels/doc_info.rs b/crates/ui-egui/src/panels/doc_info.rs index e323f23620..88ee1d6f6f 100644 --- a/crates/ui-egui/src/panels/doc_info.rs +++ b/crates/ui-egui/src/panels/doc_info.rs @@ -33,7 +33,7 @@ pub struct DocInfoView { /// A `label: value` row. `label` is shown as given: translate an interface label first, a name /// stays as it is. pub(crate) fn row(ui: &mut Ui, label: &str, value: String) { - Row::new().fill_width().align(RowAlign::SpaceBetween).show(ui, |ui, _| { + Row::new().fill_width().align(RowAlign::SpaceBetween).wrap(true).show(ui, |ui, _| { Text::new(label.to_string()).shade(Shade::Muted).show(ui); // The value can be selected and copied (#8432). SelectableText::new(label.to_string(), &value).show(ui); diff --git a/crates/ui-egui/src/panels/learn.rs b/crates/ui-egui/src/panels/learn.rs index 7b67ecc804..d765fe48c3 100644 --- a/crates/ui-egui/src/panels/learn.rs +++ b/crates/ui-egui/src/panels/learn.rs @@ -13,8 +13,7 @@ //! one tutorial, `learn.back` goes up one level, `learn.locateTool` shows where a tool is, //! `learn.openSample`, `learn.markStep`, `learn.finish` and `learn.next` run the practice controls, //! `learn.resetProgress` clears the progress, and `window.learn` shows or hides the panel. The Home -//! screen's Learn section shows the same card ([`guide_card`]) and the tutorials, which open the -//! panel. +//! screen's Learn section links to the list of skills and to each tutorial, which open the panel. pub mod catalog; pub mod locate; @@ -109,9 +108,8 @@ fn for_you(app: &mut VectorcraftApp, ui: &mut Ui) { } /// The Quick skill guide card, as one button: a click, or Enter or Space while it has the keyboard -/// focus, shows the panel's list of skills (`learn.skills`). The For you tab and the Home screen's -/// Learn section show it. -pub(crate) fn guide_card(app: &mut VectorcraftApp, ui: &mut Ui) { +/// focus, shows the panel's list of skills (`learn.skills`). The For you tab shows it. +fn guide_card(app: &mut VectorcraftApp, ui: &mut Ui) { // PLAN: assumed `Button::detail(impl Into