diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6b152011..f7235e3b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -51,6 +51,7 @@ jobs: - run: cargo fmt --all -- --check - run: cargo clippy --workspace --all-targets --all-features -- -D warnings + - run: cargo clippy -p tui-test-rs --all-targets --no-default-features -- -D warnings - run: cargo build - run: cargo test --workspace -- --test-threads=1 diff --git a/Cargo.lock b/Cargo.lock index cc769590..8385689b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -98,6 +98,12 @@ version = "1.0.102" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c" +[[package]] +name = "arrayref" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb" + [[package]] name = "arrayvec" version = "0.7.7" @@ -140,6 +146,12 @@ dependencies = [ "generic-array", ] +[[package]] +name = "bytemuck" +version = "1.25.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95832e849adfb21180ccb6826a99da14e5d266ae5c2e668e1602cf234f153797" + [[package]] name = "castaway" version = "0.2.4" @@ -261,6 +273,15 @@ dependencies = [ "unicode-segmentation", ] +[[package]] +name = "core_maths" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77745e017f5edba1a9c1d854f6f3a52dac8a12dd5af5d2f54aecf61e43d80d30" +dependencies = [ + "libm", +] + [[package]] name = "cpufeatures" version = "0.2.17" @@ -441,6 +462,18 @@ dependencies = [ "miniz_oxide", ] +[[package]] +name = "fontdb" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "457e789b3d1202543297a350643cf459f836cade38934e7a4cf6a39e7cde2905" +dependencies = [ + "log", + "slotmap", + "tinyvec", + "ttf-parser", +] + [[package]] name = "futures" version = "0.3.32" @@ -634,6 +667,12 @@ dependencies = [ "windows-link", ] +[[package]] +name = "libm" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6d2cec3eae94f9f509c767b45932f1ada8350c4bdb85af2fcab4a3c14807981" + [[package]] name = "libredox" version = "0.1.17" @@ -1247,6 +1286,15 @@ version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" +[[package]] +name = "slotmap" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdd58c3c93c3d278ca835519292445cb4b0d4dc59ccfdf7ceadaab3f8aeb4038" +dependencies = [ + "version_check", +] + [[package]] name = "smallvec" version = "1.15.2" @@ -1259,6 +1307,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" +[[package]] +name = "strict-num" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6637bab7722d379c8b41ba849228d680cc12d0a45ba1fa2b48f2a30577a06731" + [[package]] name = "strsim" version = "0.11.1" @@ -1322,6 +1376,46 @@ dependencies = [ "syn", ] +[[package]] +name = "tiny-skia" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83d13394d44dae3207b52a326c0c85a8bf87f1541f23b0d143811088497b09ab" +dependencies = [ + "arrayref", + "arrayvec", + "bytemuck", + "cfg-if", + "log", + "tiny-skia-path", +] + +[[package]] +name = "tiny-skia-path" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c9e7fc0c2e86a30b117d0462aa261b72b7a99b7ebd7deb3a14ceda95c5bdc93" +dependencies = [ + "arrayref", + "bytemuck", + "strict-num", +] + +[[package]] +name = "tinyvec" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb4ebadaa0af04fab11ae01eb5f9fdb5f9c5b875506e210e71c07873528baa7f" +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 = "tokio" version = "1.53.1" @@ -1375,6 +1469,9 @@ name = "ttf-parser" version = "0.25.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2df906b07856748fa3f6e0ad0cbaa047052d4a7dd609e231c4f72cee8c36f31" +dependencies = [ + "core_maths", +] [[package]] name = "tui-test-cli" @@ -1423,11 +1520,13 @@ dependencies = [ "compact_str", "dirs", "flate2", + "fontdb", "portable-pty", "regex", "serde", "serde_json", "sha2", + "tiny-skia", "toml", "ttf-parser", "unicode-width", diff --git a/Cargo.toml b/Cargo.toml index 49c27bf4..b31140c4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,6 +28,7 @@ crossterm = "0.28" dialoguer = { version = "0.11", default-features = false } dirs = "6.0.0" flate2 = "1.1.9" +fontdb = { version = "0.23.0", default-features = false, features = ["fs", "std"] } interprocess = "2.4.2" portable-pty = "0.9.0" regex = "1.12.4" @@ -37,6 +38,7 @@ sha2 = "0.10.9" toml = "0.9" tui-test = { package = "tui-test-rs", path = "crates/tui-test" } unicode-width = "0.2.2" +tiny-skia = { version = "0.11.4", default-features = false, features = ["std"] } ttf-parser = { version = "0.25.1", default-features = false, features = ["std"] } [profile.release] diff --git a/crates/tui-test/Cargo.toml b/crates/tui-test/Cargo.toml index 3f0d0f66..27b524b6 100644 --- a/crates/tui-test/Cargo.toml +++ b/crates/tui-test/Cargo.toml @@ -12,6 +12,10 @@ readme = "../../README.md" name = "tui_test" path = "src/lib.rs" +[features] +default = [] +recording-raster = ["dep:fontdb", "dep:tiny-skia"] + [dependencies] alacritty_terminal.workspace = true anyhow.workspace = true @@ -19,11 +23,13 @@ bitflags.workspace = true compact_str.workspace = true dirs.workspace = true flate2.workspace = true +fontdb = { workspace = true, optional = true } portable-pty.workspace = true regex.workspace = true serde.workspace = true serde_json.workspace = true sha2.workspace = true toml.workspace = true +tiny-skia = { workspace = true, optional = true } ttf-parser.workspace = true unicode-width.workspace = true