diff --git a/Cargo.lock b/Cargo.lock index dc1aa90..d739957 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -18,15 +18,6 @@ version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c71b1793ee61086797f5c80b6efa2b8ffa6d5dd703f118545808a7f2e27f7046" -[[package]] -name = "addr2line" -version = "0.24.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" -dependencies = [ - "gimli", -] - [[package]] name = "adler2" version = "2.0.0" @@ -57,9 +48,9 @@ dependencies = [ [[package]] name = "allocator-api2" -version = "0.2.20" +version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45862d1c77f2228b9e10bc609d5bc203d86ebc9b87ad8d5d5167a6c9abf739d9" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" [[package]] name = "android-activity" @@ -68,7 +59,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ef6978589202a00cd7e118380c448a08b6ed394c3a8df3a430d0898e3a42d046" dependencies = [ "android-properties", - "bitflags 2.6.0", + "bitflags 2.8.0", "cc", "cesu8", "jni", @@ -77,9 +68,9 @@ dependencies = [ "log", "ndk", "ndk-context", - "ndk-sys", + "ndk-sys 0.6.0+11769913", "num_enum", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -138,11 +129,12 @@ dependencies = [ [[package]] name = "anstyle-wincon" -version = "3.0.6" +version = "3.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2109dbce0e72be3ec00bed26e6a7479ca384ad226efdd66db8fa2e3a38c83125" +checksum = "ca3534e77181a9cc07539ad51f2141fe32f6c3ffd4df76db8ad92346b003ae4e" dependencies = [ "anstyle", + "once_cell", "windows-sys 0.59.0", ] @@ -185,21 +177,6 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" -[[package]] -name = "backtrace" -version = "0.3.74" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" -dependencies = [ - "addr2line", - "cfg-if", - "libc", - "miniz_oxide", - "object", - "rustc-demangle", - "windows-targets 0.52.6", -] - [[package]] name = "bit-set" version = "0.5.3" @@ -223,9 +200,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.6.0" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +checksum = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36" [[package]] name = "bitvec" @@ -262,9 +239,9 @@ checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "bytemuck" -version = "1.19.0" +version = "1.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8334215b81e418a0a7bdb8ef0849474f40bb10c8b71f1c4ed315cff49f32494d" +checksum = "ef657dfab802224e671f5818e9a4935f9b1957ed18e58292690cc39e7a4092a3" [[package]] name = "byteorder" @@ -274,15 +251,15 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ac0150caa2ae65ca5bd83f25c7de183dea78d4d366469f148435e2acfbad0da" +checksum = "325918d6fe32f23b19878fe4b34794ae41fc19ddbe53b10571a4874d44ffd39b" [[package]] name = "bzip2" -version = "0.4.4" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdb116a6ef3f6c3698828873ad02c3014b3c85cadb88496095628e3ef1e347f8" +checksum = "bafdbf26611df8c14810e268ddceda071c297570a5fb360ceddf617fe417ef58" dependencies = [ "bzip2-sys", "libc", @@ -305,12 +282,12 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b99da2f8558ca23c71f4fd15dc57c906239752dd27ff3c00a1d56b685b7cbfec" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", "log", "polling", "rustix", "slab", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -327,9 +304,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.0" +version = "1.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1aeb932158bd710538c73702db6945cb68a8fb08c519e6e12706b94263b36db8" +checksum = "c8293772165d9345bdaaa39b45b2109591e63fe5e6fbc23c6ff930a048aa310b" dependencies = [ "jobserver", "libc", @@ -348,6 +325,12 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "cfg_aliases" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" + [[package]] name = "cfg_aliases" version = "0.2.1" @@ -356,9 +339,9 @@ checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" [[package]] name = "clap" -version = "4.5.20" +version = "4.5.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b97f376d85a664d5837dbae44bf546e6477a679ff6610010f17276f686d867e8" +checksum = "a8eb5e908ef3a6efbe1ed62520fb7287959888c88485abe072543190ecc66783" dependencies = [ "clap_builder", "clap_derive", @@ -366,9 +349,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.20" +version = "4.5.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19bc80abd44e4bed93ca373a0704ccbd1b710dc5749406201bb018272808dc54" +checksum = "96b01801b5fc6a0a232407abc821660c9c6d25a1cafc0d4f85f29fb8d9afc121" dependencies = [ "anstream", "anstyle", @@ -378,21 +361,21 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.18" +version = "4.5.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ac6a0c7b1a9e9a5186361f67dfa1b88213572f427fb9ab038efb2bd8c582dab" +checksum = "54b755194d6389280185988721fffba69495eed5ee9feeee9a599b53db80318c" dependencies = [ "heck", "proc-macro2", "quote", - "syn", + "syn 2.0.96", ] [[package]] name = "clap_lex" -version = "0.7.2" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" +checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" [[package]] name = "codespan-reporting" @@ -411,10 +394,35 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" [[package]] -name = "com-rs" -version = "0.2.1" +name = "com" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf43edc576402991846b093a7ca18a3477e0ef9c588cde84964b5d3e43016642" +checksum = "7e17887fd17353b65b1b2ef1c526c83e26cd72e74f598a8dc1bee13a48f3d9f6" +dependencies = [ + "com_macros", +] + +[[package]] +name = "com_macros" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d375883580a668c7481ea6631fc1a8863e33cc335bf56bfad8d7e6d4b04b13a5" +dependencies = [ + "com_macros_support", + "proc-macro2", + "syn 1.0.109", +] + +[[package]] +name = "com_macros_support" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad899a1087a9296d5644792d7cb72b8e34c1bec8e7d4fbc002230169a6e8710c" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] [[package]] name = "combine" @@ -498,9 +506,9 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.20" +version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" [[package]] name = "cursor-icon" @@ -510,12 +518,12 @@ checksum = "96a6ac251f4a2aca6b3f91340350eab87ae57c3f127ffeb585e92bd336717991" [[package]] name = "d3d12" -version = "0.7.0" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e16e44ab292b1dddfdaf7be62cfd8877df52f2f3fde5858d95bab606be259f20" +checksum = "3e3d747f100290a1ca24b752186f61f6637e1deffe3bf6320de6fcb29510a307" dependencies = [ - "bitflags 2.6.0", - "libloading 0.8.5", + "bitflags 2.8.0", + "libloading 0.8.6", "winapi", ] @@ -552,7 +560,7 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "330c60081dcc4c72131f8eb70510f1ac07223e5d4163db481a04a0befcffa412" dependencies = [ - "libloading 0.8.5", + "libloading 0.8.6", ] [[package]] @@ -581,9 +589,9 @@ dependencies = [ [[package]] name = "env_filter" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f2c92ceda6ceec50f43169f9ee8424fe2db276791afde7b2cd8bc084cb376ab" +checksum = "186e05a59d4c50738528153b83b0b0194d3a29507dfec16eccd4b342903397d0" dependencies = [ "log", "regex", @@ -591,9 +599,9 @@ dependencies = [ [[package]] name = "env_logger" -version = "0.11.5" +version = "0.11.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13fa619b91fb2381732789fc5de83b45675e882f66623b7d8cb4f643017018d" +checksum = "dcaee3d8e3cfc3fd92428d477bc97fc29ec8716d180c0d74c643bb26166660e0" dependencies = [ "anstream", "anstyle", @@ -610,19 +618,19 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.9" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" +checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "flate2" -version = "1.0.34" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1b589b4dc103969ad3cf85c950899926ec64300a1a46d76c03a6072957036f0" +checksum = "c936bfdafb507ebbf50b8074c54fa31c5be9a1e7e5f467dd659697041407d07c" dependencies = [ "crc32fast", "miniz_oxide", @@ -640,7 +648,7 @@ version = "0.14.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b64b34f4efd515f905952d91bc185039863705592c0c53ae6d979805dd154520" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", "byteorder", "core-foundation", "core-graphics", @@ -677,7 +685,7 @@ checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.96", ] [[package]] @@ -725,16 +733,21 @@ dependencies = [ ] [[package]] -name = "gimli" -version = "0.31.1" +name = "gl_generator" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" +checksum = "1a95dfc23a2b4a9a2f5ab41d194f8bfda3cabec42af4e39f08c339eb2a0c124d" +dependencies = [ + "khronos_api", + "log", + "xml-rs", +] [[package]] name = "glow" -version = "0.12.3" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca0fe580e4b60a8ab24a868bc08e2f03cbcb20d3d676601fa909386713333728" +checksum = "bd348e04c43b32574f2de31c8bb397d96c9fcfa1371bd4ca6d8bdc464ab121b1" dependencies = [ "js-sys", "slotmap", @@ -742,13 +755,22 @@ dependencies = [ "web-sys", ] +[[package]] +name = "glutin_wgl_sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c8098adac955faa2d31079b65dc48841251f69efd3ac25477903fc424362ead" +dependencies = [ + "gl_generator", +] + [[package]] name = "gpu-alloc" version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fbcd2dba93594b227a1f57ee09b8b9da8892c34d55aa332e034a228d0fe6a171" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", "gpu-alloc-types", ] @@ -758,18 +780,18 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "98ff03b468aa837d70984d55f5d3f846f6ec31fe34bbb97c4f85219caeee1ca4" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", ] [[package]] name = "gpu-allocator" -version = "0.22.0" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce95f9e2e11c2c6fadfce42b5af60005db06576f231f5c92550fdded43c423e8" +checksum = "6f56f6318968d03c18e1bcf4857ff88c61157e9da8e47c5f29055d60e1228884" dependencies = [ - "backtrace", "log", - "thiserror", + "presser", + "thiserror 1.0.69", "winapi", "windows", ] @@ -780,7 +802,7 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cc11df1ace8e7e564511f53af41f3e42ddc95b56fd07b3f4445d2a6048bc682c" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", "gpu-descriptor-types", "hashbrown 0.14.5", ] @@ -791,15 +813,9 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6bf0b36e6f090b7e1d8a4b49c0cb81c1f8376f72198c65dd3ad9ff3556b8b78c" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", ] -[[package]] -name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" - [[package]] name = "hashbrown" version = "0.14.5" @@ -812,21 +828,21 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.15.1" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a9bfc1af68b1726ea47d3d5109de126281def866b33970e10fbab11b5dafab3" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" [[package]] name = "hassle-rs" -version = "0.10.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1397650ee315e8891a0df210707f0fc61771b0cc518c3023896064c5407cb3b0" +checksum = "af2a7e73e1f34c48da31fb668a907f250794837e08faa144fd24f0b8b741e890" dependencies = [ - "bitflags 1.3.2", - "com-rs", + "bitflags 2.8.0", + "com", "libc", - "libloading 0.7.4", - "thiserror", + "libloading 0.8.6", + "thiserror 1.0.69", "widestring", "winapi", ] @@ -857,22 +873,12 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "indexmap" -version = "1.9.3" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" -dependencies = [ - "autocfg", - "hashbrown 0.12.3", -] - -[[package]] -name = "indexmap" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" +checksum = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f" dependencies = [ "equivalent", - "hashbrown 0.15.1", + "hashbrown 0.15.2", ] [[package]] @@ -892,7 +898,7 @@ dependencies = [ "combine", "jni-sys", "log", - "thiserror", + "thiserror 1.0.69", "walkdir", "windows-sys 0.45.0", ] @@ -914,24 +920,31 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.72" +version = "0.3.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a88f1bda2bd75b0452a14784937d796722fdebfe50df998aeb3f0b7603019a9" +checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" dependencies = [ + "once_cell", "wasm-bindgen", ] [[package]] name = "khronos-egl" -version = "4.1.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c2352bd1d0bceb871cb9d40f24360c8133c11d7486b68b5381c1dd1a32015e3" +checksum = "6aae1df220ece3c0ada96b8153459b67eebe9ae9212258bb0134ae60416fdf76" dependencies = [ "libc", - "libloading 0.7.4", + "libloading 0.8.6", "pkg-config", ] +[[package]] +name = "khronos_api" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2db585e1d738fc771bf08a151420d3ed193d9d895a36df7f6f8a9456b911ddc" + [[package]] name = "lazy_static" version = "1.5.0" @@ -940,9 +953,9 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.162" +version = "0.2.169" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18d287de67fe55fd7e1581fe933d965a5a9477b38e949cfa9f8574ef01506398" +checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" [[package]] name = "libloading" @@ -956,9 +969,9 @@ dependencies = [ [[package]] name = "libloading" -version = "0.8.5" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4" +checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" dependencies = [ "cfg-if", "windows-targets 0.52.6", @@ -970,16 +983,16 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", "libc", - "redox_syscall 0.5.7", + "redox_syscall 0.5.8", ] [[package]] name = "linux-raw-sys" -version = "0.4.14" +version = "0.4.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" +checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" [[package]] name = "lock_api" @@ -993,9 +1006,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.22" +version = "0.4.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" +checksum = "04cbf5b083de1c7e0222a7a51dbfdba1cbe1c6ab0b15e29fff3f6c077fd9cd9f" [[package]] name = "malloc_buf" @@ -1023,11 +1036,11 @@ dependencies = [ [[package]] name = "metal" -version = "0.26.0" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "623b5e6cefd76e58f774bd3cc0c6f5c7615c58c03a97815245a25c3c9bdee318" +checksum = "c43f73953f8cbe511f021b58f18c3ce1c3d1ae13fe953293e13345bf83217f25" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", "block", "core-graphics-types", "foreign-types", @@ -1038,30 +1051,30 @@ dependencies = [ [[package]] name = "miniz_oxide" -version = "0.8.0" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" +checksum = "b8402cab7aefae129c6977bb0ff1b8fd9a04eb5b51efc50a70bea51cda0c7924" dependencies = [ "adler2", ] [[package]] name = "naga" -version = "0.13.0" +version = "0.19.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1ceaaa4eedaece7e4ec08c55c640ba03dbb73fb812a6570a59bcf1930d0f70e" +checksum = "50e3524642f53d9af419ab5e8dd29d3ba155708267667c2f3f06c88c9e130843" dependencies = [ "bit-set", - "bitflags 2.6.0", + "bitflags 2.8.0", "codespan-reporting", "hexf-parse", - "indexmap 1.9.3", + "indexmap", "log", "num-traits", "rustc-hash", "spirv", "termcolor", - "thiserror", + "thiserror 1.0.69", "unicode-xid", ] @@ -1071,14 +1084,14 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3f42e7bbe13d351b6bead8286a43aac9534b82bd3cc43e47037f012ebfd62d4" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", "jni-sys", "log", - "ndk-sys", + "ndk-sys 0.6.0+11769913", "num_enum", "raw-window-handle 0.5.2", "raw-window-handle 0.6.2", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -1087,6 +1100,15 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "27b02d87554356db9e9a873add8782d4ea6e3e58ea071a9adb9a2e8ddb884a8b" +[[package]] +name = "ndk-sys" +version = "0.5.0+25.2.9519653" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c196769dd60fd4f363e11d948139556a344e79d451aeb2fa2fd040738ef7691" +dependencies = [ + "jni-sys", +] + [[package]] name = "ndk-sys" version = "0.6.0+11769913" @@ -1123,7 +1145,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn", + "syn 2.0.96", ] [[package]] @@ -1158,7 +1180,7 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e4e89ad9e3d7d297152b17d39ed92cd50ca8063a89a9fa569046d41568891eff" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", "block2", "libc", "objc2", @@ -1174,7 +1196,7 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "74dd3b56391c7a0596a295029734d3c1c5e7e510a4cb30245f8221ccea96b009" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", "block2", "objc2", "objc2-core-location", @@ -1198,7 +1220,7 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "617fbf49e071c178c0b24c080767db52958f716d9eabdf0890523aeae54773ef" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", "block2", "objc2", "objc2-foundation", @@ -1240,7 +1262,7 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ee638a5da3799329310ad4cfa62fbf045d5f56e3ef5ba4149e7452dcf89d5a8" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", "block2", "dispatch", "libc", @@ -1265,7 +1287,7 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd0cba1276f6023976a406a14ffa85e1fdd19df6b0f737b063b95f6c8c7aadd6" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", "block2", "objc2", "objc2-foundation", @@ -1277,7 +1299,7 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e42bee7bff906b14b167da2bac5efe6b6a07e6f7c0a21a7308d40c960242dc7a" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", "block2", "objc2", "objc2-foundation", @@ -1300,7 +1322,7 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b8bb46798b20cd6b91cbd113524c490f1686f4c4e8f49502431415f3512e2b6f" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", "block2", "objc2", "objc2-cloud-kit", @@ -1332,7 +1354,7 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "76cfcbf642358e8689af64cee815d139339f3ed8ad05103ed5eaf73db8d84cb3" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", "block2", "objc2", "objc2-core-location", @@ -1348,15 +1370,6 @@ dependencies = [ "cc", ] -[[package]] -name = "object" -version = "0.36.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aedf0a2d09c573ed1d8d85b30c119153926a2b36dce0ab28322c09a117a4683e" -dependencies = [ - "memchr", -] - [[package]] name = "once_cell" version = "1.20.2" @@ -1405,7 +1418,7 @@ checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.5.7", + "redox_syscall 0.5.8", "smallvec", "windows-targets 0.52.6", ] @@ -1443,40 +1456,40 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pin-project" -version = "1.1.7" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be57f64e946e500c8ee36ef6331845d40a93055567ec57e8fae13efd33759b95" +checksum = "1e2ec53ad785f4d35dac0adea7f7dc6f1bb277ad84a680c7afefeae05d1f5916" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.7" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c0f5fad0874fc7abcd4d750e76917eaebbecaa2c20bde22e1dbeeba8beb758c" +checksum = "d56a66c0c55993aa927429d0f8a0abfd74f084e4d9c192cffed01e418d83eefb" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.96", ] [[package]] name = "pin-project-lite" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" [[package]] name = "pixels" -version = "0.14.0" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fe695c41cbcc552b6ad7511479226911e804e6569204ea0bafbe7c5fdddfc11" +checksum = "518d43cd70c5381d4c7bd4bf47ee344beee99b58b0587adcb198cc713ff0dfb5" dependencies = [ "bytemuck", "pollster", - "raw-window-handle 0.5.2", - "thiserror", + "raw-window-handle 0.6.2", + "thiserror 1.0.69", "ultraviolet", "wgpu", ] @@ -1508,6 +1521,12 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22686f4785f02a4fcc856d3b3bb19bf6c8160d103f7a99cc258bddd0251dc7f2" +[[package]] +name = "presser" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8cf8e6a8aa66ce33f63993ffc4ea4271eb5b0530a9002db8455ea6050c77bfa" + [[package]] name = "proc-macro-crate" version = "3.2.0" @@ -1519,9 +1538,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.89" +version = "1.0.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e" +checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" dependencies = [ "unicode-ident", ] @@ -1543,9 +1562,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.37" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" +checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" dependencies = [ "proc-macro2", ] @@ -1585,11 +1604,11 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.7" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b6dfecf2c74bce2466cabf93f6664d6998a69eb21e39f4207930065b27b771f" +checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", ] [[package]] @@ -1600,7 +1619,7 @@ checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" dependencies = [ "getrandom", "libredox", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -1648,12 +1667,6 @@ dependencies = [ "vcpkg", ] -[[package]] -name = "rustc-demangle" -version = "0.1.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" - [[package]] name = "rustc-hash" version = "1.1.0" @@ -1671,22 +1684,28 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.40" +version = "0.38.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99e4ea3e1cdc4b559b8e5650f9c8e5998e3e5c1343b4eaf034565f32318d63c0" +checksum = "a78891ee6bf2340288408954ac787aa063d8e8817e9f53abb37c695c6d834ef6" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", "errno", "libc", "linux-raw-sys", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] -name = "safe_arch" -version = "0.7.2" +name = "rustversion" +version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3460605018fdc9612bce72735cba0d27efbcd9904780d44c7e3a9948f96148a" +checksum = "f7c45b9784283f1b2e7fb61b42047c2fd678ef0960d4f6f1eba131594cc369d4" + +[[package]] +name = "safe_arch" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96b02de82ddbe1b636e6170c21be622223aea188ef2e139be0a5b219ec215323" dependencies = [ "bytemuck", ] @@ -1727,35 +1746,35 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.23" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" +checksum = "3cb6eb87a131f756572d7fb904f6e7b68633f09cca868c5df1c4b8d1a694bbba" [[package]] name = "serde" -version = "1.0.215" +version = "1.0.217" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6513c1ad0b11a9376da888e3e0baa0077f1aed55c17f50e7b2397136129fb88f" +checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.215" +version = "1.0.217" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad1e866f866923f252f05c889987993144fb74e722403468a4ebd70c3cd756c0" +checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.96", ] [[package]] name = "servicepoint" -version = "0.12.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "764b2d2544cf28874cdfce4c182be62165eaff01179e04c5ce0ae7d7a9b15cec" +checksum = "3a8bc9e40503ece07e3f12232f648484191323b8126e74abce3d1644ba04dbd0" dependencies = [ "bitvec", "bzip2", @@ -1763,7 +1782,7 @@ dependencies = [ "log", "once_cell", "rust-lzma", - "thiserror", + "thiserror 2.0.11", "zstd", ] @@ -1778,6 +1797,7 @@ dependencies = [ "pathfinder_geometry", "pixels", "servicepoint", + "thiserror 2.0.11", "winit", ] @@ -1817,7 +1837,7 @@ version = "0.19.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3457dea1f0eb631b4034d61d4d8c32074caa6cd1ab2d59f2327bd8461e2c0016" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", "calloop", "calloop-wayland-source", "cursor-icon", @@ -1825,7 +1845,7 @@ dependencies = [ "log", "memmap2", "rustix", - "thiserror", + "thiserror 1.0.69", "wayland-backend", "wayland-client", "wayland-csd-frame", @@ -1847,12 +1867,11 @@ dependencies = [ [[package]] name = "spirv" -version = "0.2.0+1.5.4" +version = "0.3.0+sdk-1.3.268.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "246bfa38fe3db3f1dfc8ca5a2cdeb7348c78be2112740cc0ec8ef18b6d94f830" +checksum = "eda41003dc44290527a59b13432d4a0379379fa074b70174882adfbdfd917844" dependencies = [ - "bitflags 1.3.2", - "num-traits", + "bitflags 2.8.0", ] [[package]] @@ -1875,9 +1894,20 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "syn" -version = "2.0.87" +version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25aa4ce346d03a6dcd68dd8b4010bcb74e54e62c90c573f394c46eae99aba32d" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.96" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5d0adab1ae378d7f53bdebc67a39f1f151407ef230f0ce2883572f5d8985c80" dependencies = [ "proc-macro2", "quote", @@ -1905,7 +1935,16 @@ version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" dependencies = [ - "thiserror-impl", + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d452f284b73e6d76dd36758a0c8684b1d5be31f92b89d07fd5822175732206fc" +dependencies = [ + "thiserror-impl 2.0.11", ] [[package]] @@ -1916,7 +1955,18 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.96", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26afc1baea8a989337eeb52b6e72a039780ce45c3edfcc9c5b9d112feeb173c2" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.96", ] [[package]] @@ -1956,16 +2006,16 @@ version = "0.22.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" dependencies = [ - "indexmap 2.6.0", + "indexmap", "toml_datetime", "winnow", ] [[package]] name = "tracing" -version = "0.1.40" +version = "0.1.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" dependencies = [ "pin-project-lite", "tracing-core", @@ -1973,15 +2023,15 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.32" +version = "0.1.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" [[package]] name = "ttf-parser" -version = "0.25.0" +version = "0.25.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5902c5d130972a0000f60860bfbf46f7ca3db5391eddfedd1b8728bd9dc96c0e" +checksum = "d2df906b07856748fa3f6e0ad0cbaa047052d4a7dd609e231c4f72cee8c36f31" [[package]] name = "ultraviolet" @@ -1994,9 +2044,9 @@ dependencies = [ [[package]] name = "unicode-ident" -version = "1.0.13" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" +checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" [[package]] name = "unicode-segmentation" @@ -2052,47 +2102,48 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.95" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "128d1e363af62632b8eb57219c8fd7877144af57558fb2ef0368d0087bddeb2e" +checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" dependencies = [ "cfg-if", "once_cell", + "rustversion", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.95" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb6dd4d3ca0ddffd1dd1c9c04f94b868c37ff5fac97c30b97cff2d74fce3a358" +checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" dependencies = [ "bumpalo", "log", - "once_cell", "proc-macro2", "quote", - "syn", + "syn 2.0.96", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.45" +version = "0.4.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc7ec4f8827a71586374db3e87abdb5a2bb3a15afed140221307c3ec06b1f63b" +checksum = "555d470ec0bc3bb57890405e5d4322cc9ea83cebb085523ced7be4144dac1e61" dependencies = [ "cfg-if", "js-sys", + "once_cell", "wasm-bindgen", "web-sys", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.95" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e79384be7f8f5a9dd5d7167216f022090cf1f9ec128e6e6a482a2cb5c5422c56" +checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2100,22 +2151,25 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.95" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" +checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.96", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.95" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65fc09f10666a9f147042251e0dda9c18f166ff7de300607007e96bdebc1068d" +checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" +dependencies = [ + "unicode-ident", +] [[package]] name = "wayland-backend" @@ -2137,7 +2191,7 @@ version = "0.31.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b66249d3fc69f76fd74c82cc319300faa554e9d865dab1f7cd66cc20db10b280" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", "rustix", "wayland-backend", "wayland-scanner", @@ -2149,7 +2203,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "625c5029dbd43d25e6aa9615e88b829a5cad13b2819c4ae129fdbb7c31ab4c7e" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", "cursor-icon", "wayland-backend", ] @@ -2171,7 +2225,7 @@ version = "0.32.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7cd0ade57c4e6e9a8952741325c30bf82f4246885dca8bf561898b86d0c1f58e" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", "wayland-backend", "wayland-client", "wayland-scanner", @@ -2183,7 +2237,7 @@ version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b31cab548ee68c7eb155517f2212049dc151f7cd7910c2b66abfd31c3ee12bd" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", "wayland-backend", "wayland-client", "wayland-protocols", @@ -2196,7 +2250,7 @@ version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "782e12f6cd923c3c316130d56205ebab53f55d6666b7faddfad36cecaeeb4022" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", "wayland-backend", "wayland-client", "wayland-protocols", @@ -2228,9 +2282,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.72" +version = "0.3.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6488b90108c040df0fe62fa815cbdee25124641df01814dd7282749234c6112" +checksum = "33b6dd2ef9186f1f2072e409e99cd22a975331a6b3591b12c764e0e55c60d5d2" dependencies = [ "js-sys", "wasm-bindgen", @@ -2248,18 +2302,19 @@ dependencies = [ [[package]] name = "wgpu" -version = "0.17.2" +version = "0.19.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "752e44d3998ef35f71830dd1ad3da513e628e2e4d4aedb0ab580f850827a0b41" +checksum = "cbd7311dbd2abcfebaabf1841a2824ed7c8be443a0f29166e5d3c6a53a762c01" dependencies = [ "arrayvec", "cfg-if", + "cfg_aliases 0.1.1", "js-sys", "log", "naga", "parking_lot", "profiling", - "raw-window-handle 0.5.2", + "raw-window-handle 0.6.2", "smallvec", "static_assertions", "wasm-bindgen", @@ -2272,22 +2327,25 @@ dependencies = [ [[package]] name = "wgpu-core" -version = "0.17.1" +version = "0.19.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f8a44dd301a30ceeed3c27d8c0090433d3da04d7b2a4042738095a424d12ae7" +checksum = "28b94525fc99ba9e5c9a9e24764f2bc29bad0911a7446c12f446a8277369bf3a" dependencies = [ "arrayvec", "bit-vec", - "bitflags 2.6.0", + "bitflags 2.8.0", + "cfg_aliases 0.1.1", "codespan-reporting", + "indexmap", "log", "naga", + "once_cell", "parking_lot", "profiling", - "raw-window-handle 0.5.2", + "raw-window-handle 0.6.2", "rustc-hash", "smallvec", - "thiserror", + "thiserror 1.0.69", "web-sys", "wgpu-hal", "wgpu-types", @@ -2295,19 +2353,21 @@ dependencies = [ [[package]] name = "wgpu-hal" -version = "0.17.2" +version = "0.19.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a80bf0e3c77399bb52850cb0830af9bad073d5cfcb9dd8253bef8125c42db17" +checksum = "bfabcfc55fd86611a855816326b2d54c3b2fd7972c27ce414291562650552703" dependencies = [ "android_system_properties", "arrayvec", "ash", "bit-set", - "bitflags 2.6.0", + "bitflags 2.8.0", "block", + "cfg_aliases 0.1.1", "core-graphics-types", "d3d12", "glow", + "glutin_wgl_sys", "gpu-alloc", "gpu-allocator", "gpu-descriptor", @@ -2315,19 +2375,21 @@ dependencies = [ "js-sys", "khronos-egl", "libc", - "libloading 0.8.5", + "libloading 0.8.6", "log", "metal", "naga", + "ndk-sys 0.5.0+25.2.9519653", "objc", + "once_cell", "parking_lot", "profiling", "range-alloc", - "raw-window-handle 0.5.2", + "raw-window-handle 0.6.2", "renderdoc-sys", "rustc-hash", "smallvec", - "thiserror", + "thiserror 1.0.69", "wasm-bindgen", "web-sys", "wgpu-types", @@ -2336,20 +2398,20 @@ dependencies = [ [[package]] name = "wgpu-types" -version = "0.17.0" +version = "0.19.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee64d7398d0c2f9ca48922c902ef69c42d000c759f3db41e355f4a570b052b67" +checksum = "b671ff9fb03f78b46ff176494ee1ebe7d603393f42664be55b64dc8d53969805" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", "js-sys", "web-sys", ] [[package]] name = "wide" -version = "0.7.28" +version = "0.7.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b828f995bf1e9622031f8009f8481a85406ce1f4d4588ff746d872043e855690" +checksum = "41b5576b9a81633f3e8df296ce0063042a73507636cbe956c61133dd7034ab22" dependencies = [ "bytemuck", "safe_arch", @@ -2394,11 +2456,21 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows" -version = "0.44.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e745dab35a0c4c77aa3ce42d595e13d2003d6902d6b08c9ef5fc326d08da12b" +checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" dependencies = [ - "windows-targets 0.42.2", + "windows-core", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-core" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +dependencies = [ + "windows-targets 0.52.6", ] [[package]] @@ -2617,18 +2689,18 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winit" -version = "0.30.5" +version = "0.30.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0be9e76a1f1077e04a411f0b989cbd3c93339e1771cb41e71ac4aee95bfd2c67" +checksum = "f5d74280aabb958072864bff6cfbcf9025cf8bfacdde5e32b5e12920ef703b0f" dependencies = [ "ahash", "android-activity", "atomic-waker", - "bitflags 2.6.0", + "bitflags 2.8.0", "block2", "bytemuck", "calloop", - "cfg_aliases", + "cfg_aliases 0.2.1", "concurrent-queue", "core-foundation", "core-graphics", @@ -2670,9 +2742,9 @@ dependencies = [ [[package]] name = "winnow" -version = "0.6.20" +version = "0.6.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36c1fec1a2bb5866f07c25f68c26e565c4c200aebb96d7e55710c19d3e8ac49b" +checksum = "c8d71a593cc5c42ad7876e2c1fda56f314f3754c084128833e64f1345ff8a03a" dependencies = [ "memchr", ] @@ -2715,7 +2787,7 @@ dependencies = [ "as-raw-xcb-connection", "gethostname", "libc", - "libloading 0.8.5", + "libloading 0.8.6", "once_cell", "rustix", "x11rb-protocol", @@ -2739,7 +2811,7 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d039de8032a9a8856a6be89cea3e5d12fdd82306ab7c94d74e6deab2460651c5" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", "dlib", "log", "once_cell", @@ -2752,6 +2824,12 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9cc00251562a284751c9973bace760d86c0276c471b4be569fe6b068ee97a56" +[[package]] +name = "xml-rs" +version = "0.8.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5b940ebc25896e71dd073bad2dbaa2abfe97b0a391415e22ad1326d9c54e3c4" + [[package]] name = "yeslogic-fontconfig-sys" version = "6.0.0" @@ -2780,7 +2858,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.96", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 0cbb3de..9cd4d0b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,13 +11,14 @@ log = "0.4" env_logger = "0.11" clap = { version = "4.5", features = ["derive"] } # for drawing pixels onto the surface of the window -pixels = "0.14" +pixels = "0.15" # I should not need this as a direct dependency, but then I cannot spell the types needed to use font-kit... pathfinder_geometry = "0.5.1" font-kit = "0.14.2" +thiserror = "2.0" [dependencies.servicepoint] -version = "0.12.0" +version = "0.13.0" features = ["all_compressions"] [dependencies.winit] diff --git a/flake.nix b/flake.nix index 98e613f..d09e841 100644 --- a/flake.nix +++ b/flake.nix @@ -139,7 +139,7 @@ { default = pkgs.mkShell rec { inputsFrom = [ self.packages.${system}.default ]; - packages = [ rust-toolchain ]; + packages = [ rust-toolchain pkgs.gdb ]; LD_LIBRARY_PATH = "${pkgs.lib.makeLibraryPath (builtins.concatMap (d: d.buildInputs) inputsFrom)}"; RUST_SRC_PATH = "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}"; }; diff --git a/src/execute_command.rs b/src/execute_command.rs index 81f6f67..b0701a8 100644 --- a/src/execute_command.rs +++ b/src/execute_command.rs @@ -1,16 +1,17 @@ -use std::sync::{RwLock, RwLockWriteGuard}; - use log::{debug, error, info, trace, warn}; use servicepoint::{ - Bitmap, BrightnessGrid, Command, Cp437Grid, Grid, Origin, Tiles, + Bitmap, BrightnessGrid, CharGrid, Command, Cp437Grid, Grid, Origin, Tiles, PIXEL_COUNT, PIXEL_WIDTH, TILE_SIZE, }; +use std::sync::{RwLock, RwLockWriteGuard}; -use crate::font::BitmapFont; +use crate::font::Cp437Font; +use crate::font_renderer::FontRenderer8x8; pub(crate) fn execute_command( command: Command, - font: &BitmapFont, + cp436_font: &Cp437Font, + utf8_font: &FontRenderer8x8, display_ref: &RwLock, luma_ref: &RwLock, ) -> bool { @@ -30,7 +31,7 @@ pub(crate) fn execute_command( } Command::Cp437Data(origin, grid) => { let mut display = display_ref.write().unwrap(); - print_cp437_data(origin, &grid, font, &mut display); + print_cp437_data(origin, &grid, cp436_font, &mut display); } #[allow(deprecated)] Command::BitmapLegacy => { @@ -99,6 +100,10 @@ pub(crate) fn execute_command( Command::FadeOut => { error!("command not implemented: {command:?}") } + Command::Utf8Data(origin, grid) => { + let mut display = display_ref.write().unwrap(); + print_utf8_data(origin, &grid, utf8_font, &mut display); + } }; true @@ -116,7 +121,7 @@ fn check_bitmap_valid(offset: u16, payload_len: usize) -> bool { fn print_cp437_data( origin: Origin, grid: &Cp437Grid, - font: &BitmapFont, + font: &Cp437Font, display: &mut RwLockWriteGuard, ) { let Origin { x, y, .. } = origin; @@ -145,6 +150,33 @@ fn print_cp437_data( } } +fn print_utf8_data( + origin: Origin, + grid: &CharGrid, + font: &FontRenderer8x8, + display: &mut RwLockWriteGuard, +) { + let Origin { x, y, .. } = origin; + for char_y in 0usize..grid.height() { + for char_x in 0usize..grid.width() { + let char = grid.get(char_x, char_y); + trace!("drawing {char}"); + + let tile_x = char_x + x; + let tile_y = char_y + y; + + if let Err(e) = font.render( + char, + display, + Origin::new(tile_x * TILE_SIZE, tile_y * TILE_SIZE), + ) { + error!("stopping drawing text because char draw failed: {e}"); + return; + } + } + } +} + fn print_pixel_grid( offset_x: usize, offset_y: usize, diff --git a/src/font.rs b/src/font.rs index 1bb105d..5f19492 100644 --- a/src/font.rs +++ b/src/font.rs @@ -1,73 +1,297 @@ -use crate::static_font; -use font_kit::canvas::{Canvas, Format, RasterizationOptions}; -use font_kit::font::Font; -use font_kit::hinting::HintingOptions; -use pathfinder_geometry::transform2d::Transform2F; -use pathfinder_geometry::vector::{vec2f, vec2i}; -use servicepoint::{Bitmap, Grid, TILE_SIZE}; - -const DEFAULT_FONT_FILE: &[u8] = include_bytes!("../Web437_IBM_BIOS.woff"); +use servicepoint::{Bitmap, DataRef, TILE_SIZE}; const CHAR_COUNT: usize = u8::MAX as usize + 1; -pub struct BitmapFont { +pub struct Cp437Font { bitmaps: [Bitmap; CHAR_COUNT], } -impl BitmapFont { +impl Cp437Font { pub fn new(bitmaps: [Bitmap; CHAR_COUNT]) -> Self { Self { bitmaps } } - pub fn load(font: Font, size: usize) -> BitmapFont { - let mut bitmaps = - core::array::from_fn(|_| Bitmap::new(TILE_SIZE, TILE_SIZE)); - let mut canvas = - Canvas::new(vec2i(size as i32, size as i32), Format::A8); - let size_f = size as f32; - let transform = Transform2F::default(); - - for char_code in u8::MIN..=u8::MAX { - let char = char_code as char; - let glyph_id = match font.glyph_for_char(char) { - None => continue, - Some(val) => val, - }; - - canvas.pixels.fill(0); - font.rasterize_glyph( - &mut canvas, - glyph_id, - size_f, - Transform2F::from_translation(vec2f(0f32, size_f)) * transform, - HintingOptions::None, - RasterizationOptions::GrayscaleAa, - ) - .unwrap(); - - assert_eq!(canvas.pixels.len(), size * size); - assert_eq!(canvas.stride, size); - - let bitmap = &mut bitmaps[char_code as usize]; - for y in 0..TILE_SIZE { - for x in 0..TILE_SIZE { - let index = x + y * TILE_SIZE; - let canvas_val = canvas.pixels[index] != 0; - bitmap.set(x, y, canvas_val); - } - } - } - - Self::new(bitmaps) - } - pub fn get_bitmap(&self, char_code: u8) -> &Bitmap { &self.bitmaps[char_code as usize] } } -impl Default for BitmapFont { +impl Default for Cp437Font { fn default() -> Self { - static_font::load_static() + load_static() } } + +/// Font from the display firmware `cape-cccb-apd/cp437font_linear.h` +pub(crate) const CP437_FONT_LINEAR: [u64; 256] = [ + 0x0000000000000000, // 0x00 + 0x003854ba82aa4438, // 0x01 + 0x003844bafed67c38, // 0x02 + 0x0010387cfeee4400, // 0x03 + 0x0010387cfe7c3810, // 0x04 + 0x003810d6fefe3838, // 0x05 + 0x003810d6fe7c3810, // 0x06 + 0x0000387c7c7c3800, // 0x07 + 0x00fec6828282c6fe, // 0x08 + 0x0000384444443800, // 0x09 + 0x00fec6bababac6fe, // 0x0a + 0x007088888a7a061e, // 0x0b + 0x1038103844444438, // 0x0c + 0x0030301010141418, // 0x0d + 0xc0c64642724e720e, // 0x0e + 0x00927c44c6447c92, // 0x0f + 0x00c0f0fcfefcf0c0, // 0x10 + 0x00061e7efe7e1e06, // 0x11 + 0x1038541010543810, // 0x12 + 0x2800282828282828, // 0x13 + 0x000e0a0a7a8a8a7e, // 0x14 + 0x0038441c28704438, // 0x15 + 0x000000ffff000000, // 0x16 + 0xfe10385410543810, // 0x17 + 0x1010101010543810, // 0x18 + 0x1038541010101010, // 0x19 + 0x00000804fe040800, // 0x1a + 0x00002040fe402000, // 0x1b + 0xffffc0c0c0c0c0c0, // 0x1c + 0x00002844fe442800, // 0x1d + 0x00fefe7c7c383810, // 0x1e + 0x001038387c7cfefe, // 0x1f + 0x0000000000000000, // 0x20 + 0x1000101010101010, // 0x21 + 0x0000000000505028, // 0x22 + 0x00247e24247e2400, // 0x23 + 0x1038541830543810, // 0x24 + 0x00844a2a54a8a442, // 0x25 + 0x003a444a32484830, // 0x26 + 0x0000000000201010, // 0x27 + 0x0810202020201008, // 0x28 + 0x2010080808081020, // 0x29 + 0x0010543854100000, // 0x2a + 0x0010107c10100000, // 0x2b + 0x2010100000000000, // 0x2c + 0x0000007c00000000, // 0x2d + 0x0010000000000000, // 0x2e + 0x4020201010080804, // 0x2f + 0x0038444454444438, // 0x30 + 0x007c101010503010, // 0x31 + 0x007c201008044438, // 0x32 + 0x003844043810087c, // 0x33 + 0x0004047e24140c04, // 0x34 + 0x003844047840407c, // 0x35 + 0x003844447840201c, // 0x36 + 0x004020100804047c, // 0x37 + 0x0038444438444438, // 0x38 + 0x007008043c444438, // 0x39 + 0x0000100000100000, // 0x3a + 0x2010100000100000, // 0x3b + 0x0006186018060000, // 0x3c + 0x00007c007c000000, // 0x3d + 0x00c0300c30c00000, // 0x3e + 0x1000384038044438, // 0x3f + 0x001c2248564a221c, // 0x40 + 0x0042427e24241818, // 0x41 + 0x007c42427c444478, // 0x42 + 0x001c22404040221c, // 0x43 + 0x0078444242424478, // 0x44 + 0x007e40407e40407e, // 0x45 + 0x004040407e40407e, // 0x46 + 0x001c22424e40221c, // 0x47 + 0x004242427e424242, // 0x48 + 0x007c10101010107c, // 0x49 + 0x003844040404047c, // 0x4a + 0x0042444870484442, // 0x4b + 0x007e404040404040, // 0x4c + 0x0082828292aac682, // 0x4d + 0x004242464a526242, // 0x4e + 0x0018244242422418, // 0x4f + 0x004040407c42427c, // 0x50 + 0x001a244a42422418, // 0x51 + 0x004244487c42427c, // 0x52 + 0x003c42023c40423c, // 0x53 + 0x00101010101010fe, // 0x54 + 0x003c424242424242, // 0x55 + 0x0010282844448282, // 0x56 + 0x0044446caa929282, // 0x57 + 0x0082442810284482, // 0x58 + 0x0010101010284482, // 0x59 + 0x007e20100804027e, // 0x5a + 0x3820202020202038, // 0x5b + 0x0408081010202040, // 0x5c + 0x3808080808080838, // 0x5d + 0x0000000000442810, // 0x5e + 0x007e000000000000, // 0x5f + 0x0000000000080810, // 0x60 + 0x003c443c04380000, // 0x61 + 0x0038444444784040, // 0x62 + 0x0038444044380000, // 0x63 + 0x003c4444443c0404, // 0x64 + 0x003c407844380000, // 0x65 + 0x2020202078202418, // 0x66 + 0x78043c44443e0000, // 0x67 + 0x0044444464584040, // 0x68 + 0x001c101010700010, // 0x69 + 0x38440404047c0010, // 0x6a + 0x0022243828242020, // 0x6b + 0x0018242020202020, // 0x6c + 0x0054545454780000, // 0x6d + 0x0044444464580000, // 0x6e + 0x0038444444380000, // 0x6f + 0x4040784444780000, // 0x70 + 0x04043c44443c0000, // 0x71 + 0x0040404064580000, // 0x72 + 0x00384418201c0000, // 0x73 + 0x0018242020782020, // 0x74 + 0x0038444444440000, // 0x75 + 0x0010282844440000, // 0x76 + 0x0028285454440000, // 0x77 + 0x0044281028440000, // 0x78 + 0x38043c4444440000, // 0x79 + 0x007c2010087c0000, // 0x7a + 0x0c0808083008080c, // 0x7b + 0x1010101010101010, // 0x7c + 0x301010100c101030, // 0x7d + 0x0000004c32000000, // 0x7e + 0xfe82828282442810, // 0x7f + 0x18083c428080423c, // 0x80 + 0x0038444444440028, // 0x81 + 0x003c407844381008, // 0x82 + 0x003c443c04382810, // 0x83 + 0x003c443c04380044, // 0x84 + 0x003c443c04381020, // 0x85 + 0x003c443c04382838, // 0x86 + 0x1038444044380000, // 0x87 + 0x003c407844382810, // 0x88 + 0x003c407844380044, // 0x89 + 0x003c407844381020, // 0x8a + 0x001c101010700028, // 0x8b + 0x001c101010702810, // 0x8c + 0x001c101010701020, // 0x8d + 0x0082827c44282892, // 0x8e + 0x0082827c44281038, // 0x8f + 0x00fe80fe80fe1008, // 0x90 + 0x007e907c126c0000, // 0x91 + 0x008e88784e28281e, // 0x92 + 0x0038444438002810, // 0x93 + 0x0038444444380028, // 0x94 + 0x0038444438001020, // 0x95 + 0x0038444444002810, // 0x96 + 0x0038444444001020, // 0x97 + 0x38043c4444440028, // 0x98 + 0x0038448282443882, // 0x99 + 0x0038448282820082, // 0x9a + 0x1038444044381010, // 0x9b + 0x00fc4240f0404438, // 0x9c + 0x107c107c10284482, // 0x9d + 0x001c22f840f8221c, // 0x9e + 0x205010103810120c, // 0x9f + 0x003c443c04381008, // 0xa0 + 0x001c101010701008, // 0xa1 + 0x0038444438001008, // 0xa2 + 0x0038444444001008, // 0xa3 + 0x0044446458004834, // 0xa4 + 0x00464a5262424834, // 0xa5 + 0x0000007090701060, // 0xa6 + 0x0000007088888870, // 0xa7 + 0x3844403804380010, // 0xa8 + 0x0040407c00000000, // 0xa9 + 0x0004047c00000000, // 0xaa + 0x0e84422c5048c442, // 0xab + 0x049e542c5448c442, // 0xac + 0x1010101010100010, // 0xad + 0x0024489048240000, // 0xae + 0x0048241224480000, // 0xaf + 0x1122448811224488, // 0xb0 + 0x55aa55aa55aa55aa, // 0xb1 + 0xddbb77eeddbb77ee, // 0xb2 + 0x1010101010101010, // 0xb3 + 0x101020c020101010, // 0xb4 + 0x1020c000c0201010, // 0xb5 + 0x2828488848282828, // 0xb6 + 0x282850e000000000, // 0xb7 + 0x1030d020c0000000, // 0xb8 + 0x2848880888482828, // 0xb9 + 0x2828282828282828, // 0xba + 0x2828c810e0000000, // 0xbb + 0x000000e010c82828, // 0xbc + 0x000000e050282828, // 0xbd + 0x0000c020d0301010, // 0xbe + 0x101020c000000000, // 0xbf + 0x0000000708101010, // 0xc0 + 0x000000c728101010, // 0xc1 + 0x101028c700000000, // 0xc2 + 0x1010080708101010, // 0xc3 + 0x000000ff00000000, // 0xc4 + 0x101028c728101010, // 0xc5 + 0x1008070007081010, // 0xc6 + 0x2828242324282828, // 0xc7 + 0x00000f1027282828, // 0xc8 + 0x282827100f000000, // 0xc9 + 0x0000ff0083442828, // 0xca + 0x28448300ff000000, // 0xcb + 0x2824232023242828, // 0xcc + 0x0000ff00ff000000, // 0xcd + 0x2844932893442828, // 0xce + 0x0000ff00c7281010, // 0xcf + 0x0000008344282828, // 0xd0 + 0x1028c700ff000000, // 0xd1 + 0x2828448300000000, // 0xd2 + 0x0000000f14282828, // 0xd3 + 0x0000070817181010, // 0xd4 + 0x1018170807000000, // 0xd5 + 0x2828140f00000000, // 0xd6 + 0x2828448344282828, // 0xd7 + 0x1028c700c7281010, // 0xd8 + 0x000000c020101010, // 0xd9 + 0x1010080700000000, // 0xda + 0xffffffffffffffff, // 0xdb + 0xffffffff00000000, // 0xdc + 0xf0f0f0f0f0f0f0f0, // 0xdd + 0x0f0f0f0f0f0f0f0f, // 0xde + 0x00000000ffffffff, // 0xdf + 0x0076888888740200, // 0xe0 + 0x5844444458484830, // 0xe1 + 0x00e04040404242fe, // 0xe2 + 0x00242828a87c0000, // 0xe3 + 0x00fe8240204082fe, // 0xe4 + 0x00384444443e0000, // 0xe5 + 0x405a644444440000, // 0xe6 + 0x0010282020fc0000, // 0xe7 + 0xfe103854543810fe, // 0xe8 + 0x003844aabaaa4438, // 0xe9 + 0x00ee448282824438, // 0xea + 0x007088887012221c, // 0xeb + 0x00006c92926c0000, // 0xec + 0x10107c92924c0000, // 0xed + 0x0038403040380000, // 0xee + 0x0082828282824438, // 0xef + 0x00fe00fe00fe0000, // 0xf0 + 0x007c10107c101000, // 0xf1 + 0x007e006018061860, // 0xf2 + 0x007e000618601806, // 0xf3 + 0x101010101010120c, // 0xf4 + 0x6090101010101010, // 0xf5 + 0x0010007c00100000, // 0xf6 + 0x000c926c92600000, // 0xf7 + 0x0000000030484830, // 0xf8 + 0x0000103810000000, // 0xf9 + 0x0000001000000000, // 0xfa + 0x10102828a4440202, // 0xfb + 0x00000000484848b0, // 0xfc + 0x0000000070201060, // 0xfd + 0x00007c7c7c7c7c00, // 0xfe + 0x0000000000000000, // 0xff +]; + +fn load_static() -> Cp437Font { + let mut bitmaps = + core::array::from_fn(|_| Bitmap::new(TILE_SIZE, TILE_SIZE)); + + for (char_code, bitmap) in bitmaps.iter_mut().enumerate() { + let bits = CP437_FONT_LINEAR[char_code]; + let mut bytes = bits.to_be_bytes(); + bytes.reverse(); + bitmap.data_ref_mut().copy_from_slice(bytes.as_slice()); + } + + Cp437Font::new(bitmaps) +} diff --git a/src/font_renderer.rs b/src/font_renderer.rs new file mode 100644 index 0000000..d777d86 --- /dev/null +++ b/src/font_renderer.rs @@ -0,0 +1,94 @@ +use crate::font_renderer::RenderError::{GlyphNotFound, OutOfBounds}; +use font_kit::canvas::{Canvas, Format, RasterizationOptions}; +use font_kit::error::GlyphLoadingError; +use font_kit::family_name::FamilyName; +use font_kit::font::Font; +use font_kit::hinting::HintingOptions; +use font_kit::properties::Properties; +use font_kit::source::SystemSource; +use pathfinder_geometry::transform2d::Transform2F; +use pathfinder_geometry::vector::{vec2f, vec2i}; +use servicepoint::{Bitmap, Grid, Origin, Pixels, TILE_SIZE}; +use std::sync::Mutex; + +pub struct FontRenderer8x8 { + font: Font, + canvas: Mutex, + fallback_char: Option, +} + +#[derive(Debug, thiserror::Error)] +pub enum RenderError { + #[error("Glyph not found for '{0}'")] + GlyphNotFound(char), + #[error(transparent)] + GlyphLoadingError(#[from] GlyphLoadingError), + #[error("out of bounds at {0} {1}")] + OutOfBounds(usize, usize), +} + +impl FontRenderer8x8 { + pub fn new(font: Font, fallback_char: Option) -> Self { + let canvas = + Canvas::new(vec2i(TILE_SIZE as i32, TILE_SIZE as i32), Format::A8); + assert_eq!(canvas.pixels.len(), TILE_SIZE * TILE_SIZE); + assert_eq!(canvas.stride, TILE_SIZE); + let fallback_char = fallback_char.and_then(|c| font.glyph_for_char(c)); + let result = Self { + font, + fallback_char, + canvas: Mutex::new(canvas), + }; + result + } + + pub fn render( + &self, + char: char, + bitmap: &mut Bitmap, + offset: Origin, + ) -> Result<(), RenderError> { + let mut canvas = self.canvas.lock().unwrap(); + let glyph_id = self.font.glyph_for_char(char).or(self.fallback_char); + let glyph_id = match glyph_id { + None => return Err(GlyphNotFound(char)), + Some(val) => val, + }; + + canvas.pixels.fill(0); + self.font.rasterize_glyph( + &mut canvas, + glyph_id, + TILE_SIZE as f32, + Transform2F::from_translation(vec2f(0f32, TILE_SIZE as f32)) + * Transform2F::default(), + HintingOptions::None, + RasterizationOptions::Bilevel, + )?; + + for y in 0..TILE_SIZE { + for x in 0..TILE_SIZE { + let index = x + y * TILE_SIZE; + let canvas_val = canvas.pixels[index] != 0; + let bitmap_x = (offset.x + x) as isize; + let bitmap_y = (offset.y + y) as isize; + if !bitmap.set_optional(bitmap_x, bitmap_y, canvas_val) { + return Err(OutOfBounds(x, y)); + } + } + } + + Ok(()) + } +} + +impl Default for FontRenderer8x8 { + fn default() -> Self { + let utf8_font = SystemSource::new() + .select_best_match(&[FamilyName::Monospace], &Properties::new()) + .unwrap() + .load() + .unwrap(); + FontRenderer8x8::new(utf8_font, Some('?')) + } +} diff --git a/src/gui.rs b/src/gui.rs index 9abaa06..c2b843d 100644 --- a/src/gui.rs +++ b/src/gui.rs @@ -20,9 +20,9 @@ pub struct App<'t> { display: &'t RwLock, luma: &'t RwLock, window: Option, - pixels: Option, stop_udp_tx: Sender<()>, cli: &'t Cli, + logical_size: LogicalSize, } const SPACER_HEIGHT: usize = 4; @@ -40,18 +40,42 @@ impl<'t> App<'t> { stop_udp_tx: Sender<()>, cli: &'t Cli, ) -> Self { + let logical_size = { + let height = if cli.spacers { + let num_spacers = (PIXEL_HEIGHT / TILE_SIZE) - 1; + PIXEL_HEIGHT + num_spacers * SPACER_HEIGHT + } else { + PIXEL_HEIGHT + }; + LogicalSize::new(PIXEL_WIDTH as u16, height as u16) + }; + App { display, luma, stop_udp_tx, - pixels: None, window: None, cli, + logical_size, } } fn draw(&mut self) { - let pixels = self.pixels.as_mut().unwrap(); + let window = self.window.as_ref().unwrap(); + let mut pixels = { + let window_size = window.inner_size(); + let surface_texture = SurfaceTexture::new( + window_size.width, + window_size.height, + &window, + ); + Pixels::new( + self.logical_size.width as u32, + self.logical_size.height as u32, + surface_texture, + ) + .unwrap() + }; let mut frame = pixels.frame_mut().chunks_exact_mut(4); let display = self.display.read().unwrap(); @@ -95,35 +119,13 @@ impl<'t> App<'t> { impl ApplicationHandler for App<'_> { fn resumed(&mut self, event_loop: &ActiveEventLoop) { - let height = if self.cli.spacers { - let num_spacers = (PIXEL_HEIGHT / TILE_SIZE) - 1; - PIXEL_HEIGHT + num_spacers * SPACER_HEIGHT - } else { - PIXEL_HEIGHT - }; - - let size = LogicalSize::new(PIXEL_WIDTH as u16, height as u16); let attributes = Window::default_attributes() .with_title("servicepoint-simulator") - .with_inner_size(size) + .with_inner_size(self.logical_size) .with_transparent(false); let window = event_loop.create_window(attributes).unwrap(); self.window = Some(window); - let window = self.window.as_ref().unwrap(); - - let pixels = { - let window_size = window.inner_size(); - let surface_texture = SurfaceTexture::new( - window_size.width, - window_size.height, - &window, - ); - Pixels::new(size.width as u32, size.height as u32, surface_texture) - .unwrap() - }; - - self.pixels = Some(pixels); } fn user_event(&mut self, event_loop: &ActiveEventLoop, event: AppEvents) { diff --git a/src/main.rs b/src/main.rs index 3874b35..8b2396f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -11,13 +11,14 @@ use servicepoint::*; use winit::event_loop::{ControlFlow, EventLoop}; use crate::execute_command::execute_command; -use crate::font::BitmapFont; +use crate::font::Cp437Font; +use crate::font_renderer::FontRenderer8x8; use crate::gui::{App, AppEvents}; mod execute_command; mod font; +mod font_renderer; mod gui; -mod static_font; #[derive(Parser, Debug)] struct Cli { @@ -56,14 +57,14 @@ fn main() { luma.fill(Brightness::MAX); let luma = RwLock::new(luma); - run(&display, &luma, socket, BitmapFont::default(), &cli); + run(&display, &luma, socket, Cp437Font::default(), &cli); } fn run( display_ref: &RwLock, luma_ref: &RwLock, socket: UdpSocket, - font: BitmapFont, + cp437_font: Cp437Font, cli: &Cli, ) { let (stop_udp_tx, stop_udp_rx) = mpsc::channel(); @@ -80,6 +81,7 @@ fn run( std::thread::scope(move |scope| { let udp_thread = scope.spawn(move || { let mut buf = [0; 8985]; + let utf8_font = FontRenderer8x8::default(); while stop_udp_rx.try_recv().is_err() { let (amount, _) = match socket.recv_from(&mut buf) { @@ -98,8 +100,8 @@ fn run( ); } - let package = match servicepoint::packet::Packet::try_from(&buf[..amount]) { - Err(_) => { + let package = match servicepoint::Packet::try_from(&buf[..amount]) { + Err(_) => { warn!("could not load packet with length {amount} into header"); continue; } @@ -114,7 +116,7 @@ fn run( Ok(val) => val, }; - if !execute_command(command, &font, display_ref, luma_ref) { + if !execute_command(command, &cp437_font, &utf8_font, display_ref, luma_ref) { // hard reset event_proxy .send_event(AppEvents::UdpThreadClosed) diff --git a/src/static_font.rs b/src/static_font.rs deleted file mode 100644 index 76ec974..0000000 --- a/src/static_font.rs +++ /dev/null @@ -1,276 +0,0 @@ -use crate::font::BitmapFont; -use servicepoint::{Bitmap, DataRef, TILE_SIZE}; - -/// Font from the display firmware `cape-cccb-apd/cp437font_linear.h` -pub(crate) const CP437_FONT_LINEAR: [u64; 256] = [ - 0x0000000000000000, // 0x00 - 0x003854ba82aa4438, // 0x01 - 0x003844bafed67c38, // 0x02 - 0x0010387cfeee4400, // 0x03 - 0x0010387cfe7c3810, // 0x04 - 0x003810d6fefe3838, // 0x05 - 0x003810d6fe7c3810, // 0x06 - 0x0000387c7c7c3800, // 0x07 - 0x00fec6828282c6fe, // 0x08 - 0x0000384444443800, // 0x09 - 0x00fec6bababac6fe, // 0x0a - 0x007088888a7a061e, // 0x0b - 0x1038103844444438, // 0x0c - 0x0030301010141418, // 0x0d - 0xc0c64642724e720e, // 0x0e - 0x00927c44c6447c92, // 0x0f - 0x00c0f0fcfefcf0c0, // 0x10 - 0x00061e7efe7e1e06, // 0x11 - 0x1038541010543810, // 0x12 - 0x2800282828282828, // 0x13 - 0x000e0a0a7a8a8a7e, // 0x14 - 0x0038441c28704438, // 0x15 - 0x000000ffff000000, // 0x16 - 0xfe10385410543810, // 0x17 - 0x1010101010543810, // 0x18 - 0x1038541010101010, // 0x19 - 0x00000804fe040800, // 0x1a - 0x00002040fe402000, // 0x1b - 0xffffc0c0c0c0c0c0, // 0x1c - 0x00002844fe442800, // 0x1d - 0x00fefe7c7c383810, // 0x1e - 0x001038387c7cfefe, // 0x1f - 0x0000000000000000, // 0x20 - 0x1000101010101010, // 0x21 - 0x0000000000505028, // 0x22 - 0x00247e24247e2400, // 0x23 - 0x1038541830543810, // 0x24 - 0x00844a2a54a8a442, // 0x25 - 0x003a444a32484830, // 0x26 - 0x0000000000201010, // 0x27 - 0x0810202020201008, // 0x28 - 0x2010080808081020, // 0x29 - 0x0010543854100000, // 0x2a - 0x0010107c10100000, // 0x2b - 0x2010100000000000, // 0x2c - 0x0000007c00000000, // 0x2d - 0x0010000000000000, // 0x2e - 0x4020201010080804, // 0x2f - 0x0038444454444438, // 0x30 - 0x007c101010503010, // 0x31 - 0x007c201008044438, // 0x32 - 0x003844043810087c, // 0x33 - 0x0004047e24140c04, // 0x34 - 0x003844047840407c, // 0x35 - 0x003844447840201c, // 0x36 - 0x004020100804047c, // 0x37 - 0x0038444438444438, // 0x38 - 0x007008043c444438, // 0x39 - 0x0000100000100000, // 0x3a - 0x2010100000100000, // 0x3b - 0x0006186018060000, // 0x3c - 0x00007c007c000000, // 0x3d - 0x00c0300c30c00000, // 0x3e - 0x1000384038044438, // 0x3f - 0x001c2248564a221c, // 0x40 - 0x0042427e24241818, // 0x41 - 0x007c42427c444478, // 0x42 - 0x001c22404040221c, // 0x43 - 0x0078444242424478, // 0x44 - 0x007e40407e40407e, // 0x45 - 0x004040407e40407e, // 0x46 - 0x001c22424e40221c, // 0x47 - 0x004242427e424242, // 0x48 - 0x007c10101010107c, // 0x49 - 0x003844040404047c, // 0x4a - 0x0042444870484442, // 0x4b - 0x007e404040404040, // 0x4c - 0x0082828292aac682, // 0x4d - 0x004242464a526242, // 0x4e - 0x0018244242422418, // 0x4f - 0x004040407c42427c, // 0x50 - 0x001a244a42422418, // 0x51 - 0x004244487c42427c, // 0x52 - 0x003c42023c40423c, // 0x53 - 0x00101010101010fe, // 0x54 - 0x003c424242424242, // 0x55 - 0x0010282844448282, // 0x56 - 0x0044446caa929282, // 0x57 - 0x0082442810284482, // 0x58 - 0x0010101010284482, // 0x59 - 0x007e20100804027e, // 0x5a - 0x3820202020202038, // 0x5b - 0x0408081010202040, // 0x5c - 0x3808080808080838, // 0x5d - 0x0000000000442810, // 0x5e - 0x007e000000000000, // 0x5f - 0x0000000000080810, // 0x60 - 0x003c443c04380000, // 0x61 - 0x0038444444784040, // 0x62 - 0x0038444044380000, // 0x63 - 0x003c4444443c0404, // 0x64 - 0x003c407844380000, // 0x65 - 0x2020202078202418, // 0x66 - 0x78043c44443e0000, // 0x67 - 0x0044444464584040, // 0x68 - 0x001c101010700010, // 0x69 - 0x38440404047c0010, // 0x6a - 0x0022243828242020, // 0x6b - 0x0018242020202020, // 0x6c - 0x0054545454780000, // 0x6d - 0x0044444464580000, // 0x6e - 0x0038444444380000, // 0x6f - 0x4040784444780000, // 0x70 - 0x04043c44443c0000, // 0x71 - 0x0040404064580000, // 0x72 - 0x00384418201c0000, // 0x73 - 0x0018242020782020, // 0x74 - 0x0038444444440000, // 0x75 - 0x0010282844440000, // 0x76 - 0x0028285454440000, // 0x77 - 0x0044281028440000, // 0x78 - 0x38043c4444440000, // 0x79 - 0x007c2010087c0000, // 0x7a - 0x0c0808083008080c, // 0x7b - 0x1010101010101010, // 0x7c - 0x301010100c101030, // 0x7d - 0x0000004c32000000, // 0x7e - 0xfe82828282442810, // 0x7f - 0x18083c428080423c, // 0x80 - 0x0038444444440028, // 0x81 - 0x003c407844381008, // 0x82 - 0x003c443c04382810, // 0x83 - 0x003c443c04380044, // 0x84 - 0x003c443c04381020, // 0x85 - 0x003c443c04382838, // 0x86 - 0x1038444044380000, // 0x87 - 0x003c407844382810, // 0x88 - 0x003c407844380044, // 0x89 - 0x003c407844381020, // 0x8a - 0x001c101010700028, // 0x8b - 0x001c101010702810, // 0x8c - 0x001c101010701020, // 0x8d - 0x0082827c44282892, // 0x8e - 0x0082827c44281038, // 0x8f - 0x00fe80fe80fe1008, // 0x90 - 0x007e907c126c0000, // 0x91 - 0x008e88784e28281e, // 0x92 - 0x0038444438002810, // 0x93 - 0x0038444444380028, // 0x94 - 0x0038444438001020, // 0x95 - 0x0038444444002810, // 0x96 - 0x0038444444001020, // 0x97 - 0x38043c4444440028, // 0x98 - 0x0038448282443882, // 0x99 - 0x0038448282820082, // 0x9a - 0x1038444044381010, // 0x9b - 0x00fc4240f0404438, // 0x9c - 0x107c107c10284482, // 0x9d - 0x001c22f840f8221c, // 0x9e - 0x205010103810120c, // 0x9f - 0x003c443c04381008, // 0xa0 - 0x001c101010701008, // 0xa1 - 0x0038444438001008, // 0xa2 - 0x0038444444001008, // 0xa3 - 0x0044446458004834, // 0xa4 - 0x00464a5262424834, // 0xa5 - 0x0000007090701060, // 0xa6 - 0x0000007088888870, // 0xa7 - 0x3844403804380010, // 0xa8 - 0x0040407c00000000, // 0xa9 - 0x0004047c00000000, // 0xaa - 0x0e84422c5048c442, // 0xab - 0x049e542c5448c442, // 0xac - 0x1010101010100010, // 0xad - 0x0024489048240000, // 0xae - 0x0048241224480000, // 0xaf - 0x1122448811224488, // 0xb0 - 0x55aa55aa55aa55aa, // 0xb1 - 0xddbb77eeddbb77ee, // 0xb2 - 0x1010101010101010, // 0xb3 - 0x101020c020101010, // 0xb4 - 0x1020c000c0201010, // 0xb5 - 0x2828488848282828, // 0xb6 - 0x282850e000000000, // 0xb7 - 0x1030d020c0000000, // 0xb8 - 0x2848880888482828, // 0xb9 - 0x2828282828282828, // 0xba - 0x2828c810e0000000, // 0xbb - 0x000000e010c82828, // 0xbc - 0x000000e050282828, // 0xbd - 0x0000c020d0301010, // 0xbe - 0x101020c000000000, // 0xbf - 0x0000000708101010, // 0xc0 - 0x000000c728101010, // 0xc1 - 0x101028c700000000, // 0xc2 - 0x1010080708101010, // 0xc3 - 0x000000ff00000000, // 0xc4 - 0x101028c728101010, // 0xc5 - 0x1008070007081010, // 0xc6 - 0x2828242324282828, // 0xc7 - 0x00000f1027282828, // 0xc8 - 0x282827100f000000, // 0xc9 - 0x0000ff0083442828, // 0xca - 0x28448300ff000000, // 0xcb - 0x2824232023242828, // 0xcc - 0x0000ff00ff000000, // 0xcd - 0x2844932893442828, // 0xce - 0x0000ff00c7281010, // 0xcf - 0x0000008344282828, // 0xd0 - 0x1028c700ff000000, // 0xd1 - 0x2828448300000000, // 0xd2 - 0x0000000f14282828, // 0xd3 - 0x0000070817181010, // 0xd4 - 0x1018170807000000, // 0xd5 - 0x2828140f00000000, // 0xd6 - 0x2828448344282828, // 0xd7 - 0x1028c700c7281010, // 0xd8 - 0x000000c020101010, // 0xd9 - 0x1010080700000000, // 0xda - 0xffffffffffffffff, // 0xdb - 0xffffffff00000000, // 0xdc - 0xf0f0f0f0f0f0f0f0, // 0xdd - 0x0f0f0f0f0f0f0f0f, // 0xde - 0x00000000ffffffff, // 0xdf - 0x0076888888740200, // 0xe0 - 0x5844444458484830, // 0xe1 - 0x00e04040404242fe, // 0xe2 - 0x00242828a87c0000, // 0xe3 - 0x00fe8240204082fe, // 0xe4 - 0x00384444443e0000, // 0xe5 - 0x405a644444440000, // 0xe6 - 0x0010282020fc0000, // 0xe7 - 0xfe103854543810fe, // 0xe8 - 0x003844aabaaa4438, // 0xe9 - 0x00ee448282824438, // 0xea - 0x007088887012221c, // 0xeb - 0x00006c92926c0000, // 0xec - 0x10107c92924c0000, // 0xed - 0x0038403040380000, // 0xee - 0x0082828282824438, // 0xef - 0x00fe00fe00fe0000, // 0xf0 - 0x007c10107c101000, // 0xf1 - 0x007e006018061860, // 0xf2 - 0x007e000618601806, // 0xf3 - 0x101010101010120c, // 0xf4 - 0x6090101010101010, // 0xf5 - 0x0010007c00100000, // 0xf6 - 0x000c926c92600000, // 0xf7 - 0x0000000030484830, // 0xf8 - 0x0000103810000000, // 0xf9 - 0x0000001000000000, // 0xfa - 0x10102828a4440202, // 0xfb - 0x00000000484848b0, // 0xfc - 0x0000000070201060, // 0xfd - 0x00007c7c7c7c7c00, // 0xfe - 0x0000000000000000, // 0xff -]; - -pub fn load_static() -> BitmapFont { - let mut bitmaps = - core::array::from_fn(|_| Bitmap::new(TILE_SIZE, TILE_SIZE)); - - for (char_code, bitmap) in bitmaps.iter_mut().enumerate() { - let bits = CP437_FONT_LINEAR[char_code]; - let mut bytes = bits.to_be_bytes(); - bytes.reverse(); - bitmap.data_ref_mut().copy_from_slice(bytes.as_slice()); - } - - BitmapFont::new(bitmaps) -}