diff --git a/app/package-lock.json b/app/package-lock.json index feb2ce74..610453ce 100644 --- a/app/package-lock.json +++ b/app/package-lock.json @@ -10,7 +10,7 @@ "dependencies": { "maplibre-gl": "^4.1.3", "pixelmatch": "^5.3.0", - "pmtiles": "^3.0.5", + "pmtiles": "3.0.5", "react": "^18.2.0", "react-dom": "^18.2.0", "react-dropzone": "^14.2.3", diff --git a/app/package.json b/app/package.json index 0eb2f09f..cc39c14d 100644 --- a/app/package.json +++ b/app/package.json @@ -13,7 +13,7 @@ "dependencies": { "maplibre-gl": "^4.1.3", "pixelmatch": "^5.3.0", - "pmtiles": "^3.0.5", + "pmtiles": "3.0.5", "react": "^18.2.0", "react-dom": "^18.2.0", "react-dropzone": "^14.2.3", diff --git a/app/src/MapViewComponent.tsx b/app/src/MapViewComponent.tsx index a0d7266e..90648755 100644 --- a/app/src/MapViewComponent.tsx +++ b/app/src/MapViewComponent.tsx @@ -123,7 +123,6 @@ function getMaplibreStyle( } else { style.layers = style.layers.concat(layers("protomaps", theme)); } - return style; } @@ -174,12 +173,7 @@ function MapLibreView(props: { const map = new maplibregl.Map({ hash: "map", container: "map", - style: getMaplibreStyle( - props.theme, - props.localSprites, - props.tiles, - props.npmLayers, - ), + style: getMaplibreStyle("", false), }); map.addControl(new maplibregl.NavigationControl()); @@ -223,7 +217,7 @@ function MapLibreView(props: { maplibregl.removeProtocol("pmtiles"); map.remove(); }; - }, [props.npmLayers, props.theme, props.tiles, props.localSprites]); + }, []); useEffect(() => { if (protocolRef.current) { diff --git a/sprites/.gitignore b/sprites/.gitignore new file mode 100644 index 00000000..0ab0b231 --- /dev/null +++ b/sprites/.gitignore @@ -0,0 +1,3 @@ +dist/*.png +dist/*.json +target diff --git a/sprites/Cargo.lock b/sprites/Cargo.lock new file mode 100644 index 00000000..be1def1d --- /dev/null +++ b/sprites/Cargo.lock @@ -0,0 +1,1449 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "aho-corasick" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6748e8def348ed4d14996fa801f4122cd763fff530258cdc03f64b25f89d3a5a" +dependencies = [ + "memchr", +] + +[[package]] +name = "anstream" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ca84f3628370c59db74ee214b3263d58f9aadd9b4fe7e711fd87dc452b7f163" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is-terminal", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a30da5c5f2d5e72842e00bcb57657162cdabef0931f40e2deb9b4140440cecd" + +[[package]] +name = "anstyle-parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "938874ff5980b03a87c5524b3ae5b59cf99b1d6bc836848df7bc5ada9643c333" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" +dependencies = [ + "windows-sys", +] + +[[package]] +name = "anstyle-wincon" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c677ab05e09154296dd37acecd46420c17b9713e8366facafa8fc0885167cf4c" +dependencies = [ + "anstyle", + "windows-sys", +] + +[[package]] +name = "arrayref" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + +[[package]] +name = "assert_fs" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f070617a68e5c2ed5d06ee8dd620ee18fb72b99f6c094bed34cf8ab07c875b48" +dependencies = [ + "anstyle", + "doc-comment", + "globwalk", + "predicates", + "predicates-core", + "predicates-tree", + "tempfile", +] + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "base64" +version = "0.21.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" + +[[package]] +name = "bitvec" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" +dependencies = [ + "funty", + "radium", + "tap", + "wyz", +] + +[[package]] +name = "bstr" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6798148dccfbff0fae41c7574d2fa8f1ef3492fba0face179de5d8d447d67b05" +dependencies = [ + "memchr", + "serde", +] + +[[package]] +name = "bytemuck" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17febce684fd15d89027105661fec94afb475cb995fbc59d2865198446ba2eea" + +[[package]] +name = "byteorder" +version = "1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" + +[[package]] +name = "cc" +version = "1.0.82" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "305fe645edc1442a0fa8b6726ba61d422798d37a52e12eaecf4b022ebbb88f01" +dependencies = [ + "libc", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "clap" +version = "4.3.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03aef18ddf7d879c15ce20f04826ef8418101c7e528014c3eeea13321047dca3" +dependencies = [ + "clap_builder", + "clap_derive", + "once_cell", +] + +[[package]] +name = "clap_builder" +version = "4.3.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8ce6fffb678c9b80a70b6b6de0aad31df727623a70fd9a842c30cd573e2fa98" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", + "strsim", +] + +[[package]] +name = "clap_derive" +version = "4.3.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54a9bb5758fc5dfe728d1019941681eccaf0cf8a4189b692a0ee2f2ecf90a050" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "clap_lex" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2da6da31387c7e4ef160ffab6d5e7f00c42626fe39aea70a7b0f1773f7dd6c1b" + +[[package]] +name = "color_quant" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" + +[[package]] +name = "colorchoice" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" + +[[package]] +name = "crc32fast" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crossbeam-channel" +version = "0.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" +dependencies = [ + "cfg-if", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" +dependencies = [ + "cfg-if", + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7" +dependencies = [ + "autocfg", + "cfg-if", + "crossbeam-utils", + "memoffset", + "scopeguard", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crunch" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dc013e70da3bfe5b552de26a1f34ecf67d61ea811251d2bf75c1324a1ecb425" + +[[package]] +name = "data-url" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d7439c3735f405729d52c3fbbe4de140eaf938a1fe47d227c27f8254d4302a5" + +[[package]] +name = "difflib" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6184e33543162437515c2e2b48714794e37845ec9851711914eec9d308f6ebe8" + +[[package]] +name = "doc-comment" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" + +[[package]] +name = "either" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" + +[[package]] +name = "errno" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b30f669a7961ef1631673d2766cc92f52d64f7ef354d4fe0ddfd30ed52f0f4f" +dependencies = [ + "errno-dragonfly", + "libc", + "windows-sys", +] + +[[package]] +name = "errno-dragonfly" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "exitcode" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de853764b47027c2e862a995c34978ffa63c1501f2e15f987ba11bd4f9bba193" + +[[package]] +name = "fastrand" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6999dc1837253364c2ebb0704ba97994bd874e8f195d665c50b7548f6ea92764" + +[[package]] +name = "fdeflate" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d329bdeac514ee06249dabc27877490f17f5d371ec693360768b838e19f3ae10" +dependencies = [ + "simd-adler32", +] + +[[package]] +name = "filetime" +version = "0.2.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4029edd3e734da6fe05b6cd7bd2960760a616bd2ddd0d59a0124746d6272af0" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "windows-sys", +] + +[[package]] +name = "flate2" +version = "1.0.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6c98ee8095e9d1dcbf2fcc6d95acccb90d1c81db1e44725c6a984b1dbdfb010" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + +[[package]] +name = "float-cmp" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98de4bbd547a563b716d8dfa9aad1cb19bfab00f4fa09a6a4ed21dbcf44ce9c4" + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "fontconfig-parser" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "674e258f4b5d2dcd63888c01c68413c51f565e8af99d2f7701c7b81d79ef41c4" +dependencies = [ + "roxmltree", +] + +[[package]] +name = "fontdb" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af8d8cbea8f21307d7e84bca254772981296f058a1d36b461bf4d83a7499fc9e" +dependencies = [ + "fontconfig-parser", + "log", + "memmap2", + "slotmap", + "tinyvec", + "ttf-parser 0.19.1", +] + +[[package]] +name = "funty" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" + +[[package]] +name = "gif" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80792593675e051cf94a4b111980da2ba60d4a83e43e0048c5693baab3977045" +dependencies = [ + "color_quant", + "weezl", +] + +[[package]] +name = "globset" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "759c97c1e17c55525b57192c06a267cda0ac5210b222d6b82189a2338fa1c13d" +dependencies = [ + "aho-corasick", + "bstr", + "fnv", + "log", + "regex", +] + +[[package]] +name = "globwalk" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93e3af942408868f6934a7b85134a3230832b9977cf66125df2f9edcfce4ddcc" +dependencies = [ + "bitflags 1.3.2", + "ignore", + "walkdir", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + +[[package]] +name = "hermit-abi" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" + +[[package]] +name = "ignore" +version = "0.4.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbe7873dab538a9a44ad79ede1faf5f30d49f9a5c883ddbab48bce81b64b7492" +dependencies = [ + "globset", + "lazy_static", + "log", + "memchr", + "regex", + "same-file", + "thread_local", + "walkdir", + "winapi-util", +] + +[[package]] +name = "image" +version = "0.24.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f3dfdbdd72063086ff443e297b61695500514b1e41095b6fb9a5ab48a70a711" +dependencies = [ + "bytemuck", + "byteorder", + "color_quant", + "num-rational", + "num-traits", + "png", +] + +[[package]] +name = "imagesize" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "029d73f573d8e8d63e6d5020011d3255b28c3ba85d6cf870a07184ed23de9284" + +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown", + "rayon", +] + +[[package]] +name = "is-terminal" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" +dependencies = [ + "hermit-abi", + "rustix", + "windows-sys", +] + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" + +[[package]] +name = "jpeg-decoder" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc0000e42512c92e31c2252315bda326620a4e034105e900c98ec492fa077b3e" + +[[package]] +name = "kurbo" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd85a5776cd9500c2e2059c8c76c3b01528566b7fcbaf8098b55a33fc298849b" +dependencies = [ + "arrayvec", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "libc" +version = "0.2.147" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" + +[[package]] +name = "libdeflate-sys" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb6784b6b84b67d71b4307963d456a9c7c29f9b47c658f533e598de369e34277" +dependencies = [ + "cc", +] + +[[package]] +name = "libdeflater" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8e285aa6a046fd338b2592c16bee148b2b00789138ed6b7bb56bb13d585050d" +dependencies = [ + "libdeflate-sys", +] + +[[package]] +name = "linux-raw-sys" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57bcfdad1b858c2db7c38303a6d2ad4dfaf5eb53dfeb0910128b2c26d6158503" + +[[package]] +name = "log" +version = "0.4.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" + +[[package]] +name = "memchr" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" + +[[package]] +name = "memmap2" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d28bba84adfe6646737845bc5ebbfa2c08424eb1c37e94a1fd2a82adb56a872" +dependencies = [ + "libc", +] + +[[package]] +name = "memoffset" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" +dependencies = [ + "autocfg", +] + +[[package]] +name = "miniz_oxide" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +dependencies = [ + "adler", + "simd-adler32", +] + +[[package]] +name = "multimap" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70db9248a93dc36a36d9a47898caa007a32755c7ad140ec64eeeb50d5a730631" +dependencies = [ + "serde", +] + +[[package]] +name = "num-integer" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +dependencies = [ + "autocfg", + "num-traits", +] + +[[package]] +name = "num-rational" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_cpus" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" +dependencies = [ + "hermit-abi", + "libc", +] + +[[package]] +name = "once_cell" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" + +[[package]] +name = "oxipng" +version = "8.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "630638e107fb436644c300e781d3f17e1b04656138ba0d40564be4be3b06db32" +dependencies = [ + "bitvec", + "crossbeam-channel", + "filetime", + "image", + "indexmap", + "itertools", + "libdeflater", + "log", + "rayon", + "rgb", + "rustc-hash", + "rustc_version", + "zopfli", +] + +[[package]] +name = "pico-args" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5be167a7af36ee22fe3115051bc51f6e6c7054c9348e28deb4f49bd6f705a315" + +[[package]] +name = "png" +version = "0.17.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd75bf2d8dd3702b9707cdbc56a5b9ef42cec752eb8b3bafc01234558442aa64" +dependencies = [ + "bitflags 1.3.2", + "crc32fast", + "fdeflate", + "flate2", + "miniz_oxide", +] + +[[package]] +name = "predicates" +version = "3.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09963355b9f467184c04017ced4a2ba2d75cbcb4e7462690d388233253d4b1a9" +dependencies = [ + "anstyle", + "difflib", + "itertools", + "predicates-core", +] + +[[package]] +name = "predicates-core" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b794032607612e7abeb4db69adb4e33590fa6cf1149e95fd7cb00e634b92f174" + +[[package]] +name = "predicates-tree" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "368ba315fb8c5052ab692e68a0eefec6ec57b23a36959c14496f0b0df2c0cecf" +dependencies = [ + "predicates-core", + "termtree", +] + +[[package]] +name = "proc-macro2" +version = "1.0.66" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radium" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" + +[[package]] +name = "rayon" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d2df5196e37bcc87abebc0053e20787d73847bb33134a69841207dd0a47f03b" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b8f95bd6966f5c87776639160a66bd8ab9895d9d4ab01ddba9fc60661aebe8d" +dependencies = [ + "crossbeam-channel", + "crossbeam-deque", + "crossbeam-utils", + "num_cpus", +] + +[[package]] +name = "rctree" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b42e27ef78c35d3998403c1d26f3efd9e135d3e5121b0a4845cc5cc27547f4f" + +[[package]] +name = "redox_syscall" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +dependencies = [ + "bitflags 1.3.2", +] + +[[package]] +name = "regex" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81bc1d4caf89fac26a70747fe603c130093b53c773888797a6329091246d651a" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fed1ceff11a1dddaee50c9dc8e4938bd106e9d89ae372f192311e7da498e3b69" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5ea92a5b6195c6ef2a0295ea818b312502c6fc94dde986c5553242e18fd4ce2" + +[[package]] +name = "resvg" +version = "0.34.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0e3d65cea36eefb28a020edb6e66341764e00cd4b426e0c1f0599b1adaa78f5" +dependencies = [ + "gif", + "jpeg-decoder", + "log", + "pico-args", + "png", + "rgb", + "svgtypes", + "tiny-skia", + "usvg", +] + +[[package]] +name = "rgb" +version = "0.8.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20ec2d3e3fc7a92ced357df9cebd5a10b6fb2aa1ee797bf7e9ce2f17dffc8f59" +dependencies = [ + "bytemuck", +] + +[[package]] +name = "roxmltree" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8f595a457b6b8c6cda66a48503e92ee8d19342f905948f29c383200ec9eb1d8" +dependencies = [ + "xmlparser", +] + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver", +] + +[[package]] +name = "rustix" +version = "0.38.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19ed4fa021d81c8392ce04db050a3da9a60299050b7ae1cf482d862b54a7218f" +dependencies = [ + "bitflags 2.4.0", + "errno", + "libc", + "linux-raw-sys", + "windows-sys", +] + +[[package]] +name = "rustybuzz" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "162bdf42e261bee271b3957691018634488084ef577dddeb6420a9684cab2a6a" +dependencies = [ + "bitflags 1.3.2", + "bytemuck", + "smallvec", + "ttf-parser 0.18.1", + "unicode-bidi-mirroring", + "unicode-ccc", + "unicode-general-category", + "unicode-script", +] + +[[package]] +name = "ryu" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "semver" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0293b4b29daaf487284529cc2f5675b8e57c61f70167ba415a463651fd6a918" + +[[package]] +name = "serde" +version = "1.0.183" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32ac8da02677876d532745a130fc9d8e6edfa81a269b107c5b00829b91d8eb3c" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.183" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aafe972d60b0b9bee71a91b92fee2d4fb3c9d7e8f6b179aa99f27203d99a4816" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.105" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "693151e1ac27563d6dbcec9dee9fbd5da8539b20fa14ad3752b2e6d363ace360" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "simd-adler32" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" + +[[package]] +name = "simplecss" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a11be7c62927d9427e9f40f3444d5499d868648e2edbc4e2116de69e7ec0e89d" +dependencies = [ + "log", +] + +[[package]] +name = "siphasher" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7bd3e3206899af3f8b12af284fafc038cc1dc2b41d1b89dd17297221c5d225de" + +[[package]] +name = "slotmap" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1e08e261d0e8f5c43123b7adf3e4ca1690d655377ac93a03b2c9d3e98de1342" +dependencies = [ + "version_check", +] + +[[package]] +name = "smallvec" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" + +[[package]] +name = "spreet" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "357c86676a23af570a68dbc1f59d2d6442d12ac7c94c41b8317f30706f5ca05d" +dependencies = [ + "assert_fs", + "clap", + "crunch", + "exitcode", + "multimap", + "oxipng", + "png", + "rayon", + "resvg", + "serde", + "serde_json", +] + +[[package]] +name = "spritegen" +version = "0.1.0" +dependencies = [ + "clap", + "exitcode", + "rayon", + "regex", + "serde", + "serde_json", + "spreet", + "xmltree", +] + +[[package]] +name = "strict-num" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6637bab7722d379c8b41ba849228d680cc12d0a45ba1fa2b48f2a30577a06731" +dependencies = [ + "float-cmp", +] + +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + +[[package]] +name = "svgtypes" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed4b0611e7f3277f68c0fa18e385d9e2d26923691379690039548f867cef02a7" +dependencies = [ + "kurbo", + "siphasher", +] + +[[package]] +name = "syn" +version = "2.0.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c324c494eba9d92503e6f1ef2e6df781e78f6a7705a0202d9801b198807d518a" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "tap" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" + +[[package]] +name = "tempfile" +version = "3.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc02fddf48964c42031a0b3fe0428320ecf3a73c401040fc0096f97794310651" +dependencies = [ + "cfg-if", + "fastrand", + "redox_syscall", + "rustix", + "windows-sys", +] + +[[package]] +name = "termtree" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3369f5ac52d5eb6ab48c6b4ffdc8efbcad6b89c765749064ba298f2c68a16a76" + +[[package]] +name = "thread_local" +version = "1.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" +dependencies = [ + "cfg-if", + "once_cell", +] + +[[package]] +name = "tiny-skia" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7db11798945fa5c3e5490c794ccca7c6de86d3afdd54b4eb324109939c6f37bc" +dependencies = [ + "arrayref", + "arrayvec", + "bytemuck", + "cfg-if", + "log", + "png", + "tiny-skia-path", +] + +[[package]] +name = "tiny-skia-path" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f60aa35c89ac2687ace1a2556eaaea68e8c0d47408a2e3e7f5c98a489e7281c" +dependencies = [ + "arrayref", + "bytemuck", + "strict-num", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "ttf-parser" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0609f771ad9c6155384897e1df4d948e692667cc0588548b68eb44d052b27633" + +[[package]] +name = "ttf-parser" +version = "0.19.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a464a4b34948a5f67fddd2b823c62d9d92e44be75058b99939eae6c5b6960b33" + +[[package]] +name = "typed-arena" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6af6ae20167a9ece4bcb41af5b80f8a1f1df981f6391189ce00fd257af04126a" + +[[package]] +name = "unicode-bidi" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" + +[[package]] +name = "unicode-bidi-mirroring" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56d12260fb92d52f9008be7e4bca09f584780eb2266dc8fecc6a192bec561694" + +[[package]] +name = "unicode-ccc" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc2520efa644f8268dce4dcd3050eaa7fc044fca03961e9998ac7e2e92b77cf1" + +[[package]] +name = "unicode-general-category" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2281c8c1d221438e373249e065ca4989c4c36952c211ff21a0ee91c44a3869e7" + +[[package]] +name = "unicode-ident" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" + +[[package]] +name = "unicode-script" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d817255e1bed6dfd4ca47258685d14d2bdcfbc64fdc9e3819bd5848057b8ecc" + +[[package]] +name = "unicode-vo" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1d386ff53b415b7fe27b50bb44679e2cc4660272694b7b6f3326d8480823a94" + +[[package]] +name = "usvg" +version = "0.34.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2304b933107198a910c1f3219acb65246f2b148f862703cffd51c6e62156abe" +dependencies = [ + "base64", + "log", + "pico-args", + "usvg-parser", + "usvg-text-layout", + "usvg-tree", + "xmlwriter", +] + +[[package]] +name = "usvg-parser" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12b940fea80394e3b14cb21c83fa1b8f8a41023c25929bba68bb84a76193ebed" +dependencies = [ + "data-url", + "flate2", + "imagesize", + "kurbo", + "log", + "roxmltree", + "simplecss", + "siphasher", + "svgtypes", + "usvg-tree", +] + +[[package]] +name = "usvg-text-layout" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69dfd6119f431aa7e969b4a69f9cc8b9ae37b8ae85bb26780ccfa3beaf8b71eb" +dependencies = [ + "fontdb", + "kurbo", + "log", + "rustybuzz", + "unicode-bidi", + "unicode-script", + "unicode-vo", + "usvg-tree", +] + +[[package]] +name = "usvg-tree" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3185eb13b6e3d3cf1817d29612251cc308d5a7e5e6235362e67efe832435c6d9" +dependencies = [ + "rctree", + "strict-num", + "svgtypes", + "tiny-skia-path", +] + +[[package]] +name = "utf8parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "walkdir" +version = "2.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36df944cda56c7d8d8b7496af378e6b16de9284591917d307c9b4d313c44e698" +dependencies = [ + "same-file", + "winapi-util", +] + +[[package]] +name = "weezl" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9193164d4de03a926d909d3bc7c30543cecb35400c02114792c2cae20d5e2dbb" + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +dependencies = [ + "winapi", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.48.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d92ecb8ae0317859f509f17b19adc74b0763b0fa3b085dea8ed01085c8dac222" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d14b0ee96970be7108701212f097ce67ca772fd84cb0ffbc86d26a94e77ba929" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1332277d49f440c8fc6014941e320ee47ededfcce10cb272728470f56cc092c9" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d992130ac399d56f02c20564e9975ac5ba08cb25cb832849bbc0d736a101abe5" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "962e96d0fa4b4773c63977977ea6564f463fb10e34a6e07360428b53ae7a3f71" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30652a53018a48a9735fbc2986ff0446c37bc8bed0d3f98a0ed4d04cdb80027e" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5bb3f0331abfe1a95af56067f1e64b3791b55b5373b03869560b6025de809bf" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd1df36d9fd0bbe4849461de9b969f765170f4e0f90497d580a235d515722b10" + +[[package]] +name = "wyz" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" +dependencies = [ + "tap", +] + +[[package]] +name = "xml-rs" +version = "0.8.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47430998a7b5d499ccee752b41567bc3afc57e1327dc855b1a2aa44ce29b5fa1" + +[[package]] +name = "xmlparser" +version = "0.13.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d25c75bf9ea12c4040a97f829154768bbbce366287e2dc044af160cd79a13fd" + +[[package]] +name = "xmltree" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7d8a75eaf6557bb84a65ace8609883db44a29951042ada9b393151532e41fcb" +dependencies = [ + "xml-rs", +] + +[[package]] +name = "xmlwriter" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec7a2a501ed189703dba8b08142f057e887dfc4b2cc4db2d343ac6376ba3e0b9" + +[[package]] +name = "zopfli" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e0650ae6a051326d798eb099b632f1afb0d323d25ee4ec82ffb0779512084d5" +dependencies = [ + "crc32fast", + "log", + "simd-adler32", + "typed-arena", +] diff --git a/sprites/Cargo.toml b/sprites/Cargo.toml new file mode 100644 index 00000000..a59feac1 --- /dev/null +++ b/sprites/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "spritegen" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +clap = "4.3.23" +exitcode = "1.1.2" +rayon = "1.7.0" +spreet = "0.8.0" +xmltree = "0.10.3" +serde = { version = "1.0", features = ["derive"] } +serde_json = "1.0" +regex = "1.5.4" \ No newline at end of file diff --git a/sprites/Makefile b/sprites/Makefile new file mode 100644 index 00000000..eb5784d0 --- /dev/null +++ b/sprites/Makefile @@ -0,0 +1,6 @@ +all: + ./target/release/spritegen refill.svg themes/light.json dist/light + ./target/release/spritegen refill.svg themes/dark.json dist/dark + ./target/release/spritegen refill.svg themes/white.json dist/white + ./target/release/spritegen refill.svg themes/grayscale.json dist/grayscale + ./target/release/spritegen refill.svg themes/black.json dist/black \ No newline at end of file diff --git a/sprites/dist/.gitignore b/sprites/dist/.gitignore new file mode 100644 index 00000000..e69de29b diff --git a/sprites/refill.svg b/sprites/refill.svg new file mode 100644 index 00000000..71de6aeb --- /dev/null +++ b/sprites/refill.svg @@ -0,0 +1 @@ +sdk_solid_shield-5charsdk_solid_shield-4charsdk_solid_shield-3charsdk_solid_shield-2charsdk_solid_shield-1charUS:IUS:USUS:USUS:USUS:USUS:USUS:USUS:IUS:IUS:IUS:Isdk_shield-2charsdk_shield-3charsdk_shield-4charsdk_shield-5charsdk_shield-1chargeneric shieldgeneric shieldgeneric shieldgeneric shieldgeneric shieldtownspot XLtownspot Ltownspot Mtownspot Stownspot XStownspot XL revtownspot L revtownspot M revtownspot S revtownspot XS revcapital XLux-transit-stopcapital Lcapital Mcapital Scapital XSsdk_crosssdk_heartsdk_squaresdk_square_strokedsdk_circlesdk_circle_strokedsdk_trianglesdk_triangle_strokedsdk_starsdk_star_strokedsdk_markersdk_marker_alt1sdk_marker_stroked_alt1closedsdk_marker_strokedgenericgeneric_revattractionarrowinformationpizzaice_creamhot_dog_jointbiergartendrinking_waterdrinking_water_wellwater_well_drinking_water_no_pumpwater_well_no_pumpwater_well_pump_autowater_well_drinking_water_pump_autowater_well_drinking_water_pump_manualwater_well_pump_manualwater_pointwatering_placebeverageswinewine_shopbagel_shopnoodle_shopramenfast_foodtaqueriarestaurantdonutforestglacierhanamisinkholestonehot_pot_restaurantconfectionerycheese_shopbreakfaststeakhousebbqfueltraffic_signalscollegefootball_stadiumsoccer_stadiumclothescinemaaquariumcarouselviewpointroller_coasterbowling_alleygamingstorage_tankstreet_lamppotterycomedy_clubhandicraftconcert_hallbasketball_stadiummusic_venuetheatreenclosuredambarrierswing_gategatecycle_barrierwildlife_parklockmazesummer_toboggantelecommunicationemployment_agencypedestrianvillage_greencavereefgalleryartarts_centreartworknightlifebakerycafeteahousechinese_restaurantcarribean_restaurantgastropubcupcake_shopfried_chicken_jointgerman_restaurantsoup_placetea_roomwinerywings_jointbuildingfactoryfarmlandhealth_centrepost_officeplace_of_worshipwayside_shrinehindubargay_barloungewhisky_barsports_centreamerican_footballcricketgolfhorse_ridinggamblingminiature_golfgovernmentanimalmarinaharborentrancekaraokewheelchairbureau_de_changemoney_transfercopyshopplumbergardenerlawyernotarymetal_constructionstonemasonaccountantfire_hydrantpower_towerpower_tower_smallliftgatepower_poleentrance_alt1vineyardcar_repaircar_partsbankatmATMlogging_alt1loggingslaughterhousesuitcasecarpenterfuneral_directorscraftstudiobicycle_rentalbicyclebookscamera_storecarcar_sharingconsultingdepartment_storecharging_stationparkingbicycle_parkingtaxielectronicstax_advisorfarmers_marketfish_marketfood_courtsupermarketliquorfurniture_storeswimming_poolstadiumtracktennisskiski_jumpingski_rentalski_schoolfountainparkparkchristiansushi_restaurantfloristdeliservice_areagifthistoricalmuseumpool_halltheme_parkmarketplacezoobridgetoiletsparking_garageroadblockonewayoneway-reversecliffrapid egress put_in put_in_egress urbanhazardmotorcycle_parkingbollardmotorway_junctioncamp_sitebuddhistcemeterygrave_yard_christiangrave_yard_genericgrave_yard_jewishgrave_yard_muslimshintoistsikhisttaoistwayside_crossreligionfarmlandusenaturalpark_alt1warehousealpine_hutguest_househunting_standplace_squarechaletwilderness_hutpylonrefugee_campresortworkshoplife_ringsnow_cannonsnow_fencebreakwatergroynewindmillhomemeadowgardenbeachbeach_resortnightclubtelephonewaste_basketbucketcommunication_towergenerator_nucleargenerator_solargenerator_windcommunicationslifeguard_toweroffshore_platformpetroleum_wellpetting_zoorest_areatoll_boothwaste_disposalgroup_homemastsoup_kitchentrail_riding_stationdairy_kitchenfootwaywalking_junctionbunkerofficeschoolbaseballbasketballgolf_coursehockey_fieldskate_parkskating_rinksoccervolleyball_courtaviarylandsaddlespringlighthousepeakboat_storagebattlefieldwater_parkwater_slidescrubtrailheadoutdoorcategory-namespace-do_and_see,category-predicate-attractioncategory-namespace-eat_and_drinkcategory-namespace-education_and_religioncategory-namespace-healthcategory-namespace-mobilitycategory-namespace-othercategory-predicate-addressingcategory-predicate-civic category-predicate-drinkcategory-predicate-funcategory-predicate-industrycategory-predicate-moneycategory-predicate-naturecategory-predicate-religioncategory-predicate-servicecategory-predicate-shopcategory-predicate-sleepcategory-predicate-transportscuba_divinggas_canisterrocktelescopeboat_rentalallotmentsretaining_wallrecreation_trackwater_towermotorcyclepicnic_sitepicnic_tableranger_stationbbqwaterfalldog_parkfirepitswimming_areafishingcaravan_siteshowergarden_centrewetlandwaterwatermillassisted_livingvolcanoadult_boutiqueantique_shoparts_craftsstationerytravel_agencysurf_shopconveniencecosmetics_shopdry_cleaningbeautycosmeticsperfumerychildcarechildrens_centreresearchpharmacytradebutchersushigreengrocerseafoodcoffeeteafood_bankgarden_centerfitnesshardwaremineshafthobby_shophunting_supplyITjewelrylaundrymarijuana_dispensaryvariety_storeretailshoemakermiscellaneous_shopmobile_phoneplaygroundscreepost_boxdunebridal_shopfinancialmusicnail_salonnewspapercommercialshoptyreshifimusical_instrumentnewsagentshoestobaccobagopticianblood_bankdefibrillatorheartchildrens_hospitaltherapistambulatory_caremidwifebicycle_repair_stationpetphotographic_laboratoryphotograherestate_agentrecord_shoprecyclingdangeremergency_phoneprisonresidential_communitysheltertown_hallborder_controlcommunity_centresocial_facilityacraacra_alt1ngooxfamplaqueobeliskmilitarypolling_placeassociationcity_wallcommonoutreachpolitical_partyhairdressersmoke_shopspa_massagesportselectriciantailortanning_salontattoo_parlordressmakertoysarchitectairportferrybus_stationhvachotellight_railsawmillpiercar_rentalrest_areabenchdot whitedot blackindustryruinbuilding_alt1roadfordrail_metrocar_washsubway_entranceaerialwayairfieldheliportrocketscootersnowmobileelevatoraeroway_gatehelipadhaltrailwayrunwayfordmini_roundabouttaxiwaytrain_stationtrainanimal_sheltercourthousefire_stationlandmarkpolicedentistclinichospitalveterinaryveterinary_dogmuslimjewishdessertlibrarygeyserhuntingbeach_coarseorchardplant_nurseryruralminetree-streelevel_crossing2level_crossingslipwayRELIGOUSTRANSITCAR & BIKEAMENITIES IIINATURALCIVICHEALTHEDUCATIONAMENITIES IAMENITIES IIPERSONAL CARESHOPPING ISHOPPING IISHOPPING IIISHOPPING IIIPETSSPORTS ISPORTS IIFOOD SHOPPINGDRINKINGEATING IEATING IISNACKINGARTSGENERICOUTDOORCATEGORIES0.70.10.10.10.10.10.10.10.10.20.20.60.20.20.20.20.20.20.20.20.20.20.20.20.20.20.20.70.20.20.20.20.10.10.10.80.80.81.0???????????????????????????0.11????????????????????????????????????????????????????????????????????????????????????????????????????????????????xxxxx???surf spot only???????????????????????????????????????building=stable?????????????????????0.90.100.10 trailhead??? \ No newline at end of file diff --git a/sprites/src/main.rs b/sprites/src/main.rs new file mode 100644 index 00000000..d32a4060 --- /dev/null +++ b/sprites/src/main.rs @@ -0,0 +1,351 @@ +extern crate xmltree; + +use rayon::prelude::*; +use spreet::resvg::tiny_skia::Pixmap; +use spreet::sprite; +use std::collections::BTreeMap; +use std::fs; +use std::fs::File; +use std::io::Cursor; +use xmltree::{Element, XMLNode}; + +use spreet::resvg::usvg::TreeParsing; +use spreet::resvg::usvg::{Node, NodeExt, NodeKind, Options, Rect, Tree}; + +use serde::{Deserialize, Serialize}; +use std::collections::HashMap; + +use clap::Parser; + +use regex::Regex; + +fn parse_color(color: &str) -> Option<(u8, u8, u8)> { + match color.len() { + 3 => Some(( + u8::from_str_radix(&color[0..1].repeat(2), 16).ok()?, + u8::from_str_radix(&color[1..2].repeat(2), 16).ok()?, + u8::from_str_radix(&color[2..3].repeat(2), 16).ok()?, + )), + 6 => Some(( + u8::from_str_radix(&color[0..2], 16).ok()?, + u8::from_str_radix(&color[2..4], 16).ok()?, + u8::from_str_radix(&color[4..6], 16).ok()?, + )), + _ => None, + } +} + +fn mix(a: u8, b: u8, t: f32) -> u8 { + ((1.0 - t) * a as f32 + t * b as f32) + .round() + .clamp(0.0, 255.0) as u8 +} + +fn process_colors(input: &str, modifier: &F) -> String +where + F: Fn(u8, u8, u8) -> String, +{ + let re = Regex::new(r"#([0-9a-fA-F]{3}(?:[0-9a-fA-F]{3})?)").unwrap(); + let mut last_end = 0; + let mut result = String::new(); + + // Iterate over each color code found in the string. + for cap in re.captures_iter(input) { + let color_code = &cap[1]; + let (r, g, b) = parse_color(color_code).unwrap(); + + let modified_color = modifier(r, g, b); + + // Append substring from the end of the last match to the start of this match. + result.push_str(&input[last_end..cap.get(0).unwrap().start()]); + + // Append the modified color code. + result.push_str(&modified_color); + + // Update the end of the last match. + last_end = cap.get(0).unwrap().end(); + } + + // Append the remainder of the input string after the last match. + result.push_str(&input[last_end..]); + + result +} + +fn compute_bbox(node: &Node, bboxes: &mut Vec) { + match *node.borrow() { + NodeKind::Path(ref _path) => { + let bbox = node.calculate_bbox().unwrap(); + bboxes.push(bbox); + } + NodeKind::Group(_) => { + for child in node.children() { + compute_bbox(&child, bboxes); + } + } + _ => {} + } +} + +fn remove_text_elements(elem: &mut Element) { + elem.children.retain(|node| { + if let XMLNode::Text(_) = node { + false + } else { + true + } + }); + + for child in &mut elem.children { + if let XMLNode::Element(child_elem) = child { + remove_text_elements(child_elem); + } + } +} + +fn extract_groups_from_svg( + input_svg_path: &str, + shader: &Shader, + svg_datas: &mut Vec<(String, Vec)>, +) { + let mut tree = Element::parse(File::open(input_svg_path).unwrap()).unwrap(); + + let cloned = tree.clone(); + let defs_element = cloned.children.iter().find(|node| { + if let xmltree::XMLNode::Element(el) = node { + el.name == "defs" + } else { + false + } + }); + + let options = Options::default(); + + let ignore = vec![ + "priority", + "guides", + "categories", + "in_tiles_now", + "add_to_tiles", + ]; + + for child_node in &mut tree.children { + if let XMLNode::Element(child_elem) = child_node { + if child_elem.name == "g" { + if let Some(name) = child_elem.attributes.get("id") { + // ignore certain icons in the Illustrator doc. + if ignore.contains(&name.as_str()) { + continue; + } + + // determine the icon name. + let mut substr = name[1..].to_string(); + + // hardcoded renames + if substr == "townspot-s-rev" { + substr = "townspot".to_string(); + } + + if !shader.icons.contains_key(&substr) { + continue; + } + + // ignore helper labels. + remove_text_elements(child_elem); + + // create a temporary SVG doc for calculating the viewBox + + let mut tmp_root_attributes = std::collections::HashMap::new(); + tmp_root_attributes.insert( + String::from("xmlns"), + String::from("http://www.w3.org/2000/svg"), + ); + + let mut tmp_root = Element { + name: String::from("svg"), + attributes: tmp_root_attributes, + children: Vec::new(), + namespace: None, + namespaces: None, + prefix: None, + }; + + tmp_root + .children + .push(xmltree::XMLNode::Element(child_elem.clone())); + + let mut tmp_buffer = Cursor::new(Vec::new()); + tmp_root.write(&mut tmp_buffer).unwrap(); + let tmp_svg = Tree::from_data(&tmp_buffer.into_inner(), &options); + + let mut bboxes = Vec::new(); + compute_bbox(&tmp_svg.unwrap().root, &mut bboxes); + + let mut min_x = f32::MAX; + let mut min_y = f32::MAX; + let mut max_x = f32::MIN; + let mut max_y = f32::MIN; + + for rect in &bboxes { + min_x = min_x.min(rect.x()); + max_x = max_x.max(rect.x() + rect.width()); + min_y = min_y.min(rect.y()); + max_y = max_y.max(rect.y() + rect.height()); + } + + min_x -= 0.5; + max_x += 0.5; + min_y -= 0.5; + max_y += 0.5; + + let view_box = + format!("{} {} {} {}", min_x, min_y, max_x - min_x, max_y - min_y); + + // create the final svg data + let mut root_attributes = std::collections::HashMap::new(); + root_attributes.insert(String::from("viewBox"), String::from(view_box)); + root_attributes.insert( + String::from("xmlns"), + String::from("http://www.w3.org/2000/svg"), + ); + + let mut root = Element { + name: String::from("svg"), + attributes: root_attributes, + children: Vec::new(), + namespace: None, + namespaces: None, + prefix: None, + }; + + let mut cloned_defs = defs_element.unwrap().clone(); + + if shader.icons.contains_key(&substr) { + let black = parse_color( + shader.themes[&shader.icons[&substr]][0] + .strip_prefix("#") + .unwrap(), + ) + .unwrap(); + let white = parse_color( + shader.themes[&shader.icons[&substr]][1] + .strip_prefix("#") + .unwrap(), + ) + .unwrap(); + + println!("{:?}, {:?}, {:?}", substr, black, white); + + // there is a theme, let's modify + + if let Some(style) = + cloned_defs.as_mut_element().unwrap().get_mut_child("style") + { + // Modify the text of the style tag + if let Some(child) = style + .children + .iter_mut() + .find(|node| matches!(node, XMLNode::Text(_))) + { + if let XMLNode::Text(text) = child { + let output = process_colors(text, &|r, g, b| { + let new_r = mix(black.0, white.0, (r as f32) / 255.0); + let new_g = mix(black.1, white.1, (g as f32) / 255.0); + let new_b = mix(black.2, white.2, (b as f32) / 255.0); + + let modified_color = + format!("#{:02x}{:02x}{:02x}", new_r, new_g, new_b); + modified_color + }); + *child = XMLNode::Text(output); + } + } + } + } + + root.children.push(cloned_defs); + + root.children + .push(xmltree::XMLNode::Element(child_elem.clone())); + + let mut buffer = Cursor::new(Vec::new()); + root.write(&mut buffer).unwrap(); + + svg_datas.push((substr, buffer.into_inner())); + } + } + } + } +} + +#[derive(Debug, Serialize, Deserialize)] +struct Shader { + themes: HashMap>, + icons: HashMap, +} + +fn load_shader>(path: P) -> Result> { + let file_content = fs::read_to_string(path)?; + let shader: Shader = serde_json::from_str(&file_content)?; + Ok(shader) +} + +#[derive(Parser)] +pub struct Cli { + pub input: String, + pub shader: String, + /// Name of the file in which to save the spritesheet + pub output: String, +} + +fn main() { + let args = Cli::parse(); + + let shader = load_shader(&args.shader).unwrap(); + + let mut svg_datas = Vec::new(); + extract_groups_from_svg(&args.input, &shader, &mut svg_datas); + + for ratio in [1,2] { + let options = Options::default(); + let sprites = svg_datas + .par_iter() + .map(|p| { + let svg = spreet::resvg::usvg::Tree::from_data(&p.1, &options).unwrap(); + ( + p.0.clone(), + sprite::generate_pixmap_from_svg(&svg, ratio).unwrap(), + ) + }) + .collect::>(); + + if sprites.is_empty() { + eprintln!("Error: no valid SVGs found in {:?}", &args.input); + std::process::exit(exitcode::NOINPUT); + } + + let mut spritesheet_builder = sprite::Spritesheet::build(); + spritesheet_builder.sprites(sprites).pixel_ratio(ratio); + spritesheet_builder.make_unique(); + + // Generate sprite sheet + let Some(spritesheet) = spritesheet_builder.generate() else { + eprintln!("Error: could not pack the sprites within an area fifty times their size."); + std::process::exit(exitcode::DATAERR); + }; + + // Save the bitmapped spritesheet to a local PNG. + let file_prefix = format!("{}{}", &args.output, if ratio == 2 { "@2x" } else { "" }); + let spritesheet_path = format!("{file_prefix}.png"); + if let Err(e) = spritesheet.save_spritesheet(&spritesheet_path) { + eprintln!("Error: could not save spritesheet to {spritesheet_path} ({e})"); + std::process::exit(exitcode::IOERR); + }; + + // Save the index file to a local JSON file with the same name as the spritesheet. + if let Err(e) = spritesheet.save_index(&file_prefix, true) { + eprintln!("Error: could not save sprite index to {file_prefix} ({e})"); + std::process::exit(exitcode::IOERR); + }; + } +} diff --git a/sprites/themes/black.json b/sprites/themes/black.json new file mode 100644 index 00000000..ce997082 --- /dev/null +++ b/sprites/themes/black.json @@ -0,0 +1,8 @@ +{ + "themes": { + "base":["#aaaaaa","#000000"] + }, + "icons": { + "townspot":"base" + } +} \ No newline at end of file diff --git a/sprites/themes/dark.json b/sprites/themes/dark.json new file mode 100644 index 00000000..ce997082 --- /dev/null +++ b/sprites/themes/dark.json @@ -0,0 +1,8 @@ +{ + "themes": { + "base":["#aaaaaa","#000000"] + }, + "icons": { + "townspot":"base" + } +} \ No newline at end of file diff --git a/sprites/themes/grayscale.json b/sprites/themes/grayscale.json new file mode 100644 index 00000000..0479e76c --- /dev/null +++ b/sprites/themes/grayscale.json @@ -0,0 +1,8 @@ +{ + "themes": { + "base":["#444444","#dddddd"] + }, + "icons": { + "townspot":"base" + } +} \ No newline at end of file diff --git a/sprites/themes/light.json b/sprites/themes/light.json new file mode 100644 index 00000000..e5eb17a1 --- /dev/null +++ b/sprites/themes/light.json @@ -0,0 +1,8 @@ +{ + "themes": { + "base":["#555555","#ffffff"] + }, + "icons": { + "townspot":"base" + } +} \ No newline at end of file diff --git a/sprites/themes/white.json b/sprites/themes/white.json new file mode 100644 index 00000000..57334864 --- /dev/null +++ b/sprites/themes/white.json @@ -0,0 +1,8 @@ +{ + "themes": { + "base":["#888888","#ffffff"] + }, + "icons": { + "townspot":"base" + } +} \ No newline at end of file