diff --git a/.cargo/config.toml b/.cargo/config.toml new file mode 100644 index 0000000000..53e2ac1a7f --- /dev/null +++ b/.cargo/config.toml @@ -0,0 +1,2 @@ +[alias] +testit = "test --workspace --test tests --" diff --git a/.gitignore b/.gitignore index 0475df8a53..9b3215635c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,9 @@ # General +<<<<<<< HEAD # .vscode +======= +.vscode +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 .idea _things desktop.ini @@ -26,7 +30,10 @@ package-lock.json # Nix /result .direnv/ +<<<<<<< HEAD # Generated documentation /assets /docs.json +======= +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 diff --git a/Cargo.lock b/Cargo.lock index 6710ecbe6a..443984fe3e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,6 +1,10 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. +<<<<<<< HEAD version = 3 +======= +version = 4 +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 [[package]] name = "adler2" @@ -138,6 +142,7 @@ checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "biblatex" +<<<<<<< HEAD version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a35a7317fcbdbef94b60d0dd0a658711a936accfce4a631fea4bf8e527eff3c2" @@ -145,6 +150,16 @@ dependencies = [ "numerals", "paste", "strum", +======= +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d0c374feba1b9a59042a7c1cf00ce7c34b977b9134fe7c42b08e5183729f66" +dependencies = [ + "paste", + "roman-numerals-rs", + "strum", + "unic-langid", +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 "unicode-normalization", "unscanny", ] @@ -160,18 +175,30 @@ dependencies = [ [[package]] name = "bit-set" +<<<<<<< HEAD version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" +======= +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 dependencies = [ "bit-vec", ] [[package]] name = "bit-vec" +<<<<<<< HEAD version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" +======= +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 [[package]] name = "bitflags" @@ -181,9 +208,15 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" +<<<<<<< HEAD version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd" +======= +version = "2.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 dependencies = [ "serde", ] @@ -214,9 +247,35 @@ checksum = "64fa3c856b712db6612c019f14756e64e4bcea13337a6b33b696333a9eaa2d06" [[package]] name = "bytemuck" +<<<<<<< HEAD version = "1.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6b1fc10dbac614ebc03540c9dbd60e83887fda27794998c6528f1782047d540" +======= +version = "1.23.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c76a5792e44e4abe34d3abf15636779261d45a7450612059293d1d2cfc63422" +dependencies = [ + "bytemuck_derive", +] + +[[package]] +name = "bytemuck_derive" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fa76293b4f7bb636ab88fd78228235b5248b4d05cc589aed610f954af5d7c7a" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 [[package]] name = "byteorder-lite" @@ -226,9 +285,15 @@ checksum = "8f1fe948ff07f4bd06c30984e69f5b4899c516a3ef74f34df92a2df2ab535495" [[package]] name = "cc" +<<<<<<< HEAD version = "1.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fcb57c740ae1daf453ae85f16e37396f672b039e00d9d866e07ddb24e328e3a" +======= +version = "1.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4730490333d58093109dc02c23174c3f4d490998c3fed3cc8e82d57afedb9cf" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 dependencies = [ "jobserver", "libc", @@ -261,14 +326,24 @@ checksum = "7588475145507237ded760e52bf2f1085495245502033756d28ea72ade0e498b" [[package]] name = "chrono" +<<<<<<< HEAD version = "0.4.40" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a7964611d71df112cb1730f2ee67324fcf4d0fc6606acbbe9bfe06df124637c" +======= +version = "0.4.39" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e36cc9d416881d2e24f9a963be5fb1cd90966419ac844274161d10488b3e825" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 dependencies = [ "android-tzdata", "iana-time-zone", "num-traits", +<<<<<<< HEAD "windows-link", +======= + "windows-targets", +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 ] [[package]] @@ -306,19 +381,33 @@ dependencies = [ [[package]] name = "citationberg" +<<<<<<< HEAD version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e4595e03beafb40235070080b5286d3662525efc622cca599585ff1d63f844fa" dependencies = [ "quick-xml 0.36.2", +======= +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f6597e8bdbca37f1f56e5a80d15857b0932aead21a78d20de49e99e74933046" +dependencies = [ + "quick-xml 0.38.3", +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 "serde", ] [[package]] name = "clap" +<<<<<<< HEAD version = "4.5.32" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6088f3ae8c3608d19260cd7445411865a485688711b78b5be70d78cd96136f83" +======= +version = "4.5.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e77c3243bd94243c03672cb5154667347c457ca271254724f9f393aee1c05ff" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 dependencies = [ "clap_builder", "clap_derive", @@ -326,9 +415,15 @@ dependencies = [ [[package]] name = "clap_builder" +<<<<<<< HEAD version = "4.5.32" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22a7ef7f676155edfb82daa97f99441f3ebf4a58d5e32f295a56259f1b6facc8" +======= +version = "4.5.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b26884eb4b57140e4d2d93652abfa49498b938b3c9179f9fc487b0acc3edad7" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 dependencies = [ "anstream", "anstyle", @@ -339,18 +434,30 @@ dependencies = [ [[package]] name = "clap_complete" +<<<<<<< HEAD version = "4.5.47" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c06f5378ea264ad4f82bbc826628b5aad714a75abf6ece087e923010eb937fb6" +======= +version = "4.5.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "375f9d8255adeeedd51053574fd8d4ba875ea5fa558e86617b07f09f1680c8b6" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 dependencies = [ "clap", ] [[package]] name = "clap_derive" +<<<<<<< HEAD version = "4.5.32" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09176aae279615badda0765c0c0b3f6ed53f4709118af73cf4655d85d1530cd7" +======= +version = "4.5.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf4ced95c6f4a675af3da73304b9ac4ed991640c36374e4b46795c49e17cf1ed" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 dependencies = [ "heck", "proc-macro2", @@ -392,9 +499,15 @@ dependencies = [ [[package]] name = "codex" +<<<<<<< HEAD version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "724d27a0ee38b700e5e164350e79aba601a0db673ac47fce1cb74c3e38864036" +======= +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9589e1effc5cacbea347899645c654158b03b2053d24bb426fd3128ced6e423c" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 [[package]] name = "color-print" @@ -431,6 +544,7 @@ checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" [[package]] name = "comemo" +<<<<<<< HEAD version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df6916408a724339aa77b18214233355f3eb04c42eb895e5f8909215bd8a7a91" @@ -439,13 +553,30 @@ dependencies = [ "once_cell", "parking_lot", "siphasher", +======= +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "649d7b2d867b569729c03c0f6968db10bc95921182a1f2b2012b1b549492f39d" +dependencies = [ + "comemo-macros", + "parking_lot", + "rustc-hash", + "siphasher", + "slab", +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 ] [[package]] name = "comemo-macros" +<<<<<<< HEAD version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c8936e42f9b4f5bdfaf23700609ac1f11cb03ad4c1ec128a4ee4fd0903e228db" +======= +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51c87fc7e85487493ddedae1a3a34b897c77ad8825375b79265a8a162c28d535" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 dependencies = [ "proc-macro2", "quote", @@ -488,9 +619,15 @@ dependencies = [ [[package]] name = "crossbeam-channel" +<<<<<<< HEAD version = "0.5.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06ba6d68e24814cb8de6bb986db8222d3a027d15872cabc0d18817bc3c0e4471" +======= +version = "0.5.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82b8f8f868b36967f9606790d1903570de9ceaf870a7bf9fbbd3016d636a2cb2" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 dependencies = [ "crossbeam-utils", ] @@ -540,9 +677,15 @@ dependencies = [ [[package]] name = "csv-core" +<<<<<<< HEAD version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7d02f3b0da4c6504f86e9cd789d8dbafab48c2321be74e9987593de5a894d93d" +======= +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5efa2b3d7902f4b634a20cae3c9c4e6209dc4779feb6863329607560143efa70" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 dependencies = [ "memchr", ] @@ -555,9 +698,15 @@ checksum = "5c297a1c74b71ae29df00c3e22dd9534821d60eb9af5a0192823fa2acea70c2a" [[package]] name = "deranged" +<<<<<<< HEAD version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c9e6a11ca8224451684bc0d7d5a7adbf8f2fd6887261a1cfc3c0432f9d4068e" +======= +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 dependencies = [ "powerfmt", ] @@ -606,12 +755,15 @@ dependencies = [ ] [[package]] +<<<<<<< HEAD name = "downcast-rs" version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2" [[package]] +======= +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 name = "ecow" version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -622,9 +774,15 @@ dependencies = [ [[package]] name = "either" +<<<<<<< HEAD version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" +======= +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 [[package]] name = "embedded-io" @@ -670,9 +828,15 @@ dependencies = [ [[package]] name = "equivalent" +<<<<<<< HEAD version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" +======= +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 [[package]] name = "errno" @@ -685,6 +849,7 @@ dependencies = [ ] [[package]] +<<<<<<< HEAD name = "fancy-regex" version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -692,6 +857,25 @@ checksum = "b95f7c0680e4142284cf8b22c14a476e87d61b004a3a0861872b32ef7ead40a2" dependencies = [ "bit-set", "regex", +======= +name = "euclid" +version = "0.22.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad9cdb4b747e485a12abb0e6566612956c7a1bafa3bdb8d682c5b6d403589e48" +dependencies = [ + "num-traits", +] + +[[package]] +name = "fancy-regex" +version = "0.16.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "998b056554fbe42e03ae0e152895cd1a7e1002aec800fdc6635d20270260c46f" +dependencies = [ + "bit-set", + "regex-automata", + "regex-syntax", +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 ] [[package]] @@ -729,11 +913,20 @@ dependencies = [ [[package]] name = "flate2" +<<<<<<< HEAD version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "11faaf5a5236997af9848be0bef4db95824b1d534ebc64d0f0c6cf3e67bd38dc" dependencies = [ "crc32fast", +======= +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a3d7db9596fecd151c5f638c0ee5d5bd487b6e0ea232e5dc96d5250f6f94b1d" +dependencies = [ + "crc32fast", + "libz-rs-sys", +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 "miniz_oxide", ] @@ -744,16 +937,38 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "98de4bbd547a563b716d8dfa9aad1cb19bfab00f4fa09a6a4ed21dbcf44ce9c4" [[package]] +<<<<<<< HEAD +======= +name = "float-cmp" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b09cf3155332e944990140d967ff5eceb70df778b34f77d8075db46e4704e6d8" +dependencies = [ + "num-traits", +] + +[[package]] +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 name = "fnv" version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] +<<<<<<< HEAD name = "foldhash" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" +======= +name = "font-types" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "511e2c18a516c666d27867d2f9821f76e7d591f762e9fc41dd6cc5c90fe54b0b" +dependencies = [ + "bytemuck", +] +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 [[package]] name = "fontconfig-parser" @@ -766,9 +981,15 @@ dependencies = [ [[package]] name = "fontdb" +<<<<<<< HEAD version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37be9fc20d966be438cd57a45767f73349477fb0f85ce86e000557f787298afb" +======= +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "457e789b3d1202543297a350643cf459f836cade38934e7a4cf6a39e7cde2905" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 dependencies = [ "fontconfig-parser", "log", @@ -845,6 +1066,7 @@ dependencies = [ [[package]] name = "getrandom" +<<<<<<< HEAD version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73fea8450eea4bac3940448fb7ae50d91f034f941199fcd9d909a5a07aa455f0" @@ -853,6 +1075,16 @@ dependencies = [ "libc", "r-efi", "wasi 0.14.2+wasi-0.2.4", +======= +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a49c392881ce6d5c3b8cb70f98717b7c07aabbdff06687b9030dbfbe2725f8" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.13.3+wasi-0.2.2", + "windows-targets", +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 ] [[package]] @@ -866,10 +1098,23 @@ dependencies = [ ] [[package]] +<<<<<<< HEAD name = "half" version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7db2ff139bba50379da6aa0766b52fdcb62cb5b263009b09ed58ba604e14bbd1" +======= +name = "glidesort" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2e102e6eb644d3e0b186fc161e4460417880a0a0b87d235f2e5b8fb30f2e9e0" + +[[package]] +name = "half" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 dependencies = [ "cfg-if", "crunchy", @@ -886,6 +1131,7 @@ name = "hashbrown" version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" +<<<<<<< HEAD dependencies = [ "foldhash", ] @@ -895,16 +1141,33 @@ name = "hayagriva" version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "954907554bb7fcba29a4f917c2d43e289ec21b69d872ccf97db160eca6caeed8" +======= + +[[package]] +name = "hayagriva" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cb69425736f184173b3ca6e27fcba440a61492a790c786b1c6af7e06a03e575" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 dependencies = [ "biblatex", "ciborium", "citationberg", +<<<<<<< HEAD "indexmap 2.8.0", "numerals", "paste", "serde", "serde_yaml 0.9.34+deprecated", "thiserror 1.0.69", +======= + "indexmap 2.7.1", + "paste", + "roman-numerals-rs", + "serde", + "serde_yaml 0.9.34+deprecated", + "thiserror", +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 "unic-langid", "unicode-segmentation", "unscanny", @@ -912,6 +1175,91 @@ dependencies = [ ] [[package]] +<<<<<<< HEAD +======= +name = "hayro" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "048488ba88552bb0fb2a7e4001c64d5bed65d1a92167186a1bb9151571f32e60" +dependencies = [ + "bytemuck", + "hayro-interpret", + "image", + "kurbo 0.12.0", +] + +[[package]] +name = "hayro-font" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10e7e97ce840a6a70e7901e240ec65ba61106b66b37a4a1b899a2ce484248463" +dependencies = [ + "log", + "phf", +] + +[[package]] +name = "hayro-interpret" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56204c972d08e844f3db13b1e14be769f846e576699b46d4f4637cc4f8f70102" +dependencies = [ + "bitflags 2.9.1", + "hayro-font", + "hayro-syntax", + "kurbo 0.12.0", + "log", + "moxcms", + "phf", + "rustc-hash", + "siphasher", + "skrifa", + "smallvec", + "yoke 0.8.0", +] + +[[package]] +name = "hayro-svg" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8c673304cec6e0dfd3b4f71fccecd45646899aa70279b62d3f933842abc4ac5" +dependencies = [ + "base64", + "hayro-interpret", + "image", + "kurbo 0.12.0", + "siphasher", + "xmlwriter", +] + +[[package]] +name = "hayro-syntax" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9e5c7dbc0f11dc42775d1a6cc00f5f5137b90b6288dd7fe5f71d17b14d10be" +dependencies = [ + "flate2", + "kurbo 0.12.0", + "log", + "rustc-hash", + "smallvec", + "zune-jpeg", +] + +[[package]] +name = "hayro-write" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc05d8b4bc878b9aee48d980ecb25ed08f1dd9fad6da5ab4d9b7c56ec03a0cf6" +dependencies = [ + "flate2", + "hayro-syntax", + "log", + "pdf-writer", +] + +[[package]] +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 name = "heck" version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -960,9 +1308,15 @@ checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" dependencies = [ "displaydoc", "serde", +<<<<<<< HEAD "yoke", "zerofrom", "zerovec", +======= + "yoke 0.7.5", + "zerofrom", + "zerovec 0.10.4", +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 ] [[package]] @@ -973,9 +1327,15 @@ checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" dependencies = [ "displaydoc", "litemap", +<<<<<<< HEAD "tinystr", "writeable", "zerovec", +======= + "tinystr 0.7.6", + "writeable", + "zerovec 0.10.4", +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 ] [[package]] @@ -988,8 +1348,13 @@ dependencies = [ "icu_locid", "icu_locid_transform_data", "icu_provider", +<<<<<<< HEAD "tinystr", "zerovec", +======= + "tinystr 0.7.6", + "zerovec 0.10.4", +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 ] [[package]] @@ -1013,7 +1378,11 @@ dependencies = [ "utf16_iter", "utf8_iter", "write16", +<<<<<<< HEAD "zerovec", +======= + "zerovec 0.10.4", +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 ] [[package]] @@ -1034,8 +1403,13 @@ dependencies = [ "icu_properties_data", "icu_provider", "serde", +<<<<<<< HEAD "tinystr", "zerovec", +======= + "tinystr 0.7.6", + "zerovec 0.10.4", +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 ] [[package]] @@ -1056,11 +1430,19 @@ dependencies = [ "postcard", "serde", "stable_deref_trait", +<<<<<<< HEAD "tinystr", "writeable", "yoke", "zerofrom", "zerovec", +======= + "tinystr 0.7.6", + "writeable", + "yoke 0.7.5", + "zerofrom", + "zerovec 0.10.4", +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 ] [[package]] @@ -1072,8 +1454,13 @@ dependencies = [ "icu_locid", "icu_locid_transform", "icu_provider", +<<<<<<< HEAD "tinystr", "zerovec", +======= + "tinystr 0.7.6", + "zerovec 0.10.4", +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 ] [[package]] @@ -1087,7 +1474,11 @@ dependencies = [ "serde", "writeable", "zerotrie", +<<<<<<< HEAD "zerovec", +======= + "zerovec 0.10.4", +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 ] [[package]] @@ -1115,7 +1506,11 @@ dependencies = [ "icu_segmenter_data", "serde", "utf8_iter", +<<<<<<< HEAD "zerovec", +======= + "zerovec 0.10.4", +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 ] [[package]] @@ -1146,6 +1541,7 @@ dependencies = [ ] [[package]] +<<<<<<< HEAD name = "if_chain" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1156,11 +1552,21 @@ name = "image" version = "0.25.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cd6f44aed642f18953a158afeb30206f4d50da59fbc66ecb53c66488de73563b" +======= +name = "image" +version = "0.25.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db35664ce6b9810857a38a906215e75a9c879f0696556a39f59c62829710251a" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 dependencies = [ "bytemuck", "byteorder-lite", "color_quant", "gif", +<<<<<<< HEAD +======= + "image-webp", +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 "num-traits", "png", "zune-core", @@ -1169,9 +1575,15 @@ dependencies = [ [[package]] name = "image-webp" +<<<<<<< HEAD version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f79afb8cbee2ef20f59ccd477a218c12a93943d075b492015ecb1bb81f8ee904" +======= +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b77d01e822461baa8409e156015a1d91735549f0f2c17691bd2d996bef238f7f" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 dependencies = [ "byteorder-lite", "quick-error", @@ -1184,6 +1596,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "edcd27d72f2f071c64249075f42e205ff93c9a4c5f6c6da53e79ed9f9832c285" [[package]] +<<<<<<< HEAD name = "include_dir" version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1201,6 +1614,12 @@ dependencies = [ "proc-macro2", "quote", ] +======= +name = "imagesize" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09e54e57b4c48b40f7aec75635392b12b3421fa26fe8b4332e63138ed278459c" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 [[package]] name = "indexmap" @@ -1214,9 +1633,15 @@ dependencies = [ [[package]] name = "indexmap" +<<<<<<< HEAD version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3954d50fe15b02142bf25d3b8bdadb634ec3948f103d04ffe3031bc8fe9d7058" +======= +version = "2.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c9c992b02b5b4c94ea26e32fe5bccb7aa7d9f390ab5c1221ff895bc7ea8b652" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 dependencies = [ "equivalent", "hashbrown 0.15.2", @@ -1225,12 +1650,25 @@ dependencies = [ ] [[package]] +<<<<<<< HEAD +======= +name = "infer" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a588916bfdfd92e71cacef98a63d9b1f0d74d6599980d11894290e7ddefffcf7" + +[[package]] +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 name = "inotify" version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f37dccff2791ab604f9babef0ba14fbe0be30bd368dc541e2b08d07c8aa908f3" dependencies = [ +<<<<<<< HEAD "bitflags 2.9.0", +======= + "bitflags 2.9.1", +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 "inotify-sys", "libc", ] @@ -1271,9 +1709,15 @@ checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" [[package]] name = "itoa" +<<<<<<< HEAD version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" +======= +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 [[package]] name = "jobserver" @@ -1324,16 +1768,70 @@ dependencies = [ ] [[package]] +<<<<<<< HEAD name = "kurbo" version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "89234b2cc610a7dd927ebde6b41dd1a5d4214cffaef4cf1fb2195d592f92518f" +======= +name = "krilla" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "199be5f63da6e19b71051fd5276258a8e55449ac48e2e7492c68238f38ca9f3b" +dependencies = [ + "base64", + "bumpalo", + "comemo", + "flate2", + "float-cmp 0.10.0", + "gif", + "hayro-write", + "image-webp", + "imagesize 0.14.0", + "once_cell", + "pdf-writer", + "png", + "rayon", + "rustc-hash", + "rustybuzz", + "siphasher", + "skrifa", + "smallvec", + "subsetter", + "tiny-skia-path", + "xmp-writer", + "yoke 0.8.0", + "zune-jpeg", +] + +[[package]] +name = "krilla-svg" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d3eec075c9507dfdbfb4b9bc3b2aeac074ed422b61bcfd93517616d6b3d19c3" +dependencies = [ + "flate2", + "fontdb", + "krilla", + "png", + "resvg", + "tiny-skia", + "usvg", +] + +[[package]] +name = "kurbo" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1077d333efea6170d9ccb96d3c3026f300ca0773da4938cc4c811daa6df68b0c" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 dependencies = [ "arrayvec", "smallvec", ] [[package]] +<<<<<<< HEAD name = "libc" version = "0.2.171" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1344,15 +1842,44 @@ name = "libdeflate-sys" version = "1.23.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38b72ad3fbf5ac78f2df7b36075e48adf2459b57c150b9e63937d0204d0f9cd7" +======= +name = "kurbo" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce9729cc38c18d86123ab736fd2e7151763ba226ac2490ec092d1dd148825e32" +dependencies = [ + "arrayvec", + "euclid", + "smallvec", +] + +[[package]] +name = "libc" +version = "0.2.169" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" + +[[package]] +name = "libdeflate-sys" +version = "1.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413b667c8a795fcbe6287a75a8ce92b1dae928172c716fe95044cb2ec7877941" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 dependencies = [ "cc", ] [[package]] name = "libdeflater" +<<<<<<< HEAD version = "1.23.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "013344b17f9dceddff4872559ae19378bd8ee0479eccdd266d2dd2e894b4792f" +======= +version = "1.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d78376c917eec0550b9c56c858de50e1b7ebf303116487562e624e63ce51453a" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 dependencies = [ "libdeflate-sys", ] @@ -1379,12 +1906,28 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ +<<<<<<< HEAD "bitflags 2.9.0", +======= + "bitflags 2.9.1", +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 "libc", "redox_syscall", ] [[package]] +<<<<<<< HEAD +======= +name = "libz-rs-sys" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "172a788537a2221661b480fee8dc5f96c580eb34fa88764d3205dc356c7e4221" +dependencies = [ + "zlib-rs", +] + +[[package]] +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 name = "linked-hash-map" version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1392,9 +1935,15 @@ checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" [[package]] name = "linux-raw-sys" +<<<<<<< HEAD version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fe7db12097d22ec582439daf8618b8fdd1a7bef6270e9af3b1ebcd30893cf413" +======= +version = "0.4.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 [[package]] name = "lipsum" @@ -1408,9 +1957,15 @@ dependencies = [ [[package]] name = "litemap" +<<<<<<< HEAD version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "23fb14cb19457329c82206317a5663005a4d404783dc74f4252769b0d5f42856" +======= +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 dependencies = [ "serde", ] @@ -1433,9 +1988,15 @@ checksum = "9374ef4228402d4b7e403e5838cb880d9ee663314b0a900d5a6aabf0c213552e" [[package]] name = "log" +<<<<<<< HEAD version = "0.4.26" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "30bde2b3dc3671ae49d8e2e9f044c7c005836e7a023ee57cffa25ab82764bb9e" +======= +version = "0.4.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04cbf5b083de1c7e0222a7a51dbfdba1cbe1c6ab0b15e29fff3f6c077fd9cd9f" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 [[package]] name = "lzma-sys" @@ -1449,12 +2010,15 @@ dependencies = [ ] [[package]] +<<<<<<< HEAD name = "md5" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "490cc448043f947bae3cbee9c203358d62dbee0db12107a74be5c30ccfd09771" [[package]] +======= +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 name = "memchr" version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1487,13 +2051,20 @@ dependencies = [ [[package]] name = "mio" +<<<<<<< HEAD version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" +======= +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78bed444cc8a2160f01cbcf811ef18cac863ad68ae8ca62092e8db51d51c761c" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 dependencies = [ "libc", "log", "wasi 0.11.0+wasi-snapshot-preview1", +<<<<<<< HEAD "windows-sys 0.52.0", ] @@ -1502,6 +2073,20 @@ name = "multi-stash" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "685a9ac4b61f4e728e1d2c6a7844609c16527aeb5e6c865915c08e619c16410f" +======= + "windows-sys 0.59.0", +] + +[[package]] +name = "moxcms" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddd32fa8935aeadb8a8a6b6b351e40225570a37c43de67690383d87ef170cd08" +dependencies = [ + "num-traits", + "pxfm", +] +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 [[package]] name = "mutate_once" @@ -1511,9 +2096,15 @@ checksum = "16cf681a23b4d0a43fc35024c176437f9dcd818db34e0f42ab456a0ee5ad497b" [[package]] name = "native-tls" +<<<<<<< HEAD version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "87de3442987e9dbec73158d5c715e7ad9072fda936bb03d19d7fa10e00520f0e" +======= +version = "0.2.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dab59f8e050d5df8e4dd87d9206fb6f65a483e20ac9fda365ade4fab353196c" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 dependencies = [ "libc", "log", @@ -1542,7 +2133,11 @@ version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2fee8403b3d66ac7b26aee6e40a897d85dc5ce26f44da36b8b73e987cc52e943" dependencies = [ +<<<<<<< HEAD "bitflags 2.9.0", +======= + "bitflags 2.9.1", +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 "filetime", "fsevent-sys", "inotify", @@ -1596,6 +2191,7 @@ dependencies = [ ] [[package]] +<<<<<<< HEAD name = "numerals" version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1606,6 +2202,12 @@ name = "once_cell" version = "1.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d75b0bedcc4fe52caa0e03d9f1151a323e4aa5e2d78ba3580400cd3c9e2bc4bc" +======= +name = "once_cell" +version = "1.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 [[package]] name = "open" @@ -1620,11 +2222,19 @@ dependencies = [ [[package]] name = "openssl" +<<<<<<< HEAD version = "0.10.71" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5e14130c6a98cd258fdcb0fb6d744152343ff729cbfcb28c656a9d12b999fbcd" dependencies = [ "bitflags 2.9.0", +======= +version = "0.10.72" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fedfea7d58a1f73118430a55da6a286e7b044961736ce96a16a17068ea25e5da" +dependencies = [ + "bitflags 2.9.1", +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 "cfg-if", "foreign-types", "libc", @@ -1652,18 +2262,30 @@ checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" [[package]] name = "openssl-src" +<<<<<<< HEAD version = "300.4.2+3.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "168ce4e058f975fe43e89d9ccf78ca668601887ae736090aacc23ae353c298e2" +======= +version = "300.4.1+3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "faa4eac4138c62414b5622d1b31c5c304f34b406b013c079c2bbc652fdd6678c" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 dependencies = [ "cc", ] [[package]] name = "openssl-sys" +<<<<<<< HEAD version = "0.9.106" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8bb61ea9811cc39e3c2069f40b8b8e2e70d8569b361f879786cc7ed48b777cdd" +======= +version = "0.9.107" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8288979acd84749c744a9014b4382d42b8f7b2592847b5afb2ed29e5d16ede07" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 dependencies = [ "cc", "libc", @@ -1680,14 +2302,24 @@ checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" [[package]] name = "oxipng" +<<<<<<< HEAD version = "9.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3bce05680d3f2ec3f0510f19608d56712fa7ea681b4ba293c3b74a04c2e55279" +======= +version = "9.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa3202b10a7ffac89508bb091fe420048c47926b37c5ff84d78dc8af7044fa86" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 dependencies = [ "bitvec", "crossbeam-channel", "filetime", +<<<<<<< HEAD "indexmap 2.8.0", +======= + "indexmap 2.7.1", +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 "libdeflater", "log", "rayon", @@ -1757,11 +2389,19 @@ checksum = "df94ce210e5bc13cb6651479fa48d14f601d9858cfe0467f43ae157023b938d3" [[package]] name = "pdf-writer" +<<<<<<< HEAD version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5df03c7d216de06f93f398ef06f1385a60f2c597bb96f8195c8d98e08a26b1d5" dependencies = [ "bitflags 2.9.0", +======= +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92a79477295a713c2ed425aa82a8b5d20cec3fdee203706cbe6f3854880c1c81" +dependencies = [ + "bitflags 2.9.1", +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 "itoa", "memchr", "ryu", @@ -1775,6 +2415,7 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "phf" +<<<<<<< HEAD version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078" @@ -1791,23 +2432,47 @@ checksum = "aef8048c789fa5e851558d709946d6d79a8ff88c0440c587967f8e94bfb1216a" dependencies = [ "phf_generator", "phf_shared", +======= +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1562dc717473dbaa4c1f85a36410e03c047b2e7df7f45ee938fbef64ae7fadf" +dependencies = [ + "phf_macros", + "phf_shared", + "serde", +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 ] [[package]] name = "phf_generator" +<<<<<<< HEAD version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d" dependencies = [ "phf_shared", "rand", +======= +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "135ace3a761e564ec88c03a77317a7c6b80bb7f7135ef2544dbe054243b89737" +dependencies = [ + "fastrand", + "phf_shared", +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 ] [[package]] name = "phf_macros" +<<<<<<< HEAD version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f84ac04429c13a7ff43785d75ad27569f2951ce0ffd30a3321230db2fc727216" +======= +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "812f032b54b1e759ccd5f8b6677695d5268c588701effba24601f6932f8269ef" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 dependencies = [ "phf_generator", "phf_shared", @@ -1818,9 +2483,15 @@ dependencies = [ [[package]] name = "phf_shared" +<<<<<<< HEAD version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5" +======= +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e57fef6bc5981e38c2ce2d63bfa546861309f875b8a75f092d1d54ae2d64f266" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 dependencies = [ "siphasher", ] @@ -1833,18 +2504,30 @@ checksum = "5be167a7af36ee22fe3115051bc51f6e6c7054c9348e28deb4f49bd6f705a315" [[package]] name = "pixglyph" +<<<<<<< HEAD version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d15afa937836bf3d876f5a04ce28810c06045857bf46c3d0d31073b8aada5494" +======= +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c1106193bc18a4b840eb075ff6664c8a0b0270f0531bb12a7e9c803e53b55c5" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 dependencies = [ "ttf-parser", ] [[package]] name = "pkg-config" +<<<<<<< HEAD version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" +======= +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 [[package]] name = "plist" @@ -1853,7 +2536,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42cf17e9a1800f5f396bc67d193dc9411b59012a5876445ef450d449881e1016" dependencies = [ "base64", +<<<<<<< HEAD "indexmap 2.8.0", +======= + "indexmap 2.7.1", +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 "quick-xml 0.32.0", "serde", "time", @@ -1874,9 +2561,15 @@ dependencies = [ [[package]] name = "portable-atomic" +<<<<<<< HEAD version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "350e9b48cbc6b0e028b0473b114454c6316e57336ee184ceab6e53f72c178b3e" +======= +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "280dc24453071f1b63954171985a0b0d30058d287960968b9b2aca264c8d4ee6" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 [[package]] name = "postcard" @@ -1898,27 +2591,52 @@ checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" [[package]] name = "ppv-lite86" +<<<<<<< HEAD version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +======= +version = "0.2.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 dependencies = [ "zerocopy", ] [[package]] +<<<<<<< HEAD name = "proc-macro2" version = "1.0.94" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a31971752e70b8b2686d7e46ec17fb38dad4051d94024c88df49b667caea9c84" +======= +name = "proc-macro-hack" +version = "0.5.20+deprecated" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" + +[[package]] +name = "proc-macro2" +version = "1.0.101" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89ae43fd86e4158d6db51ad8e2b80f313af9cc74f5c0e03ccb87de09998732de" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 dependencies = [ "unicode-ident", ] [[package]] name = "psm" +<<<<<<< HEAD version = "0.1.25" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f58e5423e24c18cc840e1c98370b3993c6649cd1678b4d24318bcf0a083cbe88" +======= +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "200b9ff220857e53e184257720a14553b2f4aa02577d2ed9842d45d4b9654810" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 dependencies = [ "cc", ] @@ -1929,13 +2647,29 @@ version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57206b407293d2bcd3af849ce869d52068623f19e1b5ff8e8778e3309439682b" dependencies = [ +<<<<<<< HEAD "bitflags 2.9.0", +======= + "bitflags 2.9.1", +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 "getopts", "memchr", "unicase", ] [[package]] +<<<<<<< HEAD +======= +name = "pxfm" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83f9b339b02259ada5c0f4a389b7fb472f933aa17ce176fd2ad98f28bb401fde" +dependencies = [ + "num-traits", +] + +[[package]] +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 name = "qcms" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1958,9 +2692,15 @@ dependencies = [ [[package]] name = "quick-xml" +<<<<<<< HEAD version = "0.36.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f7649a7b4df05aed9ea7ec6f628c67c9953a43869b8bc50929569b2999d443fe" +======= +version = "0.38.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42a232e7487fc2ef313d96dde7948e7a3c05101870d8985e4fd8d26aedd27b89" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 dependencies = [ "memchr", "serde", @@ -1968,20 +2708,29 @@ dependencies = [ [[package]] name = "quote" +<<<<<<< HEAD version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" +======= +version = "1.0.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 dependencies = [ "proc-macro2", ] [[package]] +<<<<<<< HEAD name = "r-efi" version = "5.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "74765f6d916ee2faa39bc8e68e4f3ed8949b48cccdac59983d287a7cb71ce9c5" [[package]] +======= +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 name = "radium" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1993,8 +2742,11 @@ version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ +<<<<<<< HEAD "libc", "rand_chacha", +======= +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 "rand_core", ] @@ -2013,9 +2765,12 @@ name = "rand_core" version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +<<<<<<< HEAD dependencies = [ "getrandom 0.2.15", ] +======= +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 [[package]] name = "rayon" @@ -2038,12 +2793,31 @@ dependencies = [ ] [[package]] +<<<<<<< HEAD name = "redox_syscall" version = "0.5.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b8c0c260b63a8219631167be35e6a988e9554dbd323f8bd08439c8ed1302bd1" dependencies = [ "bitflags 2.9.0", +======= +name = "read-fonts" +version = "0.35.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6717cf23b488adf64b9d711329542ba34de147df262370221940dfabc2c91358" +dependencies = [ + "bytemuck", + "font-types", +] + +[[package]] +name = "redox_syscall" +version = "0.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834" +dependencies = [ + "bitflags 2.9.1", +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 ] [[package]] @@ -2054,7 +2828,11 @@ checksum = "dd6f9d3d47bdd2ad6945c5015a226ec6155d0bcdfd8f7cd29f86b71f8de99d2b" dependencies = [ "getrandom 0.2.15", "libredox", +<<<<<<< HEAD "thiserror 2.0.12", +======= + "thiserror", +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 ] [[package]] @@ -2088,9 +2866,15 @@ checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "resvg" +<<<<<<< HEAD version = "0.43.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c7314563c59c7ce31c18e23ad3dd092c37b928a0fa4e1c0a1a6504351ab411d1" +======= +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd43d1c474e9dadf09a8fdf22d713ba668b499b5117b9b9079500224e26b5b29" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 dependencies = [ "gif", "image-webp", @@ -2119,6 +2903,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "88f8660c1ff60292143c98d08fc6e2f654d722db50410e3f3797d40baaf9d8f3" [[package]] +<<<<<<< HEAD +======= +name = "roman-numerals-rs" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c85cd47a33a4510b1424fe796498e174c6a9cf94e606460ef022a19f3e4ff85e" + +[[package]] +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 name = "roxmltree" version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -2126,9 +2919,15 @@ checksum = "6c20b6793b5c2fa6553b250154b78d6d0db37e72700ae35fad9387a46f487c97" [[package]] name = "rust_decimal" +<<<<<<< HEAD version = "1.37.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "faa7de2ba56ac291bd90c6b9bece784a52ae1411f9506544b3eae36dd2356d50" +======= +version = "1.36.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b082d80e3e3cc52b2ed634388d436fe1f4de6af5786cc2de9ba9737527bdf555" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 dependencies = [ "arrayvec", "num-traits", @@ -2142,11 +2941,19 @@ checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" [[package]] name = "rustix" +<<<<<<< HEAD version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e56a18552996ac8d29ecc3b190b4fdbb2d91ca4ec396de7bbffaf43f3d637e96" dependencies = [ "bitflags 2.9.0", +======= +version = "0.38.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" +dependencies = [ + "bitflags 2.9.1", +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 "errno", "libc", "linux-raw-sys", @@ -2155,6 +2962,7 @@ dependencies = [ [[package]] name = "rustversion" +<<<<<<< HEAD version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eded382c5f5f786b989652c49544c4877d9f015cc22e145a5ea8ea66c2921cd2" @@ -2166,6 +2974,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c85d1ccd519e61834798eb52c4e886e8c2d7d698dd3d6ce0b1b47eb8557f1181" dependencies = [ "bitflags 2.9.0", +======= +version = "1.0.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7c45b9784283f1b2e7fb61b42047c2fd678ef0960d4f6f1eba131594cc369d4" + +[[package]] +name = "rustybuzz" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd3c7c96f8a08ee34eff8857b11b49b07d71d1c3f4e88f8a88d4c9e9f90b1702" +dependencies = [ + "bitflags 2.9.1", +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 "bytemuck", "core_maths", "log", @@ -2179,9 +3000,15 @@ dependencies = [ [[package]] name = "ryu" +<<<<<<< HEAD version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" +======= +version = "1.0.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ea1a2d0a644769cc99faa24c3ad26b379b786fe7c36fd3c546254801650e6dd" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 [[package]] name = "same-file" @@ -2213,7 +3040,11 @@ version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ +<<<<<<< HEAD "bitflags 2.9.0", +======= + "bitflags 2.9.1", +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 "core-foundation", "core-foundation-sys", "libc", @@ -2243,6 +3074,7 @@ dependencies = [ [[package]] name = "semver" +<<<<<<< HEAD version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0" @@ -2252,15 +3084,32 @@ name = "serde" version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" +======= +version = "1.0.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f79dfe2d285b0488816f30e700a7438c5a73d816b5b7d3ac72fbc48b0d185e03" + +[[package]] +name = "serde" +version = "1.0.217" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" +<<<<<<< HEAD version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" +======= +version = "1.0.217" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 dependencies = [ "proc-macro2", "quote", @@ -2269,9 +3118,15 @@ dependencies = [ [[package]] name = "serde_json" +<<<<<<< HEAD version = "1.0.140" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" +======= +version = "1.0.138" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d434192e7da787e94a6ea7e9670b26a036d0ca41e0b7efb2676dd32bae872949" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 dependencies = [ "itoa", "memchr", @@ -2306,7 +3161,11 @@ version = "0.9.34+deprecated" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" dependencies = [ +<<<<<<< HEAD "indexmap 2.8.0", +======= + "indexmap 2.7.1", +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 "itoa", "ryu", "serde", @@ -2356,6 +3215,25 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" [[package]] +<<<<<<< HEAD +======= +name = "skrifa" +version = "0.37.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c31071dedf532758ecf3fed987cdb4bd9509f900e026ab684b4ecb81ea49841" +dependencies = [ + "bytemuck", + "read-fonts", +] + +[[package]] +name = "slab" +version = "0.4.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a2ae44ef20feb57a68b23d846850f861394c2e02dc425a50098ae8c90267589" + +[[package]] +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 name = "slotmap" version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -2366,9 +3244,15 @@ dependencies = [ [[package]] name = "smallvec" +<<<<<<< HEAD version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7fcf8323ef1faaee30a44a340193b1ac6814fd9b7b4e88e9d4519a3e4abe1cfd" +======= +version = "1.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 [[package]] name = "spin" @@ -2384,9 +3268,15 @@ checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" [[package]] name = "stacker" +<<<<<<< HEAD version = "0.1.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "601f9201feb9b09c00266478bf459952b9ef9a6b94edb2f21eba14ab681a60a9" +======= +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cddb07e32ddb770749da91081d8d0ac3a16f1a569a18b20348cd371f5dead06b" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 dependencies = [ "cc", "cfg-if", @@ -2401,6 +3291,7 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6637bab7722d379c8b41ba849228d680cc12d0a45ba1fa2b48f2a30577a06731" dependencies = [ +<<<<<<< HEAD "float-cmp", ] @@ -2412,6 +3303,9 @@ checksum = "1a3275464d7a9f2d4cac57c89c2ef96a8524dba2864c8d6f82e3980baf136f9b" dependencies = [ "hashbrown 0.15.2", "serde", +======= + "float-cmp 0.9.0", +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 ] [[package]] @@ -2422,28 +3316,44 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "strum" +<<<<<<< HEAD version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" +======= +version = "0.27.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af23d6f6c1a224baef9d3f61e287d2761385a5b88fdab4eb4c6f11aeb54c4bcf" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 dependencies = [ "strum_macros", ] [[package]] name = "strum_macros" +<<<<<<< HEAD version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" +======= +version = "0.27.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7695ce3845ea4b33927c055a39dc438a45b059f7c1b3d91d38d10355fb8cbca7" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 dependencies = [ "heck", "proc-macro2", "quote", +<<<<<<< HEAD "rustversion", +======= +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 "syn", ] [[package]] name = "subsetter" +<<<<<<< HEAD version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "74f98178f34057d4d4de93d68104007c6dea4dfac930204a69ab4622daefa648" @@ -2466,6 +3376,16 @@ dependencies = [ "tiny-skia", "ttf-parser", "usvg", +======= +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb6895a12ac5599bb6057362f00e8a3cf1daab4df33f553a55690a44e4fed8d0" +dependencies = [ + "kurbo 0.12.0", + "rustc-hash", + "skrifa", + "write-fonts", +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 ] [[package]] @@ -2474,15 +3394,25 @@ version = "0.15.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68c7541fff44b35860c1a7a47a7cadf3e4a304c457b58f9870d9706ece028afc" dependencies = [ +<<<<<<< HEAD "kurbo", +======= + "kurbo 0.11.2", +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 "siphasher", ] [[package]] name = "syn" +<<<<<<< HEAD version = "2.0.100" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b09a44accad81e1ba1cd74a32461ba89dee89095ba17b32f5d03683b1b1fc2a0" +======= +version = "2.0.98" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36147f1a48ae0ec2b5b3bc5b537d267457555a10dc06f3dbc8cb11ba3006d3b1" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 dependencies = [ "proc-macro2", "quote", @@ -2502,12 +3432,20 @@ dependencies = [ [[package]] name = "syntect" +<<<<<<< HEAD version = "5.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "874dcfa363995604333cf947ae9f751ca3af4522c60886774c4963943b4746b1" dependencies = [ "bincode", "bitflags 1.3.2", +======= +version = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "656b45c05d95a5704399aeef6bd0ddec7b2b3531b7c9e900abbf7c4d2190c925" +dependencies = [ + "bincode", +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 "fancy-regex", "flate2", "fnv", @@ -2517,7 +3455,11 @@ dependencies = [ "serde", "serde_derive", "serde_json", +<<<<<<< HEAD "thiserror 1.0.69", +======= + "thiserror", +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 "walkdir", "yaml-rust", ] @@ -2530,9 +3472,15 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tar" +<<<<<<< HEAD version = "0.4.44" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1d863878d212c87a19c1a610eb53bb01fe12951c0501cf5a0d65f724914a667a" +======= +version = "0.4.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c65998313f8e17d0d553d28f91a0df93e4dbbbf770279c7bc21ca0f09ea1a1f6" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 dependencies = [ "filetime", "libc", @@ -2541,12 +3489,22 @@ dependencies = [ [[package]] name = "tempfile" +<<<<<<< HEAD version = "3.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7437ac7763b9b123ccf33c338a5cc1bac6f69b45a136c19bdd8a65e3916435bf" dependencies = [ "fastrand", "getrandom 0.3.2", +======= +version = "3.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38c246215d7d24f48ae091a2902398798e05d978b24315d6efbc00ede9a8bb91" +dependencies = [ + "cfg-if", + "fastrand", + "getrandom 0.3.1", +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 "once_cell", "rustix", "windows-sys 0.59.0", @@ -2563,9 +3521,15 @@ dependencies = [ [[package]] name = "terminal_size" +<<<<<<< HEAD version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "45c6481c4829e4cc63825e62c49186a34538b7b2750b73b266581ffb612fb5ed" +======= +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5352447f921fda68cf61b4101566c0bdb5104eff6804d0678e5227580ab6a4e9" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 dependencies = [ "rustix", "windows-sys 0.59.0", @@ -2579,6 +3543,7 @@ checksum = "a38c90d48152c236a3ab59271da4f4ae63d678c5d7ad6b7714d7cb9760be5e4b" [[package]] name = "thiserror" +<<<<<<< HEAD version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" @@ -2593,10 +3558,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708" dependencies = [ "thiserror-impl 2.0.12", +======= +version = "2.0.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3467d614147380f2e4e374161426ff399c91084acd2363eaf549172b3d5e60c0" +dependencies = [ + "thiserror-impl", +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 ] [[package]] name = "thiserror-impl" +<<<<<<< HEAD version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" @@ -2611,6 +3584,11 @@ name = "thiserror-impl" version = "2.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" +======= +version = "2.0.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c5e1be1c48b9172ee610da68fd9cd2770e7a4056cb3fc98710ee6906f0c7960" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 dependencies = [ "proc-macro2", "quote", @@ -2619,9 +3597,15 @@ dependencies = [ [[package]] name = "time" +<<<<<<< HEAD version = "0.3.40" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d9c75b47bdff86fa3334a3db91356b8d7d86a9b839dab7d0bdc5c3d3a077618" +======= +version = "0.3.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35e7868883861bd0e56d9ac6efcaaca0d6d5d82a2a7ec8209ff492c07cf37b21" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 dependencies = [ "deranged", "itoa", @@ -2634,6 +3618,7 @@ dependencies = [ [[package]] name = "time-core" +<<<<<<< HEAD version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c9e9a38711f559d9e3ce1cdb06dd7c5b8ea546bc90052da6d06bb76da74bb07c" @@ -2643,6 +3628,17 @@ name = "time-macros" version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "29aa485584182073ed57fd5004aa09c371f021325014694e432313345865fd04" +======= +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" + +[[package]] +name = "time-macros" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2834e6017e3e5e4b9834939793b282bc03b37a3336245fa820e35e233e2a85de" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 dependencies = [ "num-conv", "time-core", @@ -2694,14 +3690,34 @@ checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" dependencies = [ "displaydoc", "serde", +<<<<<<< HEAD "zerovec", +======= + "zerovec 0.10.4", +] + +[[package]] +name = "tinystr" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d4f6d1145dcb577acf783d4e601bc1d76a13337bb54e6233add580b07344c8b" +dependencies = [ + "displaydoc", + "zerovec 0.11.4", +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 ] [[package]] name = "tinyvec" +<<<<<<< HEAD version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09b3661f17e86524eccd4371ab0429194e0d7c008abb45f7a7495b1719463c71" +======= +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "022db8904dfa342efe721985167e9fcd16c29b226db4397ed752a761cfce81e8" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 dependencies = [ "tinyvec_macros", ] @@ -2714,9 +3730,15 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "toml" +<<<<<<< HEAD version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cd87a5cdd6ffab733b2f74bc4fd7ee5fff6634124999ac278c35fc78c6120148" +======= +version = "0.8.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 dependencies = [ "serde", "serde_spanned", @@ -2735,11 +3757,19 @@ dependencies = [ [[package]] name = "toml_edit" +<<<<<<< HEAD version = "0.22.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "17b4795ff5edd201c7cd6dca065ae59972ce77d1b80fa0a84d94950ece7d1474" dependencies = [ "indexmap 2.8.0", +======= +version = "0.22.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02a8b472d1a3d7c18e2d61a489aee3453fd9031c33e4f55bd533f4a7adca1bee" +dependencies = [ + "indexmap 2.7.1", +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 "serde", "serde_spanned", "toml_datetime", @@ -2748,9 +3778,15 @@ dependencies = [ [[package]] name = "ttf-parser" +<<<<<<< HEAD version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5be21190ff5d38e8b4a2d3b6a3ae57f612cc39c96e83cedeaf7abc338a8bac4a" +======= +version = "0.25.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2df906b07856748fa3f6e0ad0cbaa047052d4a7dd609e231c4f72cee8c36f31" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 dependencies = [ "core_maths", ] @@ -2774,10 +3810,18 @@ checksum = "6af6ae20167a9ece4bcb41af5b80f8a1f1df981f6391189ce00fd257af04126a" [[package]] name = "typst" +<<<<<<< HEAD version = "0.13.1" dependencies = [ "comemo", "ecow", +======= +version = "0.14.0" +dependencies = [ + "comemo", + "ecow", + "rustc-hash", +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 "typst-eval", "typst-html", "typst-layout", @@ -2791,6 +3835,7 @@ dependencies = [ [[package]] name = "typst-assets" +<<<<<<< HEAD version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5bf0cc3c2265502b51fcb73147cc7c951ceb694507195b93c2ab0b901abb902" @@ -2798,6 +3843,15 @@ checksum = "b5bf0cc3c2265502b51fcb73147cc7c951ceb694507195b93c2ab0b901abb902" [[package]] name = "typst-cli" version = "0.13.1" +======= +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712f5e2c4134bcf22f292086aa515caff00a21d54c8b30c77c4fc1227442a89a" + +[[package]] +name = "typst-cli" +version = "0.14.0" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 dependencies = [ "chrono", "clap", @@ -2814,6 +3868,10 @@ dependencies = [ "parking_lot", "pathdiff", "rayon", +<<<<<<< HEAD +======= + "rustc-hash", +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 "same-file", "self-replace", "semver", @@ -2842,6 +3900,7 @@ dependencies = [ [[package]] name = "typst-dev-assets" +<<<<<<< HEAD version = "0.13.1" source = "git+https://github.com/typst/typst-dev-assets?tag=v0.13.1#9879589f4b3247b12c5e694d0d7fa86d4d8a198e" @@ -2855,6 +3914,22 @@ dependencies = [ "include_dir", "md5", "pulldown-cmark", +======= +version = "0.14.0" +source = "git+https://github.com/typst/typst-dev-assets?tag=v0.14.0#0b12d75772199e07294749ffe078ea030b857746" + +[[package]] +name = "typst-docs" +version = "0.14.0" +dependencies = [ + "clap", + "codex", + "ecow", + "heck", + "pulldown-cmark", + "regex", + "rustc-hash", +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 "serde", "serde_json", "serde_yaml 0.9.34+deprecated", @@ -2866,19 +3941,31 @@ dependencies = [ "typst-render", "typst-utils", "unicode-math-class", +<<<<<<< HEAD "unicode_names2", +======= +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 "unscanny", "yaml-front-matter", ] [[package]] name = "typst-eval" +<<<<<<< HEAD version = "0.13.1" dependencies = [ "comemo", "ecow", "if_chain", "indexmap 2.8.0", +======= +version = "0.14.0" +dependencies = [ + "comemo", + "ecow", + "indexmap 2.7.1", + "rustc-hash", +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 "stacker", "toml", "typst-library", @@ -2891,7 +3978,11 @@ dependencies = [ [[package]] name = "typst-fuzz" +<<<<<<< HEAD version = "0.13.1" +======= +version = "0.14.0" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 dependencies = [ "comemo", "libfuzzer-sys", @@ -2903,10 +3994,22 @@ dependencies = [ [[package]] name = "typst-html" +<<<<<<< HEAD version = "0.13.1" dependencies = [ "comemo", "ecow", +======= +version = "0.14.0" +dependencies = [ + "bumpalo", + "comemo", + "ecow", + "palette", + "rustc-hash", + "time", + "typst-assets", +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 "typst-library", "typst-macros", "typst-svg", @@ -2917,6 +4020,7 @@ dependencies = [ [[package]] name = "typst-ide" +<<<<<<< HEAD version = "0.13.1" dependencies = [ "comemo", @@ -2924,6 +4028,15 @@ dependencies = [ "if_chain", "once_cell", "pathdiff", +======= +version = "0.14.0" +dependencies = [ + "comemo", + "ecow", + "once_cell", + "pathdiff", + "rustc-hash", +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 "serde", "typst", "typst-assets", @@ -2934,11 +4047,19 @@ dependencies = [ [[package]] name = "typst-kit" +<<<<<<< HEAD version = "0.13.1" +======= +version = "0.14.0" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 dependencies = [ "dirs", "ecow", "env_proxy", +<<<<<<< HEAD +======= + "fastrand", +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 "flate2", "fontdb", "native-tls", @@ -2957,19 +4078,36 @@ dependencies = [ [[package]] name = "typst-layout" +<<<<<<< HEAD version = "0.13.1" dependencies = [ "az", "bumpalo", "comemo", "ecow", +======= +version = "0.14.0" +dependencies = [ + "az", + "bumpalo", + "codex", + "comemo", + "ecow", + "either", +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 "hypher", "icu_properties", "icu_provider", "icu_provider_adapters", "icu_provider_blob", "icu_segmenter", +<<<<<<< HEAD "kurbo", +======= + "kurbo 0.12.0", + "memchr", + "rustc-hash", +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 "rustybuzz", "smallvec", "ttf-parser", @@ -2987,10 +4125,17 @@ dependencies = [ [[package]] name = "typst-library" +<<<<<<< HEAD version = "0.13.1" dependencies = [ "az", "bitflags 2.9.0", +======= +version = "0.14.0" +dependencies = [ + "az", + "bitflags 2.9.1", +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 "bumpalo", "chinese-number", "ciborium", @@ -3000,14 +4145,26 @@ dependencies = [ "ecow", "flate2", "fontdb", +<<<<<<< HEAD + "hayagriva", +======= + "glidesort", "hayagriva", + "hayro-syntax", +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 "icu_properties", "icu_provider", "icu_provider_blob", "image", +<<<<<<< HEAD "indexmap 2.8.0", "kamadak-exif", "kurbo", +======= + "indexmap 2.7.1", + "kamadak-exif", + "kurbo 0.12.0", +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 "lipsum", "memchr", "palette", @@ -3019,6 +4176,10 @@ dependencies = [ "regex-syntax", "roxmltree", "rust_decimal", +<<<<<<< HEAD +======= + "rustc-hash", +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 "rustybuzz", "serde", "serde_json", @@ -3038,16 +4199,28 @@ dependencies = [ "typst-timing", "typst-utils", "unicode-math-class", +<<<<<<< HEAD + "unicode-segmentation", + "unscanny", + "usvg", +======= + "unicode-normalization", "unicode-segmentation", "unscanny", "usvg", + "utf8_iter", +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 "wasmi", "xmlwriter", ] [[package]] name = "typst-macros" +<<<<<<< HEAD version = "0.13.1" +======= +version = "0.14.0" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 dependencies = [ "heck", "proc-macro2", @@ -3057,14 +4230,21 @@ dependencies = [ [[package]] name = "typst-pdf" +<<<<<<< HEAD version = "0.13.1" dependencies = [ "arrayvec", "base64", +======= +version = "0.14.0" +dependencies = [ + "az", +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 "bytemuck", "comemo", "ecow", "image", +<<<<<<< HEAD "indexmap 2.8.0", "miniz_oxide", "pdf-writer", @@ -3072,18 +4252,34 @@ dependencies = [ "subsetter", "svg2pdf", "ttf-parser", +======= + "indexmap 2.7.1", + "infer", + "krilla", + "krilla-svg", + "rustc-hash", + "serde", + "smallvec", +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 "typst-assets", "typst-library", "typst-macros", "typst-syntax", "typst-timing", "typst-utils", +<<<<<<< HEAD "xmp-writer", +======= +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 ] [[package]] name = "typst-realize" +<<<<<<< HEAD version = "0.13.1" +======= +version = "0.14.0" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 dependencies = [ "arrayvec", "bumpalo", @@ -3099,15 +4295,27 @@ dependencies = [ [[package]] name = "typst-render" +<<<<<<< HEAD version = "0.13.1" dependencies = [ "bytemuck", "comemo", +======= +version = "0.14.0" +dependencies = [ + "bytemuck", + "comemo", + "hayro", +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 "image", "pixglyph", "resvg", "tiny-skia", "ttf-parser", +<<<<<<< HEAD +======= + "typst-assets", +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 "typst-library", "typst-macros", "typst-timing", @@ -3115,14 +4323,27 @@ dependencies = [ [[package]] name = "typst-svg" +<<<<<<< HEAD version = "0.13.1" +======= +version = "0.14.0" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 dependencies = [ "base64", "comemo", "ecow", "flate2", +<<<<<<< HEAD "image", "ttf-parser", +======= + "hayro", + "hayro-svg", + "image", + "rustc-hash", + "ttf-parser", + "typst-assets", +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 "typst-library", "typst-macros", "typst-timing", @@ -3133,9 +4354,16 @@ dependencies = [ [[package]] name = "typst-syntax" +<<<<<<< HEAD version = "0.13.1" dependencies = [ "ecow", +======= +version = "0.14.0" +dependencies = [ + "ecow", + "rustc-hash", +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 "serde", "toml", "typst-timing", @@ -3149,8 +4377,14 @@ dependencies = [ [[package]] name = "typst-tests" +<<<<<<< HEAD version = "0.13.1" dependencies = [ +======= +version = "0.14.0" +dependencies = [ + "bitflags 2.9.1", +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 "clap", "comemo", "ecow", @@ -3158,6 +4392,10 @@ dependencies = [ "parking_lot", "rayon", "regex", +<<<<<<< HEAD +======= + "rustc-hash", +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 "tiny-skia", "typst", "typst-assets", @@ -3174,7 +4412,11 @@ dependencies = [ [[package]] name = "typst-timing" +<<<<<<< HEAD version = "0.13.1" +======= +version = "0.14.0" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 dependencies = [ "parking_lot", "serde", @@ -3184,11 +4426,19 @@ dependencies = [ [[package]] name = "typst-utils" +<<<<<<< HEAD version = "0.13.1" +======= +version = "0.14.0" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 dependencies = [ "once_cell", "portable-atomic", "rayon", +<<<<<<< HEAD +======= + "rustc-hash", +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 "siphasher", "thin-vec", "unicode-math-class", @@ -3196,21 +4446,63 @@ dependencies = [ [[package]] name = "unic-langid" +<<<<<<< HEAD version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "23dd9d1e72a73b25e07123a80776aae3e7b0ec461ef94f9151eed6ec88005a44" dependencies = [ "unic-langid-impl", +======= +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a28ba52c9b05311f4f6e62d5d9d46f094bd6e84cb8df7b3ef952748d752a7d05" +dependencies = [ + "unic-langid-impl", + "unic-langid-macros", +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 ] [[package]] name = "unic-langid-impl" +<<<<<<< HEAD version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0a5422c1f65949306c99240b81de9f3f15929f5a8bfe05bb44b034cc8bf593e5" dependencies = [ "serde", "tinystr", +======= +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dce1bf08044d4b7a94028c93786f8566047edc11110595914de93362559bc658" +dependencies = [ + "serde", + "tinystr 0.8.1", +] + +[[package]] +name = "unic-langid-macros" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5957eb82e346d7add14182a3315a7e298f04e1ba4baac36f7f0dbfedba5fc25" +dependencies = [ + "proc-macro-hack", + "tinystr 0.8.1", + "unic-langid-impl", + "unic-langid-macros-impl", +] + +[[package]] +name = "unic-langid-macros-impl" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1249a628de3ad34b821ecb1001355bca3940bcb2f88558f1a8bd82e977f75b5" +dependencies = [ + "proc-macro-hack", + "quote", + "syn", + "unic-langid-impl", +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 ] [[package]] @@ -3227,6 +4519,7 @@ checksum = "5c1cb5db39152898a79168971543b1cb5020dff7fe43c8dc468b0885f5e29df5" [[package]] name = "unicode-bidi-mirroring" +<<<<<<< HEAD version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "64af057ad7466495ca113126be61838d8af947f41d93a949980b2389a118082f" @@ -3242,6 +4535,23 @@ name = "unicode-ident" version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" +======= +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dfa6e8c60bb66d49db113e0125ee8711b7647b5579dc7f5f19c42357ed039fe" + +[[package]] +name = "unicode-ccc" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce61d488bcdc9bc8b5d1772c404828b17fc481c0a582b5581e95fb233aef503e" + +[[package]] +name = "unicode-ident" +version = "1.0.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a210d160f08b701c8721ba1c726c11662f877ea6b7094007e1ca9a1041945034" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 [[package]] name = "unicode-math-class" @@ -3289,6 +4599,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" [[package]] +<<<<<<< HEAD name = "unicode_names2" version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -3311,6 +4622,8 @@ dependencies = [ ] [[package]] +======= +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 name = "unsafe-libyaml" version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -3352,16 +4665,27 @@ dependencies = [ [[package]] name = "usvg" +<<<<<<< HEAD version = "0.43.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6803057b5cbb426e9fb8ce2216f3a9b4ca1dd2c705ba3cbebc13006e437735fd" +======= +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ac8e0e3e4696253dc06167990b3fe9a2668ab66270adf949a464db4088cb354" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 dependencies = [ "base64", "data-url", "flate2", "fontdb", +<<<<<<< HEAD "imagesize", "kurbo", +======= + "imagesize 0.13.0", + "kurbo 0.11.2", +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 "log", "pico-args", "roxmltree", @@ -3425,9 +4749,15 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasi" +<<<<<<< HEAD version = "0.14.2+wasi-0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9683f9a5a998d873c0d21fcbe3c083009670149a8fab228644b8bd36b2c48cb3" +======= +version = "0.13.3+wasi-0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26816d2e1a4a36a2940b96c5296ce403917633dff8f3440e9b236ed6f6bacad2" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 dependencies = [ "wit-bindgen-rt", ] @@ -3492,6 +4822,7 @@ dependencies = [ [[package]] name = "wasmi" +<<<<<<< HEAD version = "0.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a19af97fcb96045dd1d6b4d23e2b4abdbbe81723dbc5c9f016eb52145b320063" @@ -3499,6 +4830,12 @@ dependencies = [ "arrayvec", "multi-stash", "smallvec", +======= +version = "0.51.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb4f6b71d5cb04a4615b9a8a2e522ba284c491ad847afd9e905d89be15e3efc0" +dependencies = [ +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 "spin", "wasmi_collections", "wasmi_core", @@ -3508,6 +4845,7 @@ dependencies = [ [[package]] name = "wasmi_collections" +<<<<<<< HEAD version = "0.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e80d6b275b1c922021939d561574bf376613493ae2b61c6963b15db0e8813562" @@ -3522,26 +4860,52 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3a8c51482cc32d31c2c7ff211cd2bedd73c5bd057ba16a2ed0110e7a96097c33" dependencies = [ "downcast-rs", +======= +version = "0.51.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a4a11fa090c4d742e5a77dbbc8efbbe1aa151db7335ca6850232e6cafbb1023" + +[[package]] +name = "wasmi_core" +version = "0.51.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab3e422fc1f4df78c9ded6ed48c4ca6d1f55f4609f04c99962fc07532e4db61d" +dependencies = [ +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 "libm", ] [[package]] name = "wasmi_ir" +<<<<<<< HEAD version = "0.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e431a14c186db59212a88516788bd68ed51f87aa1e08d1df742522867b5289a" +======= +version = "0.51.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13fe9f9f1747ec81644e764c4dc798f063f5d54a495f0a3b4a375bce9af65399" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 dependencies = [ "wasmi_core", ] [[package]] name = "wasmparser" +<<<<<<< HEAD version = "0.221.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d06bfa36ab3ac2be0dee563380147a5b81ba10dd8885d7fbbc9eb574be67d185" dependencies = [ "bitflags 2.9.0", "indexmap 2.8.0", +======= +version = "0.228.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4abf1132c1fdf747d56bbc1bb52152400c70f336870f968b85e89ea422198ae3" +dependencies = [ + "bitflags 2.9.1", +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 ] [[package]] @@ -3579,12 +4943,15 @@ dependencies = [ ] [[package]] +<<<<<<< HEAD name = "windows-link" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "76840935b766e1b0a05c0066835fb9ec80071d4c09a16f6bd5f7e655e3c14c38" [[package]] +======= +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 name = "windows-sys" version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -3668,20 +5035,47 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" +<<<<<<< HEAD version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0e97b544156e9bebe1a0ffbc03484fc1ffe3100cbce3ffb17eac35f7cdd7ab36" +======= +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86e376c75f4f43f44db463cf729e0d3acbf954d13e22c51e26e4c264b4ab545f" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 dependencies = [ "memchr", ] [[package]] name = "wit-bindgen-rt" +<<<<<<< HEAD version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1" dependencies = [ "bitflags 2.9.0", +======= +version = "0.33.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3268f3d866458b787f390cf61f4bbb563b922d091359f9608842999eaee3943c" +dependencies = [ + "bitflags 2.9.1", +] + +[[package]] +name = "write-fonts" +version = "0.43.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "886614b5ce857341226aa091f3c285e450683894acaaa7887f366c361efef79d" +dependencies = [ + "font-types", + "indexmap 2.7.1", + "kurbo 0.12.0", + "log", + "read-fonts", +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 ] [[package]] @@ -3707,11 +5101,20 @@ dependencies = [ [[package]] name = "xattr" +<<<<<<< HEAD version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0d65cbf2f12c15564212d48f4e3dfb87923d25d611f2aed18f4cb23f0413d89e" dependencies = [ "libc", +======= +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e105d177a3871454f754b33bb0ee637ecaaac997446375fd3e5d43a2ed00c909" +dependencies = [ + "libc", + "linux-raw-sys", +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 "rustix", ] @@ -3729,9 +5132,15 @@ checksum = "ec7a2a501ed189703dba8b08142f057e887dfc4b2cc4db2d343ac6376ba3e0b9" [[package]] name = "xmp-writer" +<<<<<<< HEAD version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7eb5954c9ca6dcc869e98d3e42760ed9dab08f3e70212b31d7ab8ae7f3b7a487" +======= +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce9e2f4a404d9ebffc0a9832cf4f50907220ba3d7fffa9099261a5cab52f2dd7" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 [[package]] name = "xz2" @@ -3769,7 +5178,23 @@ checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" dependencies = [ "serde", "stable_deref_trait", +<<<<<<< HEAD "yoke-derive", +======= + "yoke-derive 0.7.5", + "zerofrom", +] + +[[package]] +name = "yoke" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f41bb01b8226ef4bfd589436a297c53d118f65921786300e427be8d487695cc" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive 0.8.0", +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 "zerofrom", ] @@ -3786,19 +5211,46 @@ dependencies = [ ] [[package]] +<<<<<<< HEAD name = "zerocopy" version = "0.8.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2586fea28e186957ef732a5f8b3be2da217d65c5969d4b1e17f973ebbe876879" dependencies = [ +======= +name = "yoke-derive" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38da3c9736e16c5d3c8c597a9aaa5d1fa565d0532ae05e27c24aa62fb32c0ab6" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "zerocopy" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" +dependencies = [ + "byteorder", +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 "zerocopy-derive", ] [[package]] name = "zerocopy-derive" +<<<<<<< HEAD version = "0.8.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a996a8f63c5c4448cd959ac1bab0aaa3306ccfd060472f85943ee0750f0169be" +======= +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 dependencies = [ "proc-macro2", "quote", @@ -3807,18 +5259,30 @@ dependencies = [ [[package]] name = "zerofrom" +<<<<<<< HEAD version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" +======= +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 dependencies = [ "zerofrom-derive", ] [[package]] name = "zerofrom-derive" +<<<<<<< HEAD version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" +======= +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 dependencies = [ "proc-macro2", "quote", @@ -3835,7 +5299,11 @@ dependencies = [ "displaydoc", "litemap", "serde", +<<<<<<< HEAD "zerovec", +======= + "zerovec 0.10.4", +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 ] [[package]] @@ -3845,12 +5313,28 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" dependencies = [ "serde", +<<<<<<< HEAD "yoke", +======= + "yoke 0.7.5", +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 "zerofrom", "zerovec-derive", ] [[package]] +<<<<<<< HEAD +======= +name = "zerovec" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7aa2bd55086f1ab526693ecbe444205da57e25f4489879da80635a46d90e73b" +dependencies = [ + "zerofrom", +] + +[[package]] +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 name = "zerovec-derive" version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -3863,6 +5347,7 @@ dependencies = [ [[package]] name = "zip" +<<<<<<< HEAD version = "2.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fabe6324e908f85a1c52063ce7aa26b68dcb7eb6dbc83a2d148403c9bc3eba50" @@ -3875,10 +5360,30 @@ dependencies = [ "indexmap 2.8.0", "memchr", "thiserror 2.0.12", +======= +version = "5.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f852905151ac8d4d06fdca66520a661c09730a74c6d4e2b0f27b436b382e532" +dependencies = [ + "arbitrary", + "crc32fast", + "flate2", + "indexmap 2.7.1", + "memchr", +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 "zopfli", ] [[package]] +<<<<<<< HEAD +======= +name = "zlib-rs" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "626bd9fa9734751fc50d6060752170984d7053f5a39061f524cda68023d4db8a" + +[[package]] +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 name = "zopfli" version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" diff --git a/Cargo.toml b/Cargo.toml index 38295372bc..c16d2a14ab 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,10 +4,17 @@ default-members = ["crates/typst-cli"] resolver = "2" [workspace.package] +<<<<<<< HEAD version = "0.13.1" rust-version = "1.80" # also change in ci.yml authors = ["The Typst Project Developers"] edition = "2021" +======= +version = "0.14.0" +rust-version = "1.88" # also change in ci.yml +authors = ["The Typst Project Developers"] +edition = "2024" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 homepage = "https://typst.app" repository = "https://github.com/typst/typst" license = "Apache-2.0" @@ -16,6 +23,7 @@ keywords = ["typst"] readme = "README.md" [workspace.dependencies] +<<<<<<< HEAD typst = { path = "crates/typst", version = "0.13.1" } typst-cli = { path = "crates/typst-cli", version = "0.13.1" } typst-eval = { path = "crates/typst-eval", version = "0.13.1" } @@ -34,6 +42,26 @@ typst-timing = { path = "crates/typst-timing", version = "0.13.1" } typst-utils = { path = "crates/typst-utils", version = "0.13.1" } typst-assets = "0.13.1" typst-dev-assets = { git = "https://github.com/typst/typst-dev-assets", tag = "v0.13.1" } +======= +typst = { path = "crates/typst", version = "0.14.0" } +typst-cli = { path = "crates/typst-cli", version = "0.14.0" } +typst-eval = { path = "crates/typst-eval", version = "0.14.0" } +typst-html = { path = "crates/typst-html", version = "0.14.0" } +typst-ide = { path = "crates/typst-ide", version = "0.14.0" } +typst-kit = { path = "crates/typst-kit", version = "0.14.0" } +typst-layout = { path = "crates/typst-layout", version = "0.14.0" } +typst-library = { path = "crates/typst-library", version = "0.14.0" } +typst-macros = { path = "crates/typst-macros", version = "0.14.0" } +typst-pdf = { path = "crates/typst-pdf", version = "0.14.0" } +typst-realize = { path = "crates/typst-realize", version = "0.14.0" } +typst-render = { path = "crates/typst-render", version = "0.14.0" } +typst-svg = { path = "crates/typst-svg", version = "0.14.0" } +typst-syntax = { path = "crates/typst-syntax", version = "0.14.0" } +typst-timing = { path = "crates/typst-timing", version = "0.14.0" } +typst-utils = { path = "crates/typst-utils", version = "0.14.0" } +typst-assets = "0.14.0" +typst-dev-assets = { git = "https://github.com/typst/typst-dev-assets", tag = "v0.14.0" } +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 arrayvec = "0.7.4" az = "1.2" base64 = "0.22" @@ -47,18 +75,39 @@ clap = { version = "4.4", features = ["derive", "env", "wrap_help"] } clap_complete = "4.2.1" clap_mangen = "0.2.10" codespan-reporting = "0.11" +<<<<<<< HEAD codex = "0.1.1" color-print = "0.3.6" comemo = "0.4" +======= +codex = "0.2.0" +color-print = "0.3.6" +comemo = "0.5.0" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 csv = "1" ctrlc = "3.4.1" dirs = "6" ecow = { version = "0.2", features = ["serde"] } +<<<<<<< HEAD env_proxy = "0.4" flate2 = "1" fontdb = { version = "0.21", default-features = false } fs_extra = "1.3" hayagriva = "0.8.1" +======= +either = "1" +env_proxy = "0.4" +fastrand = "2.3" +flate2 = "1" +fontdb = { version = "0.23", default-features = false } +fs_extra = "1.3" +rustc-hash = "2.1" +glidesort = "0.1.2" +hayagriva = "0.9.1" +hayro = { version = "0.4.0", default-features = false } +hayro-svg = { version = "0.2.0", default-features = false } +hayro-syntax = "0.4.0" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 heck = "0.5" hypher = "0.1.4" icu_properties = { version = "1.4", features = ["serde"] } @@ -66,6 +115,7 @@ icu_provider = { version = "1.4", features = ["sync"] } icu_provider_adapters = "1.4" icu_provider_blob = "1.4" icu_segmenter = { version = "1.4", features = ["serde"] } +<<<<<<< HEAD if_chain = "1" image = { version = "0.25.5", default-features = false, features = ["png", "jpeg", "gif"] } indexmap = { version = "2", features = ["serde"] } @@ -76,18 +126,39 @@ lipsum = "0.9" md5 = "0.7" memchr = "2" miniz_oxide = "0.8" +======= +image = { version = "0.25.5", default-features = false, features = ["png", "jpeg", "gif", "webp"] } +indexmap = { version = "2", features = ["serde"] } +infer = { version = "0.19.0", default-features = false } +kamadak-exif = "0.6" +krilla = { version = "0.5.0", default-features = false, features = ["raster-images", "comemo", "rayon", "pdf"] } +krilla-svg = "0.2" +kurbo = "0.12" +libfuzzer-sys = "0.4" +lipsum = "0.9" +memchr = "2" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 native-tls = "0.2" notify = "8" once_cell = "1" open = "5.0.1" +<<<<<<< HEAD openssl = "0.10" +======= +openssl = "0.10.72" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 oxipng = { version = "9.0", default-features = false, features = ["filetime", "parallel", "zopfli"] } palette = { version = "0.7.3", default-features = false, features = ["approx", "libm"] } parking_lot = "0.12.1" pathdiff = "0.2" +<<<<<<< HEAD pdf-writer = "0.12.1" phf = { version = "0.11", features = ["macros"] } pixglyph = "0.5.1" +======= +phf = { version = "0.13", features = ["macros"] } +pixglyph = "0.6" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 png = "0.17" portable-atomic = "1.6" proc-macro2 = "1" @@ -97,10 +168,17 @@ quote = "1" rayon = "1.7.0" regex = "1" regex-syntax = "0.8" +<<<<<<< HEAD resvg = { version = "0.43", default-features = false, features = ["raster-images"] } roxmltree = "0.20" rust_decimal = { version = "1.36.0", default-features = false, features = ["maths"] } rustybuzz = "0.18" +======= +resvg = { version = "0.45", default-features = false, features = ["raster-images"] } +roxmltree = "0.20" +rust_decimal = { version = "1.36.0", default-features = false, features = ["maths"] } +rustybuzz = "0.20" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 same-file = "1" self-replace = "1.3.7" semver = "1" @@ -111,11 +189,17 @@ shell-escape = "0.1.5" sigpipe = "0.1" siphasher = "1" smallvec = { version = "1.11.1", features = ["union", "const_generics", "const_new"] } +<<<<<<< HEAD stacker = "0.1.15" subsetter = "0.2" svg2pdf = "0.12" syn = { version = "2", features = ["full", "extra-traits"] } syntect = { version = "5", default-features = false, features = ["parsing", "regex-fancy", "plist-load", "yaml-load"] } +======= +stacker = "0.1.19" +syn = { version = "2", features = ["full", "extra-traits"] } +syntect = { version = "5.3", default-features = false, features = ["parsing", "regex-fancy", "plist-load", "yaml-load"] } +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 tar = "0.4" tempfile = "3.7.0" thin-vec = "0.2.13" @@ -123,14 +207,19 @@ time = { version = "0.3.20", features = ["formatting", "macros", "parsing"] } tiny_http = "0.12" tiny-skia = "0.11" toml = { version = "0.8", default-features = false, features = ["parse", "display"] } +<<<<<<< HEAD tracing = "0.1" ttf-parser = "0.24.1" +======= +ttf-parser = "0.25.0" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 two-face = { version = "0.4.3", default-features = false, features = ["syntect-fancy"] } typed-arena = "2" unicode-bidi = "0.3.18" unicode-ident = "1.0" unicode-math-class = "0.1" unicode-script = "0.5" +<<<<<<< HEAD unicode-segmentation = "1" unscanny = "0.1" ureq = { version = "2", default-features = false, features = ["native-tls", "gzip", "json"] } @@ -146,6 +235,22 @@ yaml-front-matter = "0.1" zip = { version = "2", default-features = false, features = ["deflate"] } include_dir = "0.7.4" unicode_names2 = "1.2.2" +======= +unicode-normalization = "0.1.24" +unicode-segmentation = "1" +unscanny = "0.1" +ureq = { version = "2", default-features = false, features = ["native-tls", "gzip", "json"] } +usvg = { version = "0.45", default-features = false, features = ["text"] } +utf8_iter = "1.0.4" +walkdir = "2" +wasmi = { version = "0.51.0", default-features = false, features = ["simd"] } +web-sys = "0.3" +xmlparser = "0.13.5" +xmlwriter = "0.1.0" +xz2 = { version = "0.1", features = ["static"] } +yaml-front-matter = "0.1" +zip = { version = "5", default-features = false, features = ["deflate"] } +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 [profile.dev.package."*"] opt-level = 2 @@ -160,6 +265,10 @@ strip = true [workspace.lints.clippy] blocks_in_conditions = "allow" comparison_chain = "allow" +<<<<<<< HEAD +======= +iter_over_hash_type = "warn" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 manual_range_contains = "allow" mutable_key_type = "allow" uninlined_format_args = "warn" diff --git a/Dockerfile b/Dockerfile index f118b61d8e..692a2d9a22 100644 --- a/Dockerfile +++ b/Dockerfile @@ -27,6 +27,14 @@ RUN --mount=type=cache,target=/root/.cargo/git/db \ FROM alpine:latest ARG CREATED ARG REVISION +<<<<<<< HEAD +======= + +# Create a non-root user that can be activated with `--user typst` +RUN addgroup -g 1000 typst && \ + adduser -D -u 1000 -G typst typst + +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 LABEL org.opencontainers.image.authors="The Typst Project Developers " LABEL org.opencontainers.image.created=${CREATED} LABEL org.opencontainers.image.description="A markup-based typesetting system" diff --git a/NOTICE b/NOTICE index 4b40cba18f..a58487508e 100644 --- a/NOTICE +++ b/NOTICE @@ -36,6 +36,39 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================================================ +<<<<<<< HEAD +======= + +================================================================================ +Translations defined in `crates/typst-library/translations/` are adapted from + +* Babel (https://ctan.org/pkg/babel) + Copyright (C) 2012-2025 Javier Bezos and Johannes L. Braams. + Copyright (C) 1989-2012 Johannes L. Braams and + any individual authors listed elsewhere. + All rights reserved. + This file is part of the Babel system + It may be distributed and/or modified under the + conditions of the LaTeX Project Public License, either version 1.3 + of this license or (at your option) any later version. + The latest version of this license is in + http://www.latex-project.org/lppl.txt + and version 1.3 or later is part of all distributions of LaTeX + version 2003/12/01 or later. + +* Cleveref (https://ctan.org/pkg/cleveref) + Copyright 2006--2018 Toby Cubitt + This file may be distributed and/or modified under the + conditions of the LaTeX Project Public License, either version 1.2 + of this license or (at your option) any later version. + The latest version of this license is in: + http://www.latex-project.org/lppl.txt + and version 1.2 or later is part of all distributions of LaTeX + version 1999/12/01 or later. +================================================================================ + + +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 ================================================================================ Alpha multiplication and source-over blending in `crates/typst-render/src/text.rs` are ported from Skia code which can be found diff --git a/crates/typst-cli/Cargo.toml b/crates/typst-cli/Cargo.toml index 7e9b93f931..83d0ee3e8a 100644 --- a/crates/typst-cli/Cargo.toml +++ b/crates/typst-cli/Cargo.toml @@ -28,7 +28,12 @@ typst-render = { workspace = true } typst-svg = { workspace = true } typst-timing = { workspace = true } chrono = { workspace = true } +<<<<<<< HEAD clap = { workspace = true } +======= +clap = { workspace = true, features = ["string"] } +clap_complete = { workspace = true } +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 codespan-reporting = { workspace = true } color-print = { workspace = true } comemo = { workspace = true } @@ -40,6 +45,10 @@ open = { workspace = true } parking_lot = { workspace = true } pathdiff = { workspace = true } rayon = { workspace = true } +<<<<<<< HEAD +======= +rustc-hash = { workspace = true } +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 same-file = { workspace = true } self-replace = { workspace = true, optional = true } semver = { workspace = true } @@ -63,6 +72,10 @@ clap_complete = { workspace = true } clap_mangen = { workspace = true } color-print = { workspace = true } semver = { workspace = true } +<<<<<<< HEAD +======= +serde = { workspace = true } +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 [features] default = ["embed-fonts", "http-server"] diff --git a/crates/typst-cli/build.rs b/crates/typst-cli/build.rs index bd6a563dbc..4942a44dac 100644 --- a/crates/typst-cli/build.rs +++ b/crates/typst-cli/build.rs @@ -1,10 +1,18 @@ use std::env; +<<<<<<< HEAD use std::fs::{create_dir_all, File}; +======= +use std::fs::{File, create_dir_all}; +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 use std::path::Path; use std::process::Command; use clap::{CommandFactory, ValueEnum}; +<<<<<<< HEAD use clap_complete::{generate_to, Shell}; +======= +use clap_complete::{Shell, generate_to}; +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 use clap_mangen::Man; #[path = "src/args.rs"] @@ -21,6 +29,13 @@ fn main() { println!("cargo:rustc-env=TYPST_VERSION={}", typst_version()); } +<<<<<<< HEAD +======= + if option_env!("TYPST_COMMIT_SHA").is_none() { + println!("cargo:rustc-env=TYPST_COMMIT_SHA={}", typst_commit_sha()); + } + +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 if let Some(dir) = env::var_os("GEN_ARTIFACTS") { let out = &Path::new(&dir); create_dir_all(out).unwrap(); @@ -44,6 +59,7 @@ fn main() { } /// Also used by `args.rs`. +<<<<<<< HEAD fn typst_version() -> String { if let Some(version) = option_env!("TYPST_VERSION") { return version.to_owned(); @@ -51,12 +67,33 @@ fn typst_version() -> String { let pkg = env!("CARGO_PKG_VERSION"); let hash = Command::new("git") +======= +fn typst_version() -> &'static str { + if let Some(version) = option_env!("TYPST_VERSION") { + return version; + } + + env!("CARGO_PKG_VERSION") +} + +/// Also used by `args.rs`. +fn typst_commit_sha() -> String { + if let Some(version) = option_env!("TYPST_COMMIT_SHA") { + return version.to_owned(); + } + + Command::new("git") +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 .args(["rev-parse", "HEAD"]) .output() .ok() .filter(|output| output.status.success()) .and_then(|output| String::from_utf8(output.stdout.get(..8)?.into()).ok()) +<<<<<<< HEAD .unwrap_or_else(|| "unknown hash".into()); format!("{pkg} ({hash})") +======= + .unwrap_or_else(|| "unknown hash".into()) +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 } diff --git a/crates/typst-cli/src/args.rs b/crates/typst-cli/src/args.rs index d6855d1006..d333d7d7f8 100644 --- a/crates/typst-cli/src/args.rs +++ b/crates/typst-cli/src/args.rs @@ -1,4 +1,14 @@ +<<<<<<< HEAD use std::fmt::{self, Display, Formatter}; +======= +// This module is imported both from the `typst-cli` crate itself +// and from its build script. In this module, you can only import from crates +// that are both runtime and build dependencies of this crate, or else +// Rust will give a confusing error message about a missing crate. + +use std::fmt::{self, Display, Formatter}; +use std::io::Write; +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 use std::num::NonZeroUsize; use std::ops::RangeInclusive; use std::path::PathBuf; @@ -7,7 +17,13 @@ use std::str::FromStr; use chrono::{DateTime, Utc}; use clap::builder::{TypedValueParser, ValueParser}; use clap::{ArgAction, Args, ColorChoice, Parser, Subcommand, ValueEnum, ValueHint}; +<<<<<<< HEAD +use semver::Version; +======= +use clap_complete::Shell; use semver::Version; +use serde::Serialize; +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 /// The character typically used to separate path components /// in environment variables. @@ -37,7 +53,11 @@ const AFTER_HELP: &str = color_print::cstr!("\ #[derive(Debug, Clone, Parser)] #[clap( name = "typst", +<<<<<<< HEAD version = crate::typst_version(), +======= + version = format!("{} ({})", crate::typst_version(), crate::typst_commit_sha()), +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 author, help_template = HELP_TEMPLATE, after_help = AFTER_HELP, @@ -81,6 +101,15 @@ pub enum Command { /// Self update the Typst CLI. #[cfg_attr(not(feature = "self-update"), clap(hide = true))] Update(UpdateCommand), +<<<<<<< HEAD +======= + + /// Generates shell completion scripts. + Completions(CompletionsCommand), + + /// Displays debugging information about Typst. + Info(InfoCommand), +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 } /// Compiles an input file into a supported output format. @@ -151,6 +180,13 @@ pub struct QueryCommand { #[clap(long)] pub pretty: bool, +<<<<<<< HEAD +======= + /// The target to compile for. + #[clap(long, default_value_t)] + pub target: Target, + +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 /// World arguments. #[clap(flatten)] pub world: WorldArgs, @@ -198,6 +234,33 @@ pub struct UpdateCommand { pub backup_path: Option, } +<<<<<<< HEAD +======= +/// Generates shell completion scripts. +#[derive(Debug, Clone, Parser)] +pub struct CompletionsCommand { + /// The shell to generate completions for. + #[arg(value_enum)] + pub shell: Shell, +} + +/// Displays environment variables and default values Typst uses. +#[derive(Debug, Clone, Parser)] +pub struct InfoCommand { + /// The format to serialize in, if it should be machine-readable. + /// + /// If no format is passed the output is displayed human-readable. + #[arg(long = "format", short = 'f')] + pub format: Option, + + /// Whether to pretty-print the serialized output. + /// + /// Only applies to JSON format. + #[clap(long)] + pub pretty: bool, +} + +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 /// Arguments for compilation and watching. #[derive(Debug, Clone, Args)] pub struct CompileArgs { @@ -246,15 +309,45 @@ pub struct CompileArgs { #[arg(long = "pdf-standard", value_delimiter = ',')] pub pdf_standard: Vec, +<<<<<<< HEAD +======= + /// By default, even when not producing a `PDF/UA-1` document, a tagged PDF + /// document is written to provide a baseline of accessibility. In some + /// circumstances (for example when trying to reduce the size of a document) + /// it can be desirable to disable tagged PDF. + #[arg(long = "no-pdf-tags")] + pub no_pdf_tags: bool, + +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 /// The PPI (pixels per inch) to use for PNG export. #[arg(long = "ppi", default_value_t = 144.0)] pub ppi: f32, /// File path to which a Makefile with the current compilation's /// dependencies will be written. +<<<<<<< HEAD #[clap(long = "make-deps", value_name = "PATH")] pub make_deps: Option, +======= + #[clap(long = "make-deps", value_name = "PATH", hide = true)] + pub make_deps: Option, + + /// File path to which a list of current compilation's dependencies will be + /// written. Use `-` to write to stdout. + #[clap( + long, + value_name = "PATH", + value_parser = output_value_parser(), + value_hint = ValueHint::FilePath, + )] + pub deps: Option, + + /// File format to use for dependencies. + #[clap(long, default_value_t)] + pub deps_format: DepsFormat, + +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 /// Processing arguments. #[clap(flatten)] pub process: ProcessArgs, @@ -361,8 +454,18 @@ pub struct FontArgs { /// Ensures system fonts won't be searched, unless explicitly included via /// `--font-path`. +<<<<<<< HEAD #[arg(long)] pub ignore_system_fonts: bool, +======= + #[arg(long, env = "TYPST_IGNORE_SYSTEM_FONTS")] + pub ignore_system_fonts: bool, + + /// Ensures fonts embedded into Typst won't be considered. + #[cfg(feature = "embed-fonts")] + #[arg(long, env = "TYPST_IGNORE_EMBEDDED_FONTS")] + pub ignore_embedded_fonts: bool, +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 } /// Arguments for the HTTP server. @@ -425,6 +528,27 @@ pub enum Output { Path(PathBuf), } +<<<<<<< HEAD +======= +impl Output { + /// Write data to the output. + pub fn write(&self, buffer: &[u8]) -> std::io::Result<()> { + match self { + Output::Stdout => std::io::stdout().write_all(buffer), + Output::Path(path) => std::fs::write(path, buffer), + } + } + + /// Open the output for writing. + pub fn open(&self) -> std::io::Result> { + match self { + Self::Stdout => Ok(OpenOutput::Stdout(std::io::stdout().lock())), + Self::Path(path) => std::fs::File::create(path).map(OpenOutput::File), + } + } +} + +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 impl Display for Output { fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { match self { @@ -434,6 +558,32 @@ impl Display for Output { } } +<<<<<<< HEAD +======= +/// A step-by-step writable version of [`Output`]. +#[derive(Debug)] +pub enum OpenOutput<'a> { + Stdout(std::io::StdoutLock<'a>), + File(std::fs::File), +} + +impl Write for OpenOutput<'_> { + fn write(&mut self, buf: &[u8]) -> std::io::Result { + match self { + OpenOutput::Stdout(v) => v.write(buf), + OpenOutput::File(v) => v.write(buf), + } + } + + fn flush(&mut self) -> std::io::Result<()> { + match self { + OpenOutput::Stdout(v) => v.flush(), + OpenOutput::File(v) => v.flush(), + } + } +} + +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 /// Which format to use for the generated output file. #[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, ValueEnum)] pub enum OutputFormat { @@ -445,6 +595,35 @@ pub enum OutputFormat { display_possible_values!(OutputFormat); +<<<<<<< HEAD +======= +/// Which format to use for a generated dependency file. +#[derive(Debug, Default, Copy, Clone, Eq, PartialEq, ValueEnum)] +pub enum DepsFormat { + /// Encodes as JSON, failing for non-Unicode paths. + #[default] + Json, + /// Separates paths with NULL bytes and can express all paths. + Zero, + /// Emits in Make format, omitting inexpressible paths. + Make, +} + +display_possible_values!(DepsFormat); + +/// The target to compile for. +#[derive(Debug, Default, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, ValueEnum)] +pub enum Target { + /// PDF and image formats. + #[default] + Paged, + /// HTML. + Html, +} + +display_possible_values!(Target); + +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 /// Which format to use for diagnostics. #[derive(Debug, Default, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, ValueEnum)] pub enum DiagnosticFormat { @@ -456,9 +635,16 @@ pub enum DiagnosticFormat { display_possible_values!(DiagnosticFormat); /// An in-development feature that may be changed or removed at any time. +<<<<<<< HEAD #[derive(Debug, Copy, Clone, Eq, PartialEq, ValueEnum)] pub enum Feature { Html, +======= +#[derive(Debug, Copy, Clone, Eq, PartialEq, ValueEnum, Serialize)] +pub enum Feature { + Html, + A11yExtras, +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 } display_possible_values!(Feature); @@ -467,20 +653,78 @@ display_possible_values!(Feature); #[derive(Debug, Copy, Clone, Eq, PartialEq, ValueEnum)] #[allow(non_camel_case_types)] pub enum PdfStandard { +<<<<<<< HEAD + /// PDF 1.7. + #[value(name = "1.7")] + V_1_7, + /// PDF/A-2b. + #[value(name = "a-2b")] + A_2b, + /// PDF/A-3b. + #[value(name = "a-3b")] + A_3b, +======= + /// PDF 1.4. + #[value(name = "1.4")] + V_1_4, + /// PDF 1.5. + #[value(name = "1.5")] + V_1_5, + /// PDF 1.6. + #[value(name = "1.6")] + V_1_6, /// PDF 1.7. #[value(name = "1.7")] V_1_7, + /// PDF 2.0. + #[value(name = "2.0")] + V_2_0, + /// PDF/A-1b. + #[value(name = "a-1b")] + A_1b, + /// PDF/A-1a. + #[value(name = "a-1a")] + A_1a, /// PDF/A-2b. #[value(name = "a-2b")] A_2b, + /// PDF/A-2u. + #[value(name = "a-2u")] + A_2u, + /// PDF/A-2a. + #[value(name = "a-2a")] + A_2a, /// PDF/A-3b. #[value(name = "a-3b")] A_3b, + /// PDF/A-3u. + #[value(name = "a-3u")] + A_3u, + /// PDF/A-3a. + #[value(name = "a-3a")] + A_3a, + /// PDF/A-4. + #[value(name = "a-4")] + A_4, + /// PDF/A-4f. + #[value(name = "a-4f")] + A_4f, + /// PDF/A-4e. + #[value(name = "a-4e")] + A_4e, + /// PDF/UA-1. + #[value(name = "ua-1")] + UA_1, +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 } display_possible_values!(PdfStandard); +<<<<<<< HEAD // Output file format for query command +======= +/// Output file format for query and info commands +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 #[derive(Debug, Default, Copy, Clone, Eq, PartialEq, ValueEnum)] pub enum SerializationFormat { #[default] diff --git a/crates/typst-cli/src/compile.rs b/crates/typst-cli/src/compile.rs index 2b6a7d820b..0aa82eebcb 100644 --- a/crates/typst-cli/src/compile.rs +++ b/crates/typst-cli/src/compile.rs @@ -1,13 +1,18 @@ use std::ffi::OsStr; +<<<<<<< HEAD use std::fs::{self, File}; use std::io::{self, Write}; use std::path::{Path, PathBuf}; +======= +use std::path::Path; +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 use chrono::{DateTime, Datelike, Timelike, Utc}; use codespan_reporting::diagnostic::{Diagnostic, Label}; use codespan_reporting::term; use ecow::eco_format; use parking_lot::RwLock; +<<<<<<< HEAD use pathdiff::diff_paths; use rayon::iter::{IntoParallelRefIterator, ParallelIterator}; use typst::diag::{ @@ -24,6 +29,25 @@ use crate::args::{ CompileArgs, CompileCommand, DiagnosticFormat, Input, Output, OutputFormat, PdfStandard, WatchCommand, }; +======= +use rayon::iter::{IntoParallelRefIterator, ParallelIterator}; +use typst::WorldExt; +use typst::diag::{ + At, HintedStrResult, HintedString, Severity, SourceDiagnostic, SourceResult, + StrResult, Warned, bail, +}; +use typst::foundations::{Datetime, Smart}; +use typst::layout::{Page, PageRanges, PagedDocument}; +use typst::syntax::{FileId, Lines, Span}; +use typst_html::HtmlDocument; +use typst_pdf::{PdfOptions, PdfStandards, Timestamp}; + +use crate::args::{ + CompileArgs, CompileCommand, DepsFormat, DiagnosticFormat, Input, Output, + OutputFormat, PdfStandard, WatchCommand, +}; +use crate::deps::write_deps; +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 #[cfg(feature = "http-server")] use crate::server::HtmlServer; use crate::timings::Timer; @@ -36,7 +60,11 @@ type CodespanResult = Result; type CodespanError = codespan_reporting::files::Error; /// Execute a compilation command. +<<<<<<< HEAD pub fn compile(timer: &mut Timer, command: &CompileCommand) -> StrResult<()> { +======= +pub fn compile(timer: &mut Timer, command: &CompileCommand) -> HintedStrResult<()> { +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 let mut config = CompileConfig::new(command)?; let mut world = SystemWorld::new(&command.args.input, &command.args.world, &command.args.process) @@ -46,6 +74,11 @@ pub fn compile(timer: &mut Timer, command: &CompileCommand) -> StrResult<()> { /// A preprocessed `CompileCommand`. pub struct CompileConfig { +<<<<<<< HEAD +======= + /// Static warnings to emit after compilation. + pub warnings: Vec, +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 /// Whether we are watching. pub watching: bool, /// Path to input Typst file or stdin. @@ -63,11 +96,22 @@ pub struct CompileConfig { /// Opens the output file with the default viewer or a specific program after /// compilation. pub open: Option>, +<<<<<<< HEAD /// One (or multiple comma-separated) PDF standards that Typst will enforce /// conformance with. pub pdf_standards: PdfStandards, /// A path to write a Makefile rule describing the current compilation. pub make_deps: Option, +======= + /// A list of standards the PDF should conform to. + pub pdf_standards: PdfStandards, + /// Whether to write PDF (accessibility) tags. + pub tagged: bool, + /// A destination to write a list of dependencies to. + pub deps: Option, + /// The format to use for dependencies. + pub deps_format: DepsFormat, +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 /// The PPI (pixels per inch) to use for PNG export. pub ppi: f32, /// The export cache for images, used for caching output files in `typst @@ -80,18 +124,34 @@ pub struct CompileConfig { impl CompileConfig { /// Preprocess a `CompileCommand`, producing a compilation config. +<<<<<<< HEAD pub fn new(command: &CompileCommand) -> StrResult { +======= + pub fn new(command: &CompileCommand) -> HintedStrResult { +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 Self::new_impl(&command.args, None) } /// Preprocess a `WatchCommand`, producing a compilation config. +<<<<<<< HEAD pub fn watching(command: &WatchCommand) -> StrResult { +======= + pub fn watching(command: &WatchCommand) -> HintedStrResult { +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 Self::new_impl(&command.args, Some(command)) } /// The shared implementation of [`CompileConfig::new`] and /// [`CompileConfig::watching`]. +<<<<<<< HEAD fn new_impl(args: &CompileArgs, watch: Option<&WatchCommand>) -> StrResult { +======= + fn new_impl( + args: &CompileArgs, + watch: Option<&WatchCommand>, + ) -> HintedStrResult { + let mut warnings = Vec::new(); +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 let input = args.input.clone(); let output_format = if let Some(specified) = args.format { @@ -130,6 +190,7 @@ impl CompileConfig { PageRanges::new(export_ranges.iter().map(|r| r.0.clone()).collect()) }); +<<<<<<< HEAD let pdf_standards = { let list = args .pdf_standard @@ -142,6 +203,43 @@ impl CompileConfig { .collect::>(); PdfStandards::new(&list)? }; +======= + let tagged = !args.no_pdf_tags && pages.is_none(); + if output_format == OutputFormat::Pdf && pages.is_some() && !args.no_pdf_tags { + warnings.push( + HintedString::from("using --pages implies --no-pdf-tags").with_hints([ + "the resulting PDF will be inaccessible".into(), + "add --no-pdf-tags to silence this warning".into(), + ]), + ); + } + + if !tagged { + const ACCESSIBLE: &[(PdfStandard, &str)] = &[ + (PdfStandard::A_1a, "PDF/A-1a"), + (PdfStandard::A_2a, "PDF/A-2a"), + (PdfStandard::A_3a, "PDF/A-3a"), + (PdfStandard::UA_1, "PDF/UA-1"), + ]; + + for (standard, name) in ACCESSIBLE { + if args.pdf_standard.contains(standard) { + if args.no_pdf_tags { + bail!("cannot disable PDF tags when exporting a {name} document"); + } else { + bail!( + "cannot disable PDF tags when exporting a {name} document"; + hint: "using --pages implies --no-pdf-tags" + ); + } + } + } + } + + let pdf_standards = PdfStandards::new( + &args.pdf_standard.iter().copied().map(Into::into).collect::>(), + )?; +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 #[cfg(feature = "http-server")] let server = match watch { @@ -153,19 +251,60 @@ impl CompileConfig { _ => None, }; +<<<<<<< HEAD Ok(Self { +======= + let mut deps = args.deps.clone(); + let mut deps_format = args.deps_format; + + if let Some(path) = &args.make_deps + && deps.is_none() + { + deps = Some(Output::Path(path.clone())); + deps_format = DepsFormat::Make; + warnings.push( + "--make-deps is deprecated, use --deps and --deps-format instead".into(), + ); + } + + match (&output, &deps, watch) { + (Output::Stdout, _, Some(_)) => { + bail!("cannot write document to stdout in watch mode"); + } + (_, Some(Output::Stdout), Some(_)) => { + bail!("cannot write dependencies to stdout in watch mode") + } + (Output::Stdout, Some(Output::Stdout), _) => { + bail!("cannot write both output and dependencies to stdout") + } + _ => {} + } + + Ok(Self { + warnings, +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 watching: watch.is_some(), input, output, output_format, pages, pdf_standards, +<<<<<<< HEAD creation_timestamp: args.world.creation_timestamp, make_deps: args.make_deps.clone(), +======= + tagged, + creation_timestamp: args.world.creation_timestamp, +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 ppi: args.ppi, diagnostic_format: args.process.diagnostic_format, open: args.open.clone(), export_cache: ExportCache::new(), +<<<<<<< HEAD +======= + deps, + deps_format, +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 #[cfg(feature = "http-server")] server, }) @@ -179,12 +318,17 @@ impl CompileConfig { pub fn compile_once( world: &mut SystemWorld, config: &mut CompileConfig, +<<<<<<< HEAD ) -> StrResult<()> { +======= +) -> HintedStrResult<()> { +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 let start = std::time::Instant::now(); if config.watching { Status::Compiling.print(config).unwrap(); } +<<<<<<< HEAD let Warned { output, warnings } = compile_and_export(world, config); match output { @@ -192,6 +336,22 @@ pub fn compile_once( Ok(outputs) => { let duration = start.elapsed(); +======= + let Warned { output, mut warnings } = compile_and_export(world, config); + + // Add static warnings (for deprecated CLI flags and such). + for warning in config.warnings.iter() { + warnings.push( + SourceDiagnostic::warning(Span::detached(), warning.message()) + .with_hints(warning.hints().iter().map(Into::into)), + ); + } + + match &output { + // Print success message and possibly warnings. + Ok(_) => { + let duration = start.elapsed(); +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 if config.watching { if warnings.is_empty() { Status::Success(duration).print(config).unwrap(); @@ -203,11 +363,18 @@ pub fn compile_once( print_diagnostics(world, &[], &warnings, config.diagnostic_format) .map_err(|err| eco_format!("failed to print diagnostics ({err})"))?; +<<<<<<< HEAD write_make_deps(world, config, outputs)?; open_output(config)?; } // Print diagnostics. +======= + open_output(config)?; + } + + // Print failure message and diagnostics. +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 Err(errors) => { set_failed(); @@ -215,11 +382,23 @@ pub fn compile_once( Status::Error.print(config).unwrap(); } +<<<<<<< HEAD print_diagnostics(world, &errors, &warnings, config.diagnostic_format) +======= + print_diagnostics(world, errors, &warnings, config.diagnostic_format) +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 .map_err(|err| eco_format!("failed to print diagnostics ({err})"))?; } } +<<<<<<< HEAD +======= + if let Some(dest) = &config.deps { + write_deps(world, dest, config.deps_format, output.as_deref().ok()) + .map_err(|err| eco_format!("failed to create dependency file ({err})"))?; + } + +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 Ok(()) } @@ -295,11 +474,19 @@ fn export_pdf(document: &PagedDocument, config: &CompileConfig) -> SourceResult< }) } }; +<<<<<<< HEAD +======= + +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 let options = PdfOptions { ident: Smart::Auto, timestamp, page_ranges: config.pages.clone(), standards: config.pdf_standards.clone(), +<<<<<<< HEAD +======= + tagged: config.tagged, +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 }; let buffer = typst_pdf::pdf(document, &options)?; config @@ -325,7 +512,11 @@ fn convert_datetime( } /// An image format to export in. +<<<<<<< HEAD #[derive(Clone, Copy)] +======= +#[derive(Copy, Clone)] +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 enum ImageExportFormat { Png, Svg, @@ -350,7 +541,11 @@ fn export_image( .iter() .enumerate() .filter(|(i, _)| { +<<<<<<< HEAD config.pages.as_ref().map_or(true, |exported_page_ranges| { +======= + config.pages.as_ref().is_none_or(|exported_page_ranges| { +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 exported_page_ranges.includes_page_index(*i) }) }) @@ -389,7 +584,11 @@ fn export_image( // If the frame is in the cache, skip it. // If the file does not exist, always create it. if config.watching +<<<<<<< HEAD && config.export_cache.is_cached(*i, &page.frame) +======= + && config.export_cache.is_cached(*i, page) +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 && path.exists() { return Ok(Output::Path(path.to_path_buf())); @@ -462,6 +661,7 @@ fn export_image_page( Ok(()) } +<<<<<<< HEAD impl Output { fn write(&self, buffer: &[u8]) -> StrResult<()> { match self { @@ -472,6 +672,8 @@ impl Output { } } +======= +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 /// Caches exported files so that we can avoid re-exporting them if they haven't /// changed. /// @@ -492,8 +694,13 @@ impl ExportCache { /// Returns true if the entry is cached and appends the new hash to the /// cache (for the next compilation). +<<<<<<< HEAD pub fn is_cached(&self, i: usize, frame: &Frame) -> bool { let hash = typst::utils::hash128(frame); +======= + pub fn is_cached(&self, i: usize, page: &Page) -> bool { + let hash = typst::utils::hash128(page); +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 let mut cache = self.cache.upgradable_read(); if i >= cache.len() { @@ -505,6 +712,7 @@ impl ExportCache { } } +<<<<<<< HEAD /// Writes a Makefile rule describing the relationship between the output and /// its dependencies to the path specified by the --make-deps argument, if it /// was provided. @@ -609,6 +817,8 @@ fn write_make_deps( }) } +======= +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 /// Opens the output if desired. fn open_output(config: &mut CompileConfig) -> StrResult<()> { let Some(viewer) = config.open.take() else { return Ok(()) }; @@ -705,7 +915,11 @@ fn label(world: &SystemWorld, span: Span) -> Option> { impl<'a> codespan_reporting::files::Files<'a> for SystemWorld { type FileId = FileId; type Name = String; +<<<<<<< HEAD type Source = Source; +======= + type Source = Lines; +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 fn name(&'a self, id: FileId) -> CodespanResult { let vpath = id.vpath(); @@ -765,3 +979,30 @@ impl<'a> codespan_reporting::files::Files<'a> for SystemWorld { }) } } +<<<<<<< HEAD +======= + +impl From for typst_pdf::PdfStandard { + fn from(standard: PdfStandard) -> Self { + match standard { + PdfStandard::V_1_4 => typst_pdf::PdfStandard::V_1_4, + PdfStandard::V_1_5 => typst_pdf::PdfStandard::V_1_5, + PdfStandard::V_1_6 => typst_pdf::PdfStandard::V_1_6, + PdfStandard::V_1_7 => typst_pdf::PdfStandard::V_1_7, + PdfStandard::V_2_0 => typst_pdf::PdfStandard::V_2_0, + PdfStandard::A_1b => typst_pdf::PdfStandard::A_1b, + PdfStandard::A_1a => typst_pdf::PdfStandard::A_1a, + PdfStandard::A_2b => typst_pdf::PdfStandard::A_2b, + PdfStandard::A_2u => typst_pdf::PdfStandard::A_2u, + PdfStandard::A_2a => typst_pdf::PdfStandard::A_2a, + PdfStandard::A_3b => typst_pdf::PdfStandard::A_3b, + PdfStandard::A_3u => typst_pdf::PdfStandard::A_3u, + PdfStandard::A_3a => typst_pdf::PdfStandard::A_3a, + PdfStandard::A_4 => typst_pdf::PdfStandard::A_4, + PdfStandard::A_4f => typst_pdf::PdfStandard::A_4f, + PdfStandard::A_4e => typst_pdf::PdfStandard::A_4e, + PdfStandard::UA_1 => typst_pdf::PdfStandard::Ua_1, + } + } +} +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 diff --git a/crates/typst-cli/src/completions.rs b/crates/typst-cli/src/completions.rs new file mode 100644 index 0000000000..51e7db1033 --- /dev/null +++ b/crates/typst-cli/src/completions.rs @@ -0,0 +1,13 @@ +use std::io::stdout; + +use clap::CommandFactory; +use clap_complete::generate; + +use crate::args::{CliArguments, CompletionsCommand}; + +/// Execute the completions command. +pub fn completions(command: &CompletionsCommand) { + let mut cmd = CliArguments::command(); + let bin_name = cmd.get_name().to_string(); + generate(command.shell, &mut cmd, bin_name, &mut stdout()); +} diff --git a/crates/typst-cli/src/deps.rs b/crates/typst-cli/src/deps.rs new file mode 100644 index 0000000000..921400a88d --- /dev/null +++ b/crates/typst-cli/src/deps.rs @@ -0,0 +1,153 @@ +use std::ffi::OsString; +use std::io::{self, Write}; + +use serde::Serialize; + +use crate::args::{DepsFormat, Output}; +use crate::world::SystemWorld; + +/// Writes dependencies in the given format. +pub fn write_deps( + world: &mut SystemWorld, + dest: &Output, + format: DepsFormat, + outputs: Option<&[Output]>, +) -> io::Result<()> { + match format { + DepsFormat::Json => write_deps_json(world, dest)?, + DepsFormat::Zero => write_deps_zero(world, dest)?, + DepsFormat::Make => { + if let Some(outputs) = outputs { + write_deps_make(world, dest, outputs)?; + } + } + } + Ok(()) +} + +/// Writes dependencies in JSON format. +fn write_deps_json(world: &mut SystemWorld, dest: &Output) -> io::Result<()> { + let inputs = relative_dependencies(world)? + .map(|dep| { + dep.into_string().map_err(|dep| { + io::Error::new( + io::ErrorKind::InvalidData, + format!("{dep:?} is not valid utf-8"), + ) + }) + }) + .collect::, _>>()?; + + #[derive(Serialize)] + struct Deps { + inputs: Vec, + } + + serde_json::to_writer(dest.open()?, &Deps { inputs })?; + + Ok(()) +} + +/// Writes dependencies in the Zero / Text0 format. +fn write_deps_zero(world: &mut SystemWorld, dest: &Output) -> io::Result<()> { + let mut dest = dest.open()?; + for dep in relative_dependencies(world)? { + dest.write_all(dep.as_encoded_bytes())?; + dest.write_all(b"\0")?; + } + Ok(()) +} + +/// Writes dependencies in the Make format. +fn write_deps_make( + world: &mut SystemWorld, + dest: &Output, + outputs: &[Output], +) -> io::Result<()> { + let mut dest = dest.open()?; + for (i, output) in outputs.iter().enumerate() { + let path = match output { + Output::Path(path) => path.as_os_str(), + Output::Stdout => { + return Err(io::Error::new( + io::ErrorKind::InvalidInput, + "make dependencies contain the output path, \ + but the output was stdout", + )); + } + }; + + // Silently skip paths that aren't valid Unicode so we still + // produce a rule that will work for the other paths that can be + // processed. + let Some(string) = path.to_str() else { continue }; + if i != 0 { + dest.write_all(b" ")?; + } + dest.write_all(munge(string).as_bytes())?; + } + dest.write_all(b":")?; + + for dep in relative_dependencies(world)? { + // See above. + let Some(string) = dep.to_str() else { continue }; + dest.write_all(b" ")?; + dest.write_all(munge(string).as_bytes())?; + } + dest.write_all(b"\n")?; + + Ok(()) +} + +// Based on `munge` in libcpp/mkdeps.cc from the GCC source code. This isn't +// perfect as some special characters can't be escaped. +fn munge(s: &str) -> String { + let mut res = String::with_capacity(s.len()); + let mut slashes = 0; + for c in s.chars() { + match c { + '\\' => slashes += 1, + '$' => { + res.push('$'); + slashes = 0; + } + ':' => { + res.push('\\'); + slashes = 0; + } + ' ' | '\t' => { + // `munge`'s source contains a comment here that says: "A + // space or tab preceded by 2N+1 backslashes represents N + // backslashes followed by space..." + for _ in 0..slashes + 1 { + res.push('\\'); + } + slashes = 0; + } + '#' => { + res.push('\\'); + slashes = 0; + } + _ => slashes = 0, + }; + res.push(c); + } + res +} + +/// Extracts the current compilation's dependencies as paths relative to the +/// current directory. +fn relative_dependencies( + world: &mut SystemWorld, +) -> io::Result> { + let root = world.root().to_owned(); + let current_dir = std::env::current_dir()?; + let relative_root = + pathdiff::diff_paths(&root, ¤t_dir).unwrap_or_else(|| root.clone()); + Ok(world.dependencies().map(move |dependency| { + dependency + .strip_prefix(&root) + .map_or_else(|_| dependency.clone(), |x| relative_root.join(x)) + .into_os_string() + })) +} diff --git a/crates/typst-cli/src/download.rs b/crates/typst-cli/src/download.rs index ca1e539d4a..2ebe92816f 100644 --- a/crates/typst-cli/src/download.rs +++ b/crates/typst-cli/src/download.rs @@ -8,8 +8,13 @@ use codespan_reporting::term::termcolor::WriteColor; use typst::utils::format_duration; use typst_kit::download::{DownloadState, Downloader, Progress}; +<<<<<<< HEAD use crate::terminal::{self, TermOut}; use crate::ARGS; +======= +use crate::ARGS; +use crate::terminal::{self, TermOut}; +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 /// Prints download progress by writing `downloading {0}` followed by repeatedly /// updating the last terminal line. diff --git a/crates/typst-cli/src/fonts.rs b/crates/typst-cli/src/fonts.rs index dbe28d6f55..e0095d0043 100644 --- a/crates/typst-cli/src/fonts.rs +++ b/crates/typst-cli/src/fonts.rs @@ -5,9 +5,17 @@ use crate::args::FontsCommand; /// Execute a font listing command. pub fn fonts(command: &FontsCommand) { +<<<<<<< HEAD let fonts = Fonts::searcher() .include_system_fonts(!command.font.ignore_system_fonts) .search_with(&command.font.font_paths); +======= + let mut fonts = Fonts::searcher(); + fonts.include_system_fonts(!command.font.ignore_system_fonts); + #[cfg(feature = "embed-fonts")] + fonts.include_embedded_fonts(!command.font.ignore_embedded_fonts); + let fonts = fonts.search_with(&command.font.font_paths); +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 for (name, infos) in fonts.book.families() { println!("{name}"); diff --git a/crates/typst-cli/src/info.rs b/crates/typst-cli/src/info.rs new file mode 100644 index 0000000000..790e657128 --- /dev/null +++ b/crates/typst-cli/src/info.rs @@ -0,0 +1,610 @@ +use std::env::VarError; +use std::fmt::Display; +use std::io::{self, Write}; +use std::path::{Path, PathBuf}; + +use clap::builder::{FalseyValueParser, TypedValueParser}; +use clap::{CommandFactory, ValueEnum}; +use codespan_reporting::term::termcolor::{Color, ColorSpec, WriteColor}; +use ecow::eco_format; +use serde::Serialize; +use typst::diag::StrResult; + +use crate::CliArguments; +use crate::args::{Feature, InfoCommand}; +use crate::terminal::{self, TermOut}; + +/// A struct holding the machine readable output of the environment command. +#[derive(Serialize)] +#[serde(rename_all = "kebab-case")] +struct Info { + /// The Typst version. + version: &'static str, + + /// Build info about Typst. + build: Build, + + /// The runtime features from `TYPST_FEATURES`. + features: Features, + + /// Font configuration. + fonts: Fonts, + + /// Package configuration. + packages: Packages, + + /// The environment variables that are of interest to Typst. + env: Environment, +} + +/// Build info about Typst. +#[derive(Default, Serialize)] +#[serde(rename_all = "kebab-case")] +struct Build { + /// The commit this binary was compiled with. + commit: &'static str, + + /// The platform this binary was compiled for. + platform: Platform, + + /// Compile time settings. + settings: Settings, +} + +/// The platform this binary was compiled for. +#[derive(Serialize)] +#[serde(rename_all = "kebab-case")] +struct Platform { + /// Operating system this binary was compiled for. + os: &'static str, + + /// The instruction set architecture this binary was compiled for. + arch: &'static str, +} + +impl Platform { + /// Create a new platform using compile time constants. + const fn new() -> Self { + Self { + os: std::env::consts::OS, + arch: std::env::consts::ARCH, + } + } +} + +impl Default for Platform { + fn default() -> Self { + Self::new() + } +} + +/// Compile time settings. +#[derive(Default, Serialize)] +#[serde(rename_all = "kebab-case")] +struct Settings { + /// Whether the `self-update` compile-time feature is enabled. + self_update: bool, + + /// Whether the `http-server` compile-time feature is enabled. + http_server: bool, +} + +impl Settings { + /// Return the compile features with human readable information. + fn compile_features(&self) -> impl Iterator> { + let Self { self_update, http_server } = self; + + [ + ("self-update", self_update, "Update Typst via `typst update`"), + ("http-server", http_server, "Serve HTML via `typst watch`"), + ] + .into_iter() + .map(|(key, val, desc)| KeyValDesc { key, val: Value::Bool(*val), desc }) + } +} + +/// The runtime features from `TYPST_FEATURES`. +#[derive(Default, Serialize)] +#[serde(rename_all = "kebab-case")] +struct Features { + html: bool, + a11y_extras: bool, +} + +impl Features { + /// Return the runtime features with human readable information. + fn features(&self) -> impl Iterator> { + let Self { html, a11y_extras } = self; + + [ + ("html", html, "Experimental HTML support"), + ("a11y-extras", a11y_extras, "Experimental accessibility additions"), + ] + .into_iter() + .map(|(key, val, desc)| KeyValDesc { key, val: Value::Bool(*val), desc }) + } +} + +/// Font configuration. +#[derive(Default, Serialize)] +#[serde(rename_all = "kebab-case")] +struct Fonts { + /// The font paths from `TYPST_FONT_PATHS`. + paths: Vec, + + /// Whether system fonts were included in the search. + system: bool, + + /// Whether embedded fonts were included in the search. + embedded: bool, +} + +impl Fonts { + /// Return the custom font paths. + fn custom_paths(&self) -> impl Iterator> { + self.paths.iter().map(|p| Value::Path(p)) + } + + /// Return whether system and embedded fonts are included. + fn included(&self) -> impl Iterator)> { + let Self { paths: _, system, embedded } = self; + + [("System fonts", system), ("Embedded fonts", embedded)] + .into_iter() + .map(|(key, val)| (key, Value::Bool(*val))) + } +} + +/// Package configuration. +#[derive(Default, Serialize)] +#[serde(rename_all = "kebab-case")] +struct Packages { + /// The resolved package path. + package_path: Option, + + /// The resolved package cache path. + package_cache_path: Option, +} + +impl Packages { + /// Return the resolved package paths. + fn paths(&self) -> impl Iterator)> { + let Self { package_path, package_cache_path } = self; + + [("Package path", package_path), ("Package cache path", package_cache_path)] + .into_iter() + .map(|(k, v)| (k, v.as_deref().map(Value::Path).unwrap_or(Value::Unset))) + } +} + +/// The environment variables that are of interest to Typst. +#[derive(Default, Serialize)] +#[serde(rename_all = "SCREAMING_SNAKE_CASE")] +struct Environment { + typst_cert: Option, + typst_features: Option, + typst_font_paths: Option, + typst_ignore_system_fonts: Option, + typst_ignore_embedded_fonts: Option, + typst_package_cache_path: Option, + typst_package_path: Option, + typst_root: Option, + typst_update_backup_path: Option, + source_date_epoch: Option, + #[cfg(not(any(target_os = "windows", target_os = "macos", target_os = "ios")))] + xdg_cache_home: Option, + #[cfg(not(any(target_os = "windows", target_os = "macos", target_os = "ios")))] + xdg_data_home: Option, + #[cfg(not(any(target_os = "windows", target_os = "macos", target_os = "ios",)))] + fontconfig_file: Option, + #[cfg(not(any(target_os = "windows", target_os = "macos", target_os = "ios")))] + openssl_conf: Option, + no_color: Option, + no_proxy: Option, + http_proxy: Option, + https_proxy: Option, + all_proxy: Option, +} + +impl Environment { + fn vars(&self) -> impl Iterator)> { + let Environment { + typst_cert, + typst_features, + typst_font_paths, + typst_ignore_system_fonts, + typst_ignore_embedded_fonts, + typst_package_cache_path, + typst_package_path, + typst_root, + typst_update_backup_path, + source_date_epoch, + #[cfg(not(any( + target_os = "windows", + target_os = "macos", + target_os = "ios", + )))] + xdg_cache_home, + #[cfg(not(any( + target_os = "windows", + target_os = "macos", + target_os = "ios", + )))] + xdg_data_home, + #[cfg(not(any( + target_os = "windows", + target_os = "macos", + target_os = "ios", + )))] + fontconfig_file, + #[cfg(not(any( + target_os = "windows", + target_os = "macos", + target_os = "ios", + )))] + openssl_conf, + no_color, + no_proxy, + http_proxy, + https_proxy, + all_proxy, + } = self; + + [ + ("TYPST_CERT", typst_cert), + ("TYPST_FEATURES", typst_features), + ("TYPST_FONT_PATHS", typst_font_paths), + ("TYPST_IGNORE_SYSTEM_FONTS", typst_ignore_system_fonts), + ("TYPST_IGNORE_EMBEDDED_FONTS", typst_ignore_embedded_fonts), + ("TYPST_PACKAGE_CACHE_PATH", typst_package_cache_path), + ("TYPST_PACKAGE_PATH", typst_package_path), + ("TYPST_ROOT", typst_root), + ("TYPST_UPDATE_BACKUP_PATH", typst_update_backup_path), + ("SOURCE_DATE_EPOCH", source_date_epoch), + #[cfg(not(any( + target_os = "windows", + target_os = "macos", + target_os = "ios", + )))] + ("XDG_CACHE_HOME", xdg_cache_home), + #[cfg(not(any( + target_os = "windows", + target_os = "macos", + target_os = "ios", + )))] + ("XDG_DATA_HOME", xdg_data_home), + #[cfg(not(any( + target_os = "windows", + target_os = "macos", + target_os = "ios", + )))] + ("FONTCONFIG_FILE", fontconfig_file), + #[cfg(not(any( + target_os = "windows", + target_os = "macos", + target_os = "ios", + )))] + ("OPENSSL_CONF", openssl_conf), + ("NO_COLOR", no_color), + ("NO_PROXY", no_proxy), + ("HTTP_PROXY", http_proxy), + ("HTTPS_PROXY", https_proxy), + ("ALL_PROXY", all_proxy), + ] + .into_iter() + .map(|(k, v)| (k, v.as_deref().map(Value::String).unwrap_or(Value::Unset))) + } +} + +pub fn info(command: &InfoCommand) -> StrResult<()> { + let cmd = CliArguments::command(); + + let env = get_vars()?; + + let runtime_features = + parse_features(env.typst_features.as_deref().unwrap_or_default())?; + + let font_paths = env + .typst_font_paths + .as_deref() + .unwrap_or_default() + .split(':') + .filter(|s| !s.is_empty()) + .map(PathBuf::from) + .collect::<_>(); + + let boolish = |v: &String| { + // This is only an error if `v` is not valid UTF-8, which it + // always is. + FalseyValueParser::new().parse_ref(&cmd, None, v.as_ref()).ok() + }; + + let value = Info { + version: crate::typst_version(), + build: Build { + commit: crate::typst_commit_sha(), + platform: Platform::new(), + settings: Settings { + self_update: cfg!(feature = "self-update"), + http_server: cfg!(feature = "http-server"), + }, + }, + features: runtime_features, + fonts: Fonts { + paths: font_paths, + system: !env + .typst_ignore_system_fonts + .as_ref() + .and_then(boolish) + .unwrap_or(false), + embedded: !env + .typst_ignore_embedded_fonts + .as_ref() + .and_then(boolish) + .unwrap_or(false), + }, + packages: Packages { + package_path: env + .typst_package_path + .as_ref() + .map(PathBuf::from) + .or_else(typst_kit::package::default_package_path), + package_cache_path: env + .typst_package_cache_path + .as_ref() + .map(PathBuf::from) + .or_else(typst_kit::package::default_package_cache_path), + }, + env, + }; + + if let Some(format) = command.format { + let serialized = crate::serialize(&value, format, command.pretty)?; + println!("{serialized}"); + } else { + format_human_readable(&value).map_err(|e| eco_format!("{e}"))?; + } + + Ok(()) +} + +/// Retrieves all relevant environment variables. +fn get_vars() -> StrResult { + fn get_var(key: &'static str) -> StrResult> { + match std::env::var(key) { + Ok(val) => Ok(Some(val)), + Err(VarError::NotPresent) => Ok(None), + Err(VarError::NotUnicode(_)) => { + crate::set_failed(); + crate::print_error(&format!( + "the environment variable `{key}` was not valid UTF-8" + )) + .map_err(|e| eco_format!("{e}"))?; + Ok(None) + } + } + } + + Ok(Environment { + typst_cert: get_var("TYPST_CERT")?, + typst_features: get_var("TYPST_FEATURES")?, + typst_font_paths: get_var("TYPST_FONT_PATHS")?, + typst_ignore_system_fonts: get_var("TYPST_IGNORE_SYSTEM_FONTS")?, + typst_ignore_embedded_fonts: get_var("TYPST_IGNORE_EMBEDDED_FONTS")?, + typst_package_cache_path: get_var("TYPST_PACKAGE_CACHE_PATH")?, + typst_package_path: get_var("TYPST_PACKAGE_PATH")?, + typst_root: get_var("TYPST_ROOT")?, + typst_update_backup_path: get_var("TYPST_UPDATE_BACKUP_PATH")?, + source_date_epoch: get_var("SOURCE_DATE_EPOCH")?, + #[cfg(not(any(target_os = "windows", target_os = "macos", target_os = "ios")))] + xdg_cache_home: get_var("XDG_CACHE_HOME")?, + #[cfg(not(any(target_os = "windows", target_os = "macos", target_os = "ios")))] + xdg_data_home: get_var("XDG_DATA_HOME")?, + #[cfg(not(any(target_os = "windows", target_os = "macos", target_os = "ios")))] + fontconfig_file: get_var("FONTCONFIG_FILE")?, + #[cfg(not(any(target_os = "windows", target_os = "macos", target_os = "ios")))] + openssl_conf: get_var("OPENSSL_CONF")?, + no_color: get_var("NO_COLOR")?, + no_proxy: get_var("NO_PROXY")?, + http_proxy: get_var("HTTP_PROXY")?, + https_proxy: get_var("HTTPS_PROXY")?, + all_proxy: get_var("ALL_PROXY")?, + }) +} + +/// Turns a comma separated list of feature names into a well typed struct of +/// feature flags. +fn parse_features(feature_list: &str) -> StrResult { + let mut features = Features { html: false, a11y_extras: false }; + + for feature in feature_list.split(',').filter(|s| !s.is_empty()) { + match Feature::from_str(feature, true) { + Ok(feature) => match feature { + Feature::Html => features.html = true, + Feature::A11yExtras => features.a11y_extras = true, + }, + Err(_) => { + crate::print_error(&format!("Unknown runtime feature: `{feature}`")) + .map_err(|e| eco_format!("{e}"))?; + continue; + } + } + } + + Ok(features) +} + +/// A for formatting human readable key-value-description triplets. +struct KeyValDesc<'a> { + key: &'static str, + val: Value<'a>, + desc: &'static str, +} + +impl KeyValDesc<'_> { + /// Formatted this as ` ()` with optional right padding for + /// key and value. + fn format( + &self, + out: &mut TermOut, + key_pad: Option, + val_pad: Option, + ) -> io::Result<()> { + write!(out, " ")?; + write_key(out, self.key, key_pad)?; + write!(out, " ")?; + self.val.format(out, val_pad)?; + write!(out, " ({})", self.desc)?; + + Ok(()) + } +} + +/// A value for colorful human readable formatting. +enum Value<'a> { + Unset, + Bool(bool), + Path(&'a Path), + String(&'a str), +} + +impl Value<'_> { + /// Formats this value with optional right padding. + fn format(&self, out: &mut TermOut, pad: Option) -> io::Result<()> { + match self { + Value::Unset => write_value_special(out, "", pad), + Value::Bool(true) => write_value_special(out, "on", pad), + Value::Bool(false) => write_value_special(out, "off", pad), + Value::Path(val) => write_value_simple(out, val.display(), pad), + Value::String(val) => write_value_simple(out, val, pad), + } + } +} + +/// Writes a key in cyan with optional right padding. +fn write_key(out: &mut TermOut, key: impl Display, pad: Option) -> io::Result<()> { + out.set_color(ColorSpec::new().set_fg(Some(Color::Cyan)))?; + if let Some(pad) = pad { + write!(out, "{key: , +) -> io::Result<()> { + out.set_color(ColorSpec::new().set_fg(Some(Color::Green)))?; + if let Some(pad) = pad { + write!(out, "{val: , +) -> io::Result<()> { + out.set_color(ColorSpec::new().set_fg(Some(Color::Magenta)))?; + if let Some(pad) = pad { + write!(out, "{val: io::Result<()> { + let mut out = terminal::out(); + + write_key(&mut out, "Version", None)?; + write!(out, " ")?; + write_value_simple(&mut out, value.version, None)?; + write!(out, " (")?; + write_value_simple(&mut out, value.build.commit, None)?; + write!(out, ", ")?; + write_value_simple(&mut out, value.build.platform.os, None)?; + write!(out, " on ")?; + write_value_simple(&mut out, value.build.platform.arch, None)?; + writeln!(out, ")\n")?; + + writeln!(out, "Build settings")?; + let key_pad = value.build.settings.compile_features().map(|f| f.key.len()).max(); + for feature in value.build.settings.compile_features() { + feature.format(&mut out, key_pad, Some(3))?; + writeln!(out)?; + } + + writeln!(out)?; + writeln!(out, "Features")?; + let key_pad = value.features.features().map(|f| f.key.len()).max(); + for feature in value.features.features() { + feature.format(&mut out, key_pad, Some(3))?; + writeln!(out)?; + } + + writeln!(out)?; + writeln!(out, "Fonts")?; + write!(out, " ")?; + write_key(&mut out, "Custom font paths", None)?; + if value.fonts.paths.is_empty() { + write!(out, " ")?; + write_value_special(&mut out, "", None)?; + writeln!(out)?; + } else { + writeln!(out)?; + for path in value.fonts.custom_paths() { + write!(out, " - ")?; + path.format(&mut out, None)?; + writeln!(out)?; + } + } + + let key_pad = value.fonts.included().map(|(key, _)| key.len()).max(); + for (key, val) in value.fonts.included() { + write!(out, " ")?; + write_key(&mut out, key, key_pad)?; + write!(out, " ")?; + val.format(&mut out, None)?; + writeln!(out)?; + } + + writeln!(out)?; + writeln!(out, "Packages")?; + let key_pad = value.packages.paths().map(|(name, _)| name.len()).max(); + for (key, val) in value.packages.paths() { + write!(out, " ")?; + write_key(&mut out, key, key_pad)?; + write!(out, " ")?; + val.format(&mut out, None)?; + writeln!(out)?; + } + + writeln!(out)?; + writeln!(out, "Environment variables")?; + let key_pad = value.env.vars().map(|(name, _)| name.len()).max(); + for (key, val) in value.env.vars() { + write!(out, " ")?; + write_key(&mut out, key, key_pad)?; + write!(out, " ")?; + val.format(&mut out, None)?; + + writeln!(out)?; + } + + Ok(()) +} diff --git a/crates/typst-cli/src/init.rs b/crates/typst-cli/src/init.rs index 9a77fb4705..e6224e500b 100644 --- a/crates/typst-cli/src/init.rs +++ b/crates/typst-cli/src/init.rs @@ -4,7 +4,11 @@ use std::path::Path; use codespan_reporting::term::termcolor::{Color, ColorSpec, WriteColor}; use ecow::eco_format; use fs_extra::dir::CopyOptions; +<<<<<<< HEAD use typst::diag::{bail, FileError, StrResult}; +======= +use typst::diag::{FileError, StrResult, bail}; +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 use typst::syntax::package::{ PackageManifest, PackageSpec, TemplateInfo, VersionlessPackageSpec, }; diff --git a/crates/typst-cli/src/main.rs b/crates/typst-cli/src/main.rs index 14f8a665d2..3b4b62bb6d 100644 --- a/crates/typst-cli/src/main.rs +++ b/crates/typst-cli/src/main.rs @@ -1,8 +1,17 @@ mod args; mod compile; +<<<<<<< HEAD mod download; mod fonts; mod greet; +======= +mod completions; +mod deps; +mod download; +mod fonts; +mod greet; +mod info; +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 mod init; mod package; mod query; @@ -20,6 +29,7 @@ use std::io::{self, Write}; use std::process::ExitCode; use std::sync::LazyLock; +<<<<<<< HEAD use clap::error::ErrorKind; use clap::Parser; use codespan_reporting::term; @@ -27,6 +37,17 @@ use codespan_reporting::term::termcolor::WriteColor; use typst::diag::HintedStrResult; use crate::args::{CliArguments, Command}; +======= +use clap::Parser; +use clap::error::ErrorKind; +use codespan_reporting::term; +use codespan_reporting::term::termcolor::WriteColor; +use ecow::eco_format; +use serde::Serialize; +use typst::diag::{HintedStrResult, StrResult}; + +use crate::args::{CliArguments, Command, SerializationFormat}; +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 use crate::timings::Timer; thread_local! { @@ -55,6 +76,12 @@ fn main() -> ExitCode { if let Err(msg) = res { set_failed(); print_error(msg.message()).expect("failed to print error"); +<<<<<<< HEAD +======= + for hint in msg.hints() { + print_hint(hint).expect("failed to print hint"); + } +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 } EXIT.with(|cell| cell.get()) @@ -71,6 +98,11 @@ fn dispatch() -> HintedStrResult<()> { Command::Query(command) => crate::query::query(command)?, Command::Fonts(command) => crate::fonts::fonts(command), Command::Update(command) => crate::update::update(command)?, +<<<<<<< HEAD +======= + Command::Completions(command) => crate::completions::completions(command), + Command::Info(command) => crate::info::info(command)?, +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 } Ok(()) @@ -86,6 +118,14 @@ fn typst_version() -> &'static str { env!("TYPST_VERSION") } +<<<<<<< HEAD +======= +/// Used by `args.rs`. +fn typst_commit_sha() -> &'static str { + env!("TYPST_COMMIT_SHA") +} + +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 /// Print an application-level error (independent from a source file). fn print_error(msg: &str) -> io::Result<()> { let styles = term::Styles::default(); @@ -98,9 +138,48 @@ fn print_error(msg: &str) -> io::Result<()> { writeln!(output, ": {msg}") } +<<<<<<< HEAD #[cfg(not(feature = "self-update"))] mod update { use typst::diag::{bail, StrResult}; +======= +/// Print an application-level hint (independent from a source file). +fn print_hint(msg: &str) -> io::Result<()> { + let styles = term::Styles::default(); + + let mut output = terminal::out(); + output.set_color(&styles.header_help)?; + write!(output, "hint")?; + + output.reset()?; + writeln!(output, ": {msg}") +} + +/// Serialize data to the output format and convert the error to an +/// [`EcoString`]. +fn serialize( + data: &impl Serialize, + format: SerializationFormat, + pretty: bool, +) -> StrResult { + match format { + SerializationFormat::Json => { + if pretty { + serde_json::to_string_pretty(data).map_err(|e| eco_format!("{e}")) + } else { + serde_json::to_string(data).map_err(|e| eco_format!("{e}")) + } + } + SerializationFormat::Yaml => { + serde_yaml::to_string(data).map_err(|e| eco_format!("{e}")) + } + } +} + +#[cfg(not(feature = "self-update"))] +mod update { + use typst::diag::{StrResult, bail}; +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 use crate::args::UpdateCommand; diff --git a/crates/typst-cli/src/query.rs b/crates/typst-cli/src/query.rs index 610f23cd40..2a4d05af9d 100644 --- a/crates/typst-cli/src/query.rs +++ b/crates/typst-cli/src/query.rs @@ -1,4 +1,5 @@ use comemo::Track; +<<<<<<< HEAD use ecow::{eco_format, EcoString}; use serde::Serialize; use typst::diag::{bail, HintedStrResult, StrResult, Warned}; @@ -9,6 +10,20 @@ use typst::World; use typst_eval::{eval_string, EvalMode}; use crate::args::{QueryCommand, SerializationFormat}; +======= +use ecow::{EcoString, eco_format}; +use typst::World; +use typst::diag::{HintedStrResult, StrResult, Warned, bail}; +use typst::engine::Sink; +use typst::foundations::{Content, IntoValue, LocatableSelector, Scope}; +use typst::introspection::Introspector; +use typst::layout::PagedDocument; +use typst::syntax::{Span, SyntaxMode}; +use typst_eval::eval_string; +use typst_html::HtmlDocument; + +use crate::args::{QueryCommand, Target}; +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 use crate::compile::print_diagnostics; use crate::set_failed; use crate::world::SystemWorld; @@ -21,12 +36,26 @@ pub fn query(command: &QueryCommand) -> HintedStrResult<()> { world.reset(); world.source(world.main()).map_err(|err| err.to_string())?; +<<<<<<< HEAD let Warned { output, warnings } = typst::compile(&world); match output { // Retrieve and print query results. Ok(document) => { let data = retrieve(&world, command, &document)?; +======= + let Warned { output, warnings } = match command.target { + Target::Paged => typst::compile::(&world) + .map(|output| output.map(|document| document.introspector)), + Target::Html => typst::compile::(&world) + .map(|output| output.map(|document| document.introspector)), + }; + + match output { + // Retrieve and print query results. + Ok(introspector) => { + let data = retrieve(&world, command, &introspector)?; +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 let serialized = format(data, command)?; println!("{serialized}"); print_diagnostics(&world, &[], &warnings, command.process.diagnostic_format) @@ -53,14 +82,26 @@ pub fn query(command: &QueryCommand) -> HintedStrResult<()> { fn retrieve( world: &dyn World, command: &QueryCommand, +<<<<<<< HEAD document: &PagedDocument, +======= + introspector: &Introspector, +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 ) -> HintedStrResult> { let selector = eval_string( &typst::ROUTINES, world.track(), +<<<<<<< HEAD &command.selector, Span::detached(), EvalMode::Code, +======= + // TODO: propagate warnings + Sink::new().track_mut(), + &command.selector, + Span::detached(), + SyntaxMode::Code, +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 Scope::default(), ) .map_err(|errors| { @@ -73,11 +114,15 @@ fn retrieve( })? .cast::()?; +<<<<<<< HEAD Ok(document .introspector .query(&selector.0) .into_iter() .collect::>()) +======= + Ok(introspector.query(&selector.0).into_iter().collect::>()) +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 } /// Format the query result in the output format. @@ -98,6 +143,7 @@ fn format(elements: Vec, command: &QueryCommand) -> StrResult { let Some(value) = mapped.first() else { bail!("no such field found for element"); }; +<<<<<<< HEAD serialize(value, command.format, command.pretty) } else { serialize(&mapped, command.format, command.pretty) @@ -121,5 +167,10 @@ fn serialize( SerializationFormat::Yaml => { serde_yaml::to_string(data).map_err(|e| eco_format!("{e}")) } +======= + crate::serialize(value, command.format, command.pretty) + } else { + crate::serialize(&mapped, command.format, command.pretty) +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 } } diff --git a/crates/typst-cli/src/server.rs b/crates/typst-cli/src/server.rs index 8910e03230..4f783989f8 100644 --- a/crates/typst-cli/src/server.rs +++ b/crates/typst-cli/src/server.rs @@ -5,7 +5,11 @@ use std::sync::Arc; use ecow::eco_format; use parking_lot::{Condvar, Mutex, MutexGuard}; use tiny_http::{Header, Request, Response, StatusCode}; +<<<<<<< HEAD use typst::diag::{bail, StrResult}; +======= +use typst::diag::{StrResult, bail}; +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 use crate::args::{Input, ServerArgs}; @@ -162,7 +166,11 @@ impl Bucket { } /// Retrieves the current data in the bucket. +<<<<<<< HEAD fn get(&self) -> MutexGuard { +======= + fn get(&self) -> MutexGuard<'_, T> { +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 self.mutex.lock() } @@ -181,8 +189,16 @@ impl Bucket { /// The initial HTML before compilation is finished. const PLACEHOLDER_HTML: &str = "\ +<<<<<<< HEAD +======= + + + + + +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 Waiting for {INPUT} + + diff --git a/tests/ref/html/html-textarea-starting-with-newline.html b/tests/ref/html/html-textarea-starting-with-newline.html new file mode 100644 index 0000000000..9c234037d0 --- /dev/null +++ b/tests/ref/html/html-textarea-starting-with-newline.html @@ -0,0 +1,10 @@ + + + + + + + + diff --git a/tests/ref/html/html-typed.html b/tests/ref/html/html-typed.html new file mode 100644 index 0000000000..ef62538feb --- /dev/null +++ b/tests/ref/html/html-typed.html @@ -0,0 +1,63 @@ + + + + + + + +
+
+
+ +
+
+
+ +
+
+
+
+
+
+
+
+ + + +
+
+
+
+
+
+ + + + + + + + + +
+
+
+
+
+
+
+
+
RTL
+ My wonderful image +
+
+ +
+
+
+
+
+
+ + + diff --git a/tests/ref/html/image-jpg-html-base64.html b/tests/ref/html/image-jpg-html-base64.html new file mode 100644 index 0000000000..89075323c9 --- /dev/null +++ b/tests/ref/html/image-jpg-html-base64.html @@ -0,0 +1,8 @@ + + + + + + + The letter F + diff --git a/tests/ref/html/image-pdf-basic.html b/tests/ref/html/image-pdf-basic.html new file mode 100644 index 0000000000..9dfbd8b752 --- /dev/null +++ b/tests/ref/html/image-pdf-basic.html @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/tests/ref/html/image-scaling-methods.html b/tests/ref/html/image-scaling-methods.html new file mode 100644 index 0000000000..a15664d518 --- /dev/null +++ b/tests/ref/html/image-scaling-methods.html @@ -0,0 +1,10 @@ + + + + + + + +
+ + diff --git a/tests/ref/html/image-sizing-html-css.html b/tests/ref/html/image-sizing-html-css.html new file mode 100644 index 0000000000..25b1482fdd --- /dev/null +++ b/tests/ref/html/image-sizing-html-css.html @@ -0,0 +1,8 @@ + + + + + + + width: 50%width: 100ptwidth: calc(30% + 50pt)height: 75%height: 80ptheight: calc(20% + 40pt) + diff --git a/tests/ref/html/link-html-frame-ref.html b/tests/ref/html/link-html-frame-ref.html new file mode 100644 index 0000000000..41b24ad5b4 --- /dev/null +++ b/tests/ref/html/link-html-frame-ref.html @@ -0,0 +1,11 @@ + + + + + + + + +

1 Introduction

+ + diff --git a/tests/ref/html/link-html-frame.html b/tests/ref/html/link-html-frame.html new file mode 100644 index 0000000000..a8a9105945 --- /dev/null +++ b/tests/ref/html/link-html-frame.html @@ -0,0 +1,15 @@ + + + + + + + +

Frame 1

+ +

Text

+

Go to teal square

+

Frame 2

+ + + diff --git a/tests/ref/html/link-html-here.html b/tests/ref/html/link-html-here.html new file mode 100644 index 0000000000..f66e1c1713 --- /dev/null +++ b/tests/ref/html/link-html-here.html @@ -0,0 +1,10 @@ + + + + + + + +

Go

+ + diff --git a/tests/ref/html/link-html-id-attach.html b/tests/ref/html/link-html-id-attach.html new file mode 100644 index 0000000000..55a7a7650d --- /dev/null +++ b/tests/ref/html/link-html-id-attach.html @@ -0,0 +1,31 @@ + + + + + + + + +

Hi

+

Hi there

+

See it

+

See it here

+

See a b

+

See a b

+

See

+ +

See

+ +

Strong

+ + diff --git a/tests/ref/html/link-html-id-existing.html b/tests/ref/html/link-html-id-existing.html new file mode 100644 index 0000000000..7686fc9ac3 --- /dev/null +++ b/tests/ref/html/link-html-id-existing.html @@ -0,0 +1,11 @@ + + + + + + + +
This
+

Go

+ + diff --git a/tests/ref/html/link-html-label-disambiguation.html b/tests/ref/html/link-html-label-disambiguation.html new file mode 100644 index 0000000000..41f1d33a9a --- /dev/null +++ b/tests/ref/html/link-html-label-disambiguation.html @@ -0,0 +1,31 @@ + + + + + + + +

A

+

B

+

C

+

D

+

E

+

F

+

G

+

H

+

I

+

J

+ + + diff --git a/tests/ref/html/link-html-nested-empty.html b/tests/ref/html/link-html-nested-empty.html new file mode 100644 index 0000000000..5560a8faf4 --- /dev/null +++ b/tests/ref/html/link-html-nested-empty.html @@ -0,0 +1,11 @@ + + + + + + + +

Hi

+

A B C

+ + diff --git a/tests/ref/html/measure-html.html b/tests/ref/html/measure-html.html new file mode 100644 index 0000000000..ef5f03bc24 --- /dev/null +++ b/tests/ref/html/measure-html.html @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/tests/ref/html/multi-header-inside-table.html b/tests/ref/html/multi-header-inside-table.html new file mode 100644 index 0000000000..a4a61a6975 --- /dev/null +++ b/tests/ref/html/multi-header-inside-table.html @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FirstHeader
SecondHeader
Level 2Header
Level 3Header
BodyCells
YetMore
Level 2Header Inside
Level 3
EvenMore
BodyCells
One Last HeaderFor Good Measure
FooterRow
EndingTable
+ + diff --git a/tests/ref/html/multi-header-table.html b/tests/ref/html/multi-header-table.html new file mode 100644 index 0000000000..8a34ac1709 --- /dev/null +++ b/tests/ref/html/multi-header-table.html @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FirstHeader
SecondHeader
Level 2Header
Level 3Header
BodyCells
YetMore
FooterRow
EndingTable
+ + diff --git a/tests/ref/html/outline-figure-html.html b/tests/ref/html/outline-figure-html.html new file mode 100644 index 0000000000..3e88762e85 --- /dev/null +++ b/tests/ref/html/outline-figure-html.html @@ -0,0 +1,29 @@ + + + + + + + + +
+

A

+
Figure 1: The A
+
+
+

B

+
Fig. 2. – Le B
+
+
+

C

+
Abbildung 3 ~ Das C
+
+ + diff --git a/tests/ref/html/outline-html.html b/tests/ref/html/outline-html.html new file mode 100644 index 0000000000..b53caa2793 --- /dev/null +++ b/tests/ref/html/outline-html.html @@ -0,0 +1,43 @@ + + + + + + + + +

1. A

+

2. B

+

3. C

+

4. D

+

4.1. E

+

4.2. F

+

5. G

+

5.0.1. H

+
5.0.1.0.1. I
+
5.0.1.1. J
+

6. K

+ + diff --git a/tests/ref/html/par-semantic-html.html b/tests/ref/html/par-semantic-html.html index 09c7d2fd0e..3279fac8d5 100644 --- a/tests/ref/html/par-semantic-html.html +++ b/tests/ref/html/par-semantic-html.html @@ -6,8 +6,13 @@

Heading is no paragraph

+<<<<<<< HEAD

I'm a paragraph.

I'm not.
+======= +

I’m a paragraph.

+
I’m not.
+>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534

We are two.

So we are paragraphs.

diff --git a/tests/ref/html/quote-nesting-html.html b/tests/ref/html/quote-nesting-html.html index 6b05a94a06..2be8caeca8 100644 --- a/tests/ref/html/quote-nesting-html.html +++ b/tests/ref/html/quote-nesting-html.html @@ -5,6 +5,10 @@ +<<<<<<< HEAD

When you said that “he surely meant that ‘she intended to say “I'm sorry”’”, I was quite confused.

+======= +

When you said that “he surely meant that ‘she intended to say “I’m sorry”’”, I was quite confused.

+>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 diff --git a/tests/ref/html/raw-html-inline-spaces.html b/tests/ref/html/raw-html-inline-spaces.html new file mode 100644 index 0000000000..e14fa76e99 --- /dev/null +++ b/tests/ref/html/raw-html-inline-spaces.html @@ -0,0 +1,10 @@ + + + + + + + +

This has double spaces inside, which should be kept.

+ + diff --git a/tests/ref/html/raw-html.html b/tests/ref/html/raw-html.html new file mode 100644 index 0000000000..a80ff6ee26 --- /dev/null +++ b/tests/ref/html/raw-html.html @@ -0,0 +1,11 @@ + + + + + + + +

This is *inline*.

+
#[
#set text(blue)
*Hello* _world_!
]
+ + diff --git a/tests/ref/html/ref-basic.html b/tests/ref/html/ref-basic.html new file mode 100644 index 0000000000..4e0e01b7df --- /dev/null +++ b/tests/ref/html/ref-basic.html @@ -0,0 +1,13 @@ + + + + + + + +

1. Introduction

+

See Section 1.1.

+

1.1. Setup

+

As seen in Section 1, we proceed.

+ + diff --git a/tests/ref/html/smallcaps-all.html b/tests/ref/html/smallcaps-all.html new file mode 100644 index 0000000000..47b799415b --- /dev/null +++ b/tests/ref/html/smallcaps-all.html @@ -0,0 +1,10 @@ + + + + + + + +

Test 012
Test 012

+ + diff --git a/tests/ref/html/smartquote-inline-block.html b/tests/ref/html/smartquote-inline-block.html new file mode 100644 index 0000000000..15afefc0a4 --- /dev/null +++ b/tests/ref/html/smartquote-inline-block.html @@ -0,0 +1,13 @@ + + + + + + + +

Applies across “inline-level elements”.

+

Does not apply across

+
“block-level
+

elements“.

+ + diff --git a/tests/ref/html/smartquote-nesting-twice.html b/tests/ref/html/smartquote-nesting-twice.html new file mode 100644 index 0000000000..232e6a52d5 --- /dev/null +++ b/tests/ref/html/smartquote-nesting-twice.html @@ -0,0 +1,11 @@ + + + + + + + +

When you said that “he surely meant that ‘she intended to say “I’m sorry”’”, I was quite confused.

+

box

+ + diff --git a/tests/ref/html/title-with-body.html b/tests/ref/html/title-with-body.html new file mode 100644 index 0000000000..7b58813be6 --- /dev/null +++ b/tests/ref/html/title-with-body.html @@ -0,0 +1,11 @@ + + + + + + My title + + +

My display title

+ + diff --git a/tests/ref/html/title.html b/tests/ref/html/title.html new file mode 100644 index 0000000000..b1a59cdf37 --- /dev/null +++ b/tests/ref/html/title.html @@ -0,0 +1,12 @@ + + + + + + My title + + +

My title

+

A level one heading

+ + diff --git a/tests/ref/hyphenate-repeat-style.png b/tests/ref/hyphenate-repeat-style.png new file mode 100644 index 0000000000..5ce57682a6 Binary files /dev/null and b/tests/ref/hyphenate-repeat-style.png differ diff --git a/tests/ref/image-exif-rotation.png b/tests/ref/image-exif-rotation.png new file mode 100644 index 0000000000..f9b374e476 Binary files /dev/null and b/tests/ref/image-exif-rotation.png differ diff --git a/tests/ref/image-pdf-base14-fonts.png b/tests/ref/image-pdf-base14-fonts.png new file mode 100644 index 0000000000..3e25ac60e8 Binary files /dev/null and b/tests/ref/image-pdf-base14-fonts.png differ diff --git a/tests/ref/image-pdf-basic.png b/tests/ref/image-pdf-basic.png new file mode 100644 index 0000000000..d06fffe197 Binary files /dev/null and b/tests/ref/image-pdf-basic.png differ diff --git a/tests/ref/image-pdf-complex.png b/tests/ref/image-pdf-complex.png new file mode 100644 index 0000000000..248d9639b1 Binary files /dev/null and b/tests/ref/image-pdf-complex.png differ diff --git a/tests/ref/image-pdf-multiple-pages.png b/tests/ref/image-pdf-multiple-pages.png new file mode 100644 index 0000000000..63640b452d Binary files /dev/null and b/tests/ref/image-pdf-multiple-pages.png differ diff --git a/tests/ref/image-svg-linked-jpg1.png b/tests/ref/image-svg-linked-jpg1.png new file mode 100644 index 0000000000..c21846d62b Binary files /dev/null and b/tests/ref/image-svg-linked-jpg1.png differ diff --git a/tests/ref/image-svg-linked-jpg2.png b/tests/ref/image-svg-linked-jpg2.png new file mode 100644 index 0000000000..05748d82d5 Binary files /dev/null and b/tests/ref/image-svg-linked-jpg2.png differ diff --git a/tests/ref/image-svg-linked-many-formats.png b/tests/ref/image-svg-linked-many-formats.png new file mode 100644 index 0000000000..86bcdc5125 Binary files /dev/null and b/tests/ref/image-svg-linked-many-formats.png differ diff --git a/tests/ref/issue-2914-block-fill-skip-nested.png b/tests/ref/issue-2914-block-fill-skip-nested.png new file mode 100644 index 0000000000..0dcbd6d85f Binary files /dev/null and b/tests/ref/issue-2914-block-fill-skip-nested.png differ diff --git a/tests/ref/issue-2914-block-height-cut-off.png b/tests/ref/issue-2914-block-height-cut-off.png new file mode 100644 index 0000000000..559af35de6 Binary files /dev/null and b/tests/ref/issue-2914-block-height-cut-off.png differ diff --git a/tests/ref/issue-4828-math-number-multi-char.png b/tests/ref/issue-4828-math-number-multi-char.png new file mode 100644 index 0000000000..b365645d33 Binary files /dev/null and b/tests/ref/issue-4828-math-number-multi-char.png differ diff --git a/tests/ref/issue-5276-shaping-consecutive-ltr-with-lang.png b/tests/ref/issue-5276-shaping-consecutive-ltr-with-lang.png new file mode 100644 index 0000000000..2d7ddb361e Binary files /dev/null and b/tests/ref/issue-5276-shaping-consecutive-ltr-with-lang.png differ diff --git a/tests/ref/issue-5359-column-override-stays-inside-footer.png b/tests/ref/issue-5359-column-override-stays-inside-footer.png new file mode 100644 index 0000000000..8339a4090d Binary files /dev/null and b/tests/ref/issue-5359-column-override-stays-inside-footer.png differ diff --git a/tests/ref/issue-5359-column-override-stays-inside-header.png b/tests/ref/issue-5359-column-override-stays-inside-header.png new file mode 100644 index 0000000000..8339a4090d Binary files /dev/null and b/tests/ref/issue-5359-column-override-stays-inside-header.png differ diff --git a/tests/ref/issue-5489-matrix-stray-linebreak.png b/tests/ref/issue-5489-matrix-stray-linebreak.png new file mode 100644 index 0000000000..f4e41bf99a Binary files /dev/null and b/tests/ref/issue-5489-matrix-stray-linebreak.png differ diff --git a/tests/ref/issue-5536-quote-inline-quotes-false.png b/tests/ref/issue-5536-quote-inline-quotes-false.png new file mode 100644 index 0000000000..e7b29d7120 Binary files /dev/null and b/tests/ref/issue-5536-quote-inline-quotes-false.png differ diff --git a/tests/ref/issue-5723-grid-heading-numbering.png b/tests/ref/issue-5723-grid-heading-numbering.png new file mode 100644 index 0000000000..53da0777be Binary files /dev/null and b/tests/ref/issue-5723-grid-heading-numbering.png differ diff --git a/tests/ref/issue-5775-cite-order-rtl.png b/tests/ref/issue-5775-cite-order-rtl.png new file mode 100644 index 0000000000..982ceef392 Binary files /dev/null and b/tests/ref/issue-5775-cite-order-rtl.png differ diff --git a/tests/ref/issue-5940-text-negative-size-panic.png b/tests/ref/issue-5940-text-negative-size-panic.png new file mode 100644 index 0000000000..6818caadc7 Binary files /dev/null and b/tests/ref/issue-5940-text-negative-size-panic.png differ diff --git a/tests/ref/issue-6125-block-place-width-limited.png b/tests/ref/issue-6125-block-place-width-limited.png new file mode 100644 index 0000000000..28c5645700 Binary files /dev/null and b/tests/ref/issue-6125-block-place-width-limited.png differ diff --git a/tests/ref/issue-6162-coincident-gradient-stops-export-png.png b/tests/ref/issue-6162-coincident-gradient-stops-export-png.png new file mode 100644 index 0000000000..d269342c7c Binary files /dev/null and b/tests/ref/issue-6162-coincident-gradient-stops-export-png.png differ diff --git a/tests/ref/issue-6170-equation-stroke.png b/tests/ref/issue-6170-equation-stroke.png new file mode 100644 index 0000000000..a375931b50 Binary files /dev/null and b/tests/ref/issue-6170-equation-stroke.png differ diff --git a/tests/ref/issue-6242-tight-list-attach-spacing.png b/tests/ref/issue-6242-tight-list-attach-spacing.png new file mode 100644 index 0000000000..48920008b1 Binary files /dev/null and b/tests/ref/issue-6242-tight-list-attach-spacing.png differ diff --git a/tests/ref/issue-6267-clip-anti-alias.png b/tests/ref/issue-6267-clip-anti-alias.png new file mode 100644 index 0000000000..00a61bc2d8 Binary files /dev/null and b/tests/ref/issue-6267-clip-anti-alias.png differ diff --git a/tests/ref/issue-6304-block-skip-label.png b/tests/ref/issue-6304-block-skip-label.png new file mode 100644 index 0000000000..089cb7d418 Binary files /dev/null and b/tests/ref/issue-6304-block-skip-label.png differ diff --git a/tests/ref/issue-6399-grid-cell-colspan-set-rule.png b/tests/ref/issue-6399-grid-cell-colspan-set-rule.png new file mode 100644 index 0000000000..a40eda78dc Binary files /dev/null and b/tests/ref/issue-6399-grid-cell-colspan-set-rule.png differ diff --git a/tests/ref/issue-6399-grid-cell-rowspan-set-rule.png b/tests/ref/issue-6399-grid-cell-rowspan-set-rule.png new file mode 100644 index 0000000000..a40eda78dc Binary files /dev/null and b/tests/ref/issue-6399-grid-cell-rowspan-set-rule.png differ diff --git a/tests/ref/issue-6539-cjk-latin-spacing-at-manual-linebreak.png b/tests/ref/issue-6539-cjk-latin-spacing-at-manual-linebreak.png new file mode 100644 index 0000000000..cc572f7aea Binary files /dev/null and b/tests/ref/issue-6539-cjk-latin-spacing-at-manual-linebreak.png differ diff --git a/tests/ref/issue-6666-auto-hlines-around-footer.png b/tests/ref/issue-6666-auto-hlines-around-footer.png new file mode 100644 index 0000000000..78e2085c89 Binary files /dev/null and b/tests/ref/issue-6666-auto-hlines-around-footer.png differ diff --git a/tests/ref/issue-6666-auto-hlines-around-header.png b/tests/ref/issue-6666-auto-hlines-around-header.png new file mode 100644 index 0000000000..80be946e91 Binary files /dev/null and b/tests/ref/issue-6666-auto-hlines-around-header.png differ diff --git a/tests/ref/issue-6680-gradient-linear-with-aspect-correction.png b/tests/ref/issue-6680-gradient-linear-with-aspect-correction.png new file mode 100644 index 0000000000..38769ed9d5 Binary files /dev/null and b/tests/ref/issue-6680-gradient-linear-with-aspect-correction.png differ diff --git a/tests/ref/issue-6869-image-zero-sized.png b/tests/ref/issue-6869-image-zero-sized.png new file mode 100644 index 0000000000..61e6dbae12 Binary files /dev/null and b/tests/ref/issue-6869-image-zero-sized.png differ diff --git a/tests/ref/issue-6961-tab-crlf-raw-indent.png b/tests/ref/issue-6961-tab-crlf-raw-indent.png new file mode 100644 index 0000000000..c1ee5d894d Binary files /dev/null and b/tests/ref/issue-6961-tab-crlf-raw-indent.png differ diff --git a/tests/ref/issue-7103-wrong-state-calculation.png b/tests/ref/issue-7103-wrong-state-calculation.png new file mode 100644 index 0000000000..0dbaa10ace Binary files /dev/null and b/tests/ref/issue-7103-wrong-state-calculation.png differ diff --git a/tests/ref/issue-7113-cjk-latin-spacing-shift.png b/tests/ref/issue-7113-cjk-latin-spacing-shift.png new file mode 100644 index 0000000000..f520d11888 Binary files /dev/null and b/tests/ref/issue-7113-cjk-latin-spacing-shift.png differ diff --git a/tests/ref/issue-7188-grid-counter-order.png b/tests/ref/issue-7188-grid-counter-order.png new file mode 100644 index 0000000000..e4ca9dd026 Binary files /dev/null and b/tests/ref/issue-7188-grid-counter-order.png differ diff --git a/tests/ref/issue-hyphenate-after-tag.png b/tests/ref/issue-hyphenate-after-tag.png new file mode 100644 index 0000000000..2628a9c306 Binary files /dev/null and b/tests/ref/issue-hyphenate-after-tag.png differ diff --git a/tests/ref/issues-7168-linebreak-whitespace-trimming-justify-rtl.png b/tests/ref/issues-7168-linebreak-whitespace-trimming-justify-rtl.png new file mode 100644 index 0000000000..935916e11f Binary files /dev/null and b/tests/ref/issues-7168-linebreak-whitespace-trimming-justify-rtl.png differ diff --git a/tests/ref/justify-limits-glyph-grow-only.png b/tests/ref/justify-limits-glyph-grow-only.png new file mode 100644 index 0000000000..7dadd86305 Binary files /dev/null and b/tests/ref/justify-limits-glyph-grow-only.png differ diff --git a/tests/ref/justify-limits-glyph-shrink-only.png b/tests/ref/justify-limits-glyph-shrink-only.png new file mode 100644 index 0000000000..09f1d2132d Binary files /dev/null and b/tests/ref/justify-limits-glyph-shrink-only.png differ diff --git a/tests/ref/justify-limits-tight-overstretch.png b/tests/ref/justify-limits-tight-overstretch.png new file mode 100644 index 0000000000..ae7bde1a60 Binary files /dev/null and b/tests/ref/justify-limits-tight-overstretch.png differ diff --git a/tests/ref/linebreak-default-ignorables.png b/tests/ref/linebreak-default-ignorables.png new file mode 100644 index 0000000000..4de46af4c9 Binary files /dev/null and b/tests/ref/linebreak-default-ignorables.png differ diff --git a/tests/ref/linebreak-whitespace-trimming.png b/tests/ref/linebreak-whitespace-trimming.png new file mode 100644 index 0000000000..4032a4e42d Binary files /dev/null and b/tests/ref/linebreak-whitespace-trimming.png differ diff --git a/tests/ref/locate-migrated-breakable.png b/tests/ref/locate-migrated-breakable.png new file mode 100644 index 0000000000..2ee414e459 Binary files /dev/null and b/tests/ref/locate-migrated-breakable.png differ diff --git a/tests/ref/locate-start-of-par.png b/tests/ref/locate-start-of-par.png new file mode 100644 index 0000000000..e7cdf0f8f4 Binary files /dev/null and b/tests/ref/locate-start-of-par.png differ diff --git a/tests/ref/logical-children-tags-underline-around-place.png b/tests/ref/logical-children-tags-underline-around-place.png new file mode 100644 index 0000000000..7e0445e666 Binary files /dev/null and b/tests/ref/logical-children-tags-underline-around-place.png differ diff --git a/tests/ref/long-scripts.png b/tests/ref/long-scripts.png new file mode 100644 index 0000000000..84758d087c Binary files /dev/null and b/tests/ref/long-scripts.png differ diff --git a/tests/ref/math-accent-bottom-high-base.png b/tests/ref/math-accent-bottom-high-base.png new file mode 100644 index 0000000000..45993f79d4 Binary files /dev/null and b/tests/ref/math-accent-bottom-high-base.png differ diff --git a/tests/ref/math-accent-bottom-sized.png b/tests/ref/math-accent-bottom-sized.png new file mode 100644 index 0000000000..5455b2f5b2 Binary files /dev/null and b/tests/ref/math-accent-bottom-sized.png differ diff --git a/tests/ref/math-accent-bottom-subscript.png b/tests/ref/math-accent-bottom-subscript.png new file mode 100644 index 0000000000..8185444455 Binary files /dev/null and b/tests/ref/math-accent-bottom-subscript.png differ diff --git a/tests/ref/math-accent-bottom-wide-base.png b/tests/ref/math-accent-bottom-wide-base.png new file mode 100644 index 0000000000..0475b4856b Binary files /dev/null and b/tests/ref/math-accent-bottom-wide-base.png differ diff --git a/tests/ref/math-accent-bottom.png b/tests/ref/math-accent-bottom.png new file mode 100644 index 0000000000..bd1b921460 Binary files /dev/null and b/tests/ref/math-accent-bottom.png differ diff --git a/tests/ref/math-accent-dotless-disabled.png b/tests/ref/math-accent-dotless-disabled.png new file mode 100644 index 0000000000..d75ec45802 Binary files /dev/null and b/tests/ref/math-accent-dotless-disabled.png differ diff --git a/tests/ref/math-accent-dotless-greedy.png b/tests/ref/math-accent-dotless-greedy.png new file mode 100644 index 0000000000..a753aa81cb Binary files /dev/null and b/tests/ref/math-accent-dotless-greedy.png differ diff --git a/tests/ref/math-accent-dotless-set-rule.png b/tests/ref/math-accent-dotless-set-rule.png new file mode 100644 index 0000000000..ae5ef017aa Binary files /dev/null and b/tests/ref/math-accent-dotless-set-rule.png differ diff --git a/tests/ref/math-accent-flattened.png b/tests/ref/math-accent-flattened.png new file mode 100644 index 0000000000..f7764cb741 Binary files /dev/null and b/tests/ref/math-accent-flattened.png differ diff --git a/tests/ref/math-accent-nested.png b/tests/ref/math-accent-nested.png new file mode 100644 index 0000000000..4b3d58f38e Binary files /dev/null and b/tests/ref/math-accent-nested.png differ diff --git a/tests/ref/math-accent-show-rule-1.png b/tests/ref/math-accent-show-rule-1.png new file mode 100644 index 0000000000..561520d41f Binary files /dev/null and b/tests/ref/math-accent-show-rule-1.png differ diff --git a/tests/ref/math-accent-show-rule-2.png b/tests/ref/math-accent-show-rule-2.png new file mode 100644 index 0000000000..4c9ba753b1 Binary files /dev/null and b/tests/ref/math-accent-show-rule-2.png differ diff --git a/tests/ref/math-accent-show-rule-3.png b/tests/ref/math-accent-show-rule-3.png new file mode 100644 index 0000000000..40249550e0 Binary files /dev/null and b/tests/ref/math-accent-show-rule-3.png differ diff --git a/tests/ref/math-accent-show-rule-4.png b/tests/ref/math-accent-show-rule-4.png new file mode 100644 index 0000000000..4df1d37680 Binary files /dev/null and b/tests/ref/math-accent-show-rule-4.png differ diff --git a/tests/ref/math-call-symbol.png b/tests/ref/math-call-symbol.png new file mode 100644 index 0000000000..8308bece1f Binary files /dev/null and b/tests/ref/math-call-symbol.png differ diff --git a/tests/ref/math-delim-show-rule-1.png b/tests/ref/math-delim-show-rule-1.png new file mode 100644 index 0000000000..31a8ddf1e4 Binary files /dev/null and b/tests/ref/math-delim-show-rule-1.png differ diff --git a/tests/ref/math-delim-show-rule-2.png b/tests/ref/math-delim-show-rule-2.png new file mode 100644 index 0000000000..f5489bce91 Binary files /dev/null and b/tests/ref/math-delim-show-rule-2.png differ diff --git a/tests/ref/math-delim-show-rule-3.png b/tests/ref/math-delim-show-rule-3.png new file mode 100644 index 0000000000..c875f3b277 Binary files /dev/null and b/tests/ref/math-delim-show-rule-3.png differ diff --git a/tests/ref/math-delim-show-rule-4.png b/tests/ref/math-delim-show-rule-4.png new file mode 100644 index 0000000000..e71da28b4f Binary files /dev/null and b/tests/ref/math-delim-show-rule-4.png differ diff --git a/tests/ref/math-delim-show-rule-5.png b/tests/ref/math-delim-show-rule-5.png new file mode 100644 index 0000000000..94245c4b72 Binary files /dev/null and b/tests/ref/math-delim-show-rule-5.png differ diff --git a/tests/ref/math-font-covers.png b/tests/ref/math-font-covers.png new file mode 100644 index 0000000000..d7aa0357a1 Binary files /dev/null and b/tests/ref/math-font-covers.png differ diff --git a/tests/ref/math-font-fallback-class.png b/tests/ref/math-font-fallback-class.png new file mode 100644 index 0000000000..0ac5401136 Binary files /dev/null and b/tests/ref/math-font-fallback-class.png differ diff --git a/tests/ref/math-font-features-switch.png b/tests/ref/math-font-features-switch.png new file mode 100644 index 0000000000..00af0cea80 Binary files /dev/null and b/tests/ref/math-font-features-switch.png differ diff --git a/tests/ref/math-font-warning.png b/tests/ref/math-font-warning.png new file mode 100644 index 0000000000..26519827e6 Binary files /dev/null and b/tests/ref/math-font-warning.png differ diff --git a/tests/ref/math-frac-horizontal-explicit.png b/tests/ref/math-frac-horizontal-explicit.png new file mode 100644 index 0000000000..09a12d93ab Binary files /dev/null and b/tests/ref/math-frac-horizontal-explicit.png differ diff --git a/tests/ref/math-frac-horizontal-lr-paren.png b/tests/ref/math-frac-horizontal-lr-paren.png new file mode 100644 index 0000000000..4489460dd5 Binary files /dev/null and b/tests/ref/math-frac-horizontal-lr-paren.png differ diff --git a/tests/ref/math-frac-horizontal-nonparen-brackets.png b/tests/ref/math-frac-horizontal-nonparen-brackets.png new file mode 100644 index 0000000000..64c31dbc9a Binary files /dev/null and b/tests/ref/math-frac-horizontal-nonparen-brackets.png differ diff --git a/tests/ref/math-frac-horizontal.png b/tests/ref/math-frac-horizontal.png new file mode 100644 index 0000000000..2d139df780 Binary files /dev/null and b/tests/ref/math-frac-horizontal.png differ diff --git a/tests/ref/math-frac-skewed.png b/tests/ref/math-frac-skewed.png new file mode 100644 index 0000000000..40215c06cb Binary files /dev/null and b/tests/ref/math-frac-skewed.png differ diff --git a/tests/ref/math-frac-styles-inline.png b/tests/ref/math-frac-styles-inline.png new file mode 100644 index 0000000000..1042e945a2 Binary files /dev/null and b/tests/ref/math-frac-styles-inline.png differ diff --git a/tests/ref/math-glyph-show-rule.png b/tests/ref/math-glyph-show-rule.png new file mode 100644 index 0000000000..df32041c03 Binary files /dev/null and b/tests/ref/math-glyph-show-rule.png differ diff --git a/tests/ref/math-lr-mid-class.png b/tests/ref/math-lr-mid-class.png new file mode 100644 index 0000000000..6487578d7f Binary files /dev/null and b/tests/ref/math-lr-mid-class.png differ diff --git a/tests/ref/math-mat-vec-cases-unity.png b/tests/ref/math-mat-vec-cases-unity.png new file mode 100644 index 0000000000..bb85182e4f Binary files /dev/null and b/tests/ref/math-mat-vec-cases-unity.png differ diff --git a/tests/ref/math-op-font.png b/tests/ref/math-op-font.png new file mode 100644 index 0000000000..d12009b6d0 Binary files /dev/null and b/tests/ref/math-op-font.png differ diff --git a/tests/ref/math-op-set-font.png b/tests/ref/math-op-set-font.png new file mode 100644 index 0000000000..8ea5b280ea Binary files /dev/null and b/tests/ref/math-op-set-font.png differ diff --git a/tests/ref/math-primes-show-rule.png b/tests/ref/math-primes-show-rule.png new file mode 100644 index 0000000000..6acf68db39 Binary files /dev/null and b/tests/ref/math-primes-show-rule.png differ diff --git a/tests/ref/math-root-frame-size-index.png b/tests/ref/math-root-frame-size-index.png new file mode 100644 index 0000000000..f47049568a Binary files /dev/null and b/tests/ref/math-root-frame-size-index.png differ diff --git a/tests/ref/math-root-show-rule-1.png b/tests/ref/math-root-show-rule-1.png new file mode 100644 index 0000000000..b8d97930bf Binary files /dev/null and b/tests/ref/math-root-show-rule-1.png differ diff --git a/tests/ref/math-root-show-rule-2.png b/tests/ref/math-root-show-rule-2.png new file mode 100644 index 0000000000..aa444ee800 Binary files /dev/null and b/tests/ref/math-root-show-rule-2.png differ diff --git a/tests/ref/math-root-show-rule-3.png b/tests/ref/math-root-show-rule-3.png new file mode 100644 index 0000000000..aaa05090c8 Binary files /dev/null and b/tests/ref/math-root-show-rule-3.png differ diff --git a/tests/ref/math-root-show-rule-4.png b/tests/ref/math-root-show-rule-4.png new file mode 100644 index 0000000000..8d043f84a0 Binary files /dev/null and b/tests/ref/math-root-show-rule-4.png differ diff --git a/tests/ref/math-root-show-rule-5.png b/tests/ref/math-root-show-rule-5.png new file mode 100644 index 0000000000..acf648d97d Binary files /dev/null and b/tests/ref/math-root-show-rule-5.png differ diff --git a/tests/ref/math-root-syntax-prec.png b/tests/ref/math-root-syntax-prec.png new file mode 100644 index 0000000000..9f78ea1ca2 Binary files /dev/null and b/tests/ref/math-root-syntax-prec.png differ diff --git a/tests/ref/math-shorthands-noncontinuable.png b/tests/ref/math-shorthands-noncontinuable.png new file mode 100644 index 0000000000..2f1ad1d14e Binary files /dev/null and b/tests/ref/math-shorthands-noncontinuable.png differ diff --git a/tests/ref/math-stretch-min-overlap-exceeds-max.png b/tests/ref/math-stretch-min-overlap-exceeds-max.png new file mode 100644 index 0000000000..a75437fd96 Binary files /dev/null and b/tests/ref/math-stretch-min-overlap-exceeds-max.png differ diff --git a/tests/ref/math-style-fallback.png b/tests/ref/math-style-fallback.png new file mode 100644 index 0000000000..de0283762d Binary files /dev/null and b/tests/ref/math-style-fallback.png differ diff --git a/tests/ref/math-style-script.png b/tests/ref/math-style-script.png new file mode 100644 index 0000000000..379d270e70 Binary files /dev/null and b/tests/ref/math-style-script.png differ diff --git a/tests/ref/page-numbering-huge.png b/tests/ref/page-numbering-huge.png new file mode 100644 index 0000000000..4c886faa68 Binary files /dev/null and b/tests/ref/page-numbering-huge.png differ diff --git a/tests/ref/pdftags/bibliography-basic.yml b/tests/ref/pdftags/bibliography-basic.yml new file mode 100644 index 0000000000..bad6b4a5b8 --- /dev/null +++ b/tests/ref/pdftags/bibliography-basic.yml @@ -0,0 +1,61 @@ +- Tag: H1 + /T: "Details" + /K: + - Content: page=0 mcid=0 +- Tag: P + /K: + - Content: page=0 mcid=1 + - Tag: Link + /K: + - Content: page=0 mcid=2 + - Annotation: page=0 index=0 + - Content: page=0 mcid=3 + - Tag: Link + /K: + - Content: page=0 mcid=4 + - Annotation: page=0 index=1 + - Content: page=0 mcid=5 + - Tag: Link + /K: + - Content: page=0 mcid=6 + - Annotation: page=0 index=2 + - Content: page=0 mcid=7 + - Tag: Link + /K: + - Content: page=0 mcid=8 + - Annotation: page=0 index=3 + - Content: page=0 mcid=9 +- Tag: H1 + /T: "Bibliography" + /K: + - Content: page=0 mcid=10 +- Tag: L + /Numbering: Decimal + /K: + - Tag: LI + /K: + - Tag: Lbl + /K: + - Tag: Link + /K: + - Content: page=0 mcid=11 + - Annotation: page=0 index=4 + - Tag: LBody + /K: + - Tag: BibEntry + /K: + - Content: page=0 mcid=12 + - Tag: LI + /K: + - Tag: Lbl + /K: + - Tag: Link + /K: + - Content: page=0 mcid=13 + - Annotation: page=0 index=5 + - Tag: LBody + /K: + - Tag: BibEntry + /K: + - Content: page=0 mcid=14 + - Content: page=0 mcid=15 diff --git a/tests/ref/pdftags/break-tags-issue-7020.yml b/tests/ref/pdftags/break-tags-issue-7020.yml new file mode 100644 index 0000000000..56d5fe8a5a --- /dev/null +++ b/tests/ref/pdftags/break-tags-issue-7020.yml @@ -0,0 +1,13 @@ +- Tag: P + /K: + - Content: page=0 mcid=0 +- Tag: InlineQuote + /Placement: Block + /K: + - Tag: P + /K: + - Content: page=0 mcid=1 + - Tag: Formula + - Tag: P + /K: + - Content: page=0 mcid=2 diff --git a/tests/ref/pdftags/break-tags-nested-parbreak-with-nested-groups.yml b/tests/ref/pdftags/break-tags-nested-parbreak-with-nested-groups.yml new file mode 100644 index 0000000000..ca2b39ad46 --- /dev/null +++ b/tests/ref/pdftags/break-tags-nested-parbreak-with-nested-groups.yml @@ -0,0 +1,47 @@ +- Tag: P + /K: + - Content: page=0 mcid=0 + - Content: page=0 mcid=1 +- Tag: Link + /Placement: Block + /K: + - Annotation: page=0 index=0 + - Annotation: page=0 index=1 + - Annotation: page=0 index=2 + - Tag: P + /K: + - Tag: Code + /K: + - Content: page=0 mcid=2 + - Content: page=0 mcid=3 + - Content: page=0 mcid=4 + - Annotation: page=0 index=3 + - Annotation: page=0 index=4 + - Annotation: page=0 index=5 + - Annotation: page=0 index=6 + - Annotation: page=0 index=7 + - Annotation: page=0 index=8 + - Annotation: page=0 index=9 + - Tag: InlineQuote + /K: + - Tag: P + /K: + - Content: page=0 mcid=5 + - Tag: Code + /K: + - Content: page=0 mcid=6 + - Content: page=0 mcid=7 + - Content: page=0 mcid=8 + - Content: page=0 mcid=9 + - Tag: P + /K: + - Content: page=0 mcid=10 + - Content: page=0 mcid=11 +- Tag: P + /K: + - Tag: Link + /K: + - Content: page=0 mcid=12 + - Annotation: page=0 index=10 + - Content: page=0 mcid=13 + - Content: page=0 mcid=14 diff --git a/tests/ref/pdftags/break-tags-nested-parbreak.yml b/tests/ref/pdftags/break-tags-nested-parbreak.yml new file mode 100644 index 0000000000..8f1c4e5051 --- /dev/null +++ b/tests/ref/pdftags/break-tags-nested-parbreak.yml @@ -0,0 +1,29 @@ +- Tag: P + /K: + - Content: page=0 mcid=0 + - Content: page=0 mcid=1 +- Tag: Link + /Placement: Block + /K: + - Annotation: page=0 index=0 + - Annotation: page=0 index=1 + - Annotation: page=0 index=2 + - Annotation: page=0 index=3 + - Tag: InlineQuote + /K: + - Tag: P + /K: + - Content: page=0 mcid=2 + - Content: page=0 mcid=3 + - Tag: P + /K: + - Content: page=0 mcid=4 + - Content: page=0 mcid=5 +- Tag: P + /K: + - Tag: Link + /K: + - Content: page=0 mcid=6 + - Annotation: page=0 index=4 + - Content: page=0 mcid=7 + - Content: page=0 mcid=8 diff --git a/tests/ref/pdftags/deco-tags-different-color.yml b/tests/ref/pdftags/deco-tags-different-color.yml new file mode 100644 index 0000000000..9e52b7d413 --- /dev/null +++ b/tests/ref/pdftags/deco-tags-different-color.yml @@ -0,0 +1,13 @@ +- Tag: P + /K: + - Tag: Span + /TextDecorationColor: #ff4136 + /TextDecorationType: Underline + /K: + - Content: page=0 mcid=0 + - Tag: Span + /TextDecorationColor: #0074d9 + /TextDecorationType: Underline + /K: + - Content: page=0 mcid=1 + - Content: page=0 mcid=2 diff --git a/tests/ref/pdftags/deco-tags-different-stroke-thickness.yml b/tests/ref/pdftags/deco-tags-different-stroke-thickness.yml new file mode 100644 index 0000000000..07b658be96 --- /dev/null +++ b/tests/ref/pdftags/deco-tags-different-stroke-thickness.yml @@ -0,0 +1,13 @@ +- Tag: P + /K: + - Tag: Span + /TextDecorationThickness: 2.000 + /TextDecorationType: Underline + /K: + - Content: page=0 mcid=0 + - Tag: Span + /TextDecorationThickness: 1.000 + /TextDecorationType: Underline + /K: + - Content: page=0 mcid=1 + - Content: page=0 mcid=2 diff --git a/tests/ref/pdftags/deco-tags-different-type.yml b/tests/ref/pdftags/deco-tags-different-type.yml new file mode 100644 index 0000000000..2d26ea4343 --- /dev/null +++ b/tests/ref/pdftags/deco-tags-different-type.yml @@ -0,0 +1,14 @@ +- Tag: P + /K: + - Tag: Span + /TextDecorationType: Underline + /K: + - Content: page=0 mcid=0 + - Tag: Span + /TextDecorationType: Overline + /K: + - Content: page=0 mcid=1 + - Tag: Span + /TextDecorationType: LineThrough + /K: + - Content: page=0 mcid=2 diff --git a/tests/ref/pdftags/deco-tags-emph-basic.yml b/tests/ref/pdftags/deco-tags-emph-basic.yml new file mode 100644 index 0000000000..64296d1263 --- /dev/null +++ b/tests/ref/pdftags/deco-tags-emph-basic.yml @@ -0,0 +1,7 @@ +- Tag: P + /K: + - Content: page=0 mcid=0 + - Tag: Em + /K: + - Content: page=0 mcid=1 + - Content: page=0 mcid=2 diff --git a/tests/ref/pdftags/deco-tags-highlight-basic.yml b/tests/ref/pdftags/deco-tags-highlight-basic.yml new file mode 100644 index 0000000000..20d323228d --- /dev/null +++ b/tests/ref/pdftags/deco-tags-highlight-basic.yml @@ -0,0 +1,9 @@ +- Tag: P + /K: + - Content: page=0 mcid=0 + - Tag: Span + /BackgroundColor: #fffd11 + /K: + - Content: page=0 mcid=1 + - Content: page=0 mcid=2 + - Content: page=0 mcid=3 diff --git a/tests/ref/pdftags/deco-tags-script-custom-baseline.yml b/tests/ref/pdftags/deco-tags-script-custom-baseline.yml new file mode 100644 index 0000000000..5cfc27a12f --- /dev/null +++ b/tests/ref/pdftags/deco-tags-script-custom-baseline.yml @@ -0,0 +1,13 @@ +- Tag: P + /K: + - Tag: Span + /BaselineShift: -2.500 + /LineHeight: 6.000 + /K: + - Content: page=0 mcid=0 + - Content: page=0 mcid=1 + - Tag: Span + /BaselineShift: 9.500 + /LineHeight: 6.000 + /K: + - Content: page=0 mcid=2 diff --git a/tests/ref/pdftags/deco-tags-strong-and-em.yml b/tests/ref/pdftags/deco-tags-strong-and-em.yml new file mode 100644 index 0000000000..0b2d7f3460 --- /dev/null +++ b/tests/ref/pdftags/deco-tags-strong-and-em.yml @@ -0,0 +1,7 @@ +- Tag: P + /K: + - Tag: Em + /K: + - Tag: Strong + /K: + - Content: page=0 mcid=0 diff --git a/tests/ref/pdftags/deco-tags-strong-basic.yml b/tests/ref/pdftags/deco-tags-strong-basic.yml new file mode 100644 index 0000000000..2380a7c8e1 --- /dev/null +++ b/tests/ref/pdftags/deco-tags-strong-basic.yml @@ -0,0 +1,8 @@ +- Tag: P + /K: + - Content: page=0 mcid=0 + - Tag: Strong + /K: + - Content: page=0 mcid=1 + - Content: page=0 mcid=2 + - Content: page=0 mcid=3 diff --git a/tests/ref/pdftags/deco-tags-strong-em-and-more-attrs.yml b/tests/ref/pdftags/deco-tags-strong-em-and-more-attrs.yml new file mode 100644 index 0000000000..a3014e58c4 --- /dev/null +++ b/tests/ref/pdftags/deco-tags-strong-em-and-more-attrs.yml @@ -0,0 +1,11 @@ +- Tag: P + /K: + - Tag: Em + /K: + - Tag: Strong + /K: + - Tag: Span + /TextDecorationColor: #2ecc40 + /TextDecorationType: Underline + /K: + - Content: page=0 mcid=0 diff --git a/tests/ref/pdftags/deco-tags-subscript-basic.yml b/tests/ref/pdftags/deco-tags-subscript-basic.yml new file mode 100644 index 0000000000..73ec673565 --- /dev/null +++ b/tests/ref/pdftags/deco-tags-subscript-basic.yml @@ -0,0 +1,14 @@ +- Tag: P + /K: + - Content: page=0 mcid=0 + - Tag: Span + /BaselineShift: -0.750 + /LineHeight: 6.000 + /K: + - Content: page=0 mcid=1 + - Content: page=0 mcid=2 + - Tag: Span + /BaselineShift: -0.750 + /LineHeight: 6.000 + /K: + - Content: page=0 mcid=3 diff --git a/tests/ref/pdftags/deco-tags-superscript-basic.yml b/tests/ref/pdftags/deco-tags-superscript-basic.yml new file mode 100644 index 0000000000..371e859971 --- /dev/null +++ b/tests/ref/pdftags/deco-tags-superscript-basic.yml @@ -0,0 +1,10 @@ +- Tag: P + /K: + - Content: page=0 mcid=0 + - Tag: Span + /BaselineShift: 3.500 + /LineHeight: 6.000 + /K: + - Content: page=0 mcid=1 + - Content: page=0 mcid=2 + - Content: page=0 mcid=3 diff --git a/tests/ref/pdftags/deco-tags-underline.yml b/tests/ref/pdftags/deco-tags-underline.yml new file mode 100644 index 0000000000..774825d4bf --- /dev/null +++ b/tests/ref/pdftags/deco-tags-underline.yml @@ -0,0 +1,15 @@ +- Tag: P + /K: + - Tag: Span + /TextDecorationColor: #ff4136 + /TextDecorationType: Underline + /K: + - Content: page=0 mcid=0 + - Content: page=0 mcid=1 +- Tag: P + /K: + - Tag: Span + /TextDecorationColor: #ff4136 + /TextDecorationType: Underline + /K: + - Content: page=0 mcid=2 diff --git a/tests/ref/pdftags/disable-tags-artifact.yml b/tests/ref/pdftags/disable-tags-artifact.yml new file mode 100644 index 0000000000..2f6317b834 --- /dev/null +++ b/tests/ref/pdftags/disable-tags-artifact.yml @@ -0,0 +1,8 @@ +- Tag: H1 + /T: "Heading 1" + /K: + - Content: page=0 mcid=0 +- Tag: H1 + /T: "Heading 2" + /K: + - Content: page=0 mcid=1 diff --git a/tests/ref/pdftags/disable-tags-broken-paragraph-artifact.yml b/tests/ref/pdftags/disable-tags-broken-paragraph-artifact.yml new file mode 100644 index 0000000000..b5c5bfa146 --- /dev/null +++ b/tests/ref/pdftags/disable-tags-broken-paragraph-artifact.yml @@ -0,0 +1,7 @@ +- Tag: P + /K: + - Content: page=0 mcid=0 +- Tag: P + /K: + - Content: page=0 mcid=1 + - Content: page=0 mcid=2 diff --git a/tests/ref/pdftags/disable-tags-broken-paragraph-hide.yml b/tests/ref/pdftags/disable-tags-broken-paragraph-hide.yml new file mode 100644 index 0000000000..b5c5bfa146 --- /dev/null +++ b/tests/ref/pdftags/disable-tags-broken-paragraph-hide.yml @@ -0,0 +1,7 @@ +- Tag: P + /K: + - Content: page=0 mcid=0 +- Tag: P + /K: + - Content: page=0 mcid=1 + - Content: page=0 mcid=2 diff --git a/tests/ref/pdftags/disable-tags-hide.yml b/tests/ref/pdftags/disable-tags-hide.yml new file mode 100644 index 0000000000..8c4b9e4c3b --- /dev/null +++ b/tests/ref/pdftags/disable-tags-hide.yml @@ -0,0 +1,4 @@ +- Tag: H1 + /T: "Hidden" + /K: + - Content: page=0 mcid=0 diff --git a/tests/ref/pdftags/disable-tags-partially-hidden-list.yml b/tests/ref/pdftags/disable-tags-partially-hidden-list.yml new file mode 100644 index 0000000000..8b6a44d851 --- /dev/null +++ b/tests/ref/pdftags/disable-tags-partially-hidden-list.yml @@ -0,0 +1,32 @@ +- Tag: H1 + /T: "Tail hidden" + /K: + - Content: page=0 mcid=0 +- Tag: L + /Numbering: Circle + /K: + - Tag: LI + /K: + - Tag: Lbl + /K: + - Content: page=0 mcid=1 + - Tag: LBody + /K: + - Content: page=0 mcid=2 + - Tag: LI + /K: + - Tag: Lbl + /K: + - Content: page=0 mcid=3 + - Tag: LBody + - Tag: L + /Numbering: Circle + /K: + - Tag: LI + /K: + - Tag: Lbl + - Tag: LBody +- Tag: H1 + /T: "Head hidden" + /K: + - Content: page=0 mcid=4 diff --git a/tests/ref/pdftags/disable-tags-tiling.yml b/tests/ref/pdftags/disable-tags-tiling.yml new file mode 100644 index 0000000000..0b34b34167 --- /dev/null +++ b/tests/ref/pdftags/disable-tags-tiling.yml @@ -0,0 +1,4 @@ +- Tag: H1 + /T: "Rectangle" + /K: + - Content: page=0 mcid=0 diff --git a/tests/ref/pdftags/enum-number-override-nested.yml b/tests/ref/pdftags/enum-number-override-nested.yml new file mode 100644 index 0000000000..2b6a31ff62 --- /dev/null +++ b/tests/ref/pdftags/enum-number-override-nested.yml @@ -0,0 +1,44 @@ +- Tag: L + /Numbering: Decimal + /K: + - Tag: LI + /K: + - Tag: Lbl + /K: + - Content: page=0 mcid=0 + - Tag: LBody + /K: + - Tag: P + /K: + - Content: page=0 mcid=1 + - Tag: LI + /K: + - Tag: Lbl + /K: + - Content: page=0 mcid=2 + - Tag: LBody + /K: + - Tag: P + /K: + - Content: page=0 mcid=3 + - Tag: L + /Numbering: Decimal + /K: + - Tag: LI + /K: + - Tag: Lbl + /K: + - Content: page=0 mcid=4 + - Tag: LBody + /K: + - Content: page=0 mcid=5 + - Tag: LI + /K: + - Tag: Lbl + /K: + - Content: page=0 mcid=6 + - Tag: LBody + /K: + - Tag: P + /K: + - Content: page=0 mcid=7 diff --git a/tests/ref/pdftags/figure-basic.yml b/tests/ref/pdftags/figure-basic.yml new file mode 100644 index 0000000000..1490d14612 --- /dev/null +++ b/tests/ref/pdftags/figure-basic.yml @@ -0,0 +1,112 @@ +- Tag: P + /K: + - Content: page=0 mcid=0 + - Tag: Link + /K: + - Content: page=0 mcid=1 + - Annotation: page=0 index=0 + - Content: page=0 mcid=2 + - Content: page=0 mcid=3 + - Tag: Link + /K: + - Content: page=0 mcid=4 + - Annotation: page=0 index=1 + - Content: page=0 mcid=5 + - Content: page=0 mcid=6 +- Tag: Table + /BBox: + page: 0 + left: 28.160 + top: 54.240 + right: 123.060 + bottom: 84.520 + /BorderColor: #000000 + /BorderThickness: 1.000 + /K: + - Tag: Caption + /K: + - Tag: Span + /Placement: Block + /K: + - Content: page=0 mcid=9 + - Tag: TR + /K: + - Tag: TD + /Headers: [] + /BorderStyle: Solid + /K: + - Content: page=0 mcid=7 + - Tag: TD + /Headers: [] + /BorderStyle: Solid + /K: + - Content: page=0 mcid=8 +- Tag: Div + /K: + - Tag: Caption + /K: + - Tag: Span + /Placement: Block + /K: + - Content: page=0 mcid=11 + - Tag: Figure + /Alt: "Sketch of white standing cylinder" + /Placement: Block + /BBox: + page: 0 + left: 46.654 + top: 90.400 + right: 103.346 + bottom: 147.093 + /K: + - Content: page=0 mcid=10 +- Tag: Table + /BBox: + page: 0 + left: 19.695 + top: 165.673 + right: 131.525 + bottom: 214.753 + /BorderColor: #000000 + /BorderThickness: 1.000 + /K: + - Tag: Caption + /K: + - Tag: Span + /Placement: Block + /K: + - Content: page=0 mcid=18 + - Tag: TR + /K: + - Tag: TD + /Headers: [] + /BorderStyle: Solid + /K: + - Content: page=0 mcid=12 + - Tag: TD + /Headers: [] + /BorderStyle: Solid + /K: + - Content: page=0 mcid=13 + - Tag: TD + /Headers: [] + /BorderStyle: Solid + /K: + - Content: page=0 mcid=14 + - Tag: TR + /K: + - Tag: TD + /Headers: [] + /BorderStyle: Solid + /K: + - Content: page=0 mcid=15 + - Tag: TD + /Headers: [] + /BorderStyle: Solid + /K: + - Content: page=0 mcid=16 + - Tag: TD + /Headers: [] + /BorderStyle: Solid + /K: + - Content: page=0 mcid=17 diff --git a/tests/ref/pdftags/figure-tags-additional-caption-inside-body.yml b/tests/ref/pdftags/figure-tags-additional-caption-inside-body.yml new file mode 100644 index 0000000000..6e6d056e73 --- /dev/null +++ b/tests/ref/pdftags/figure-tags-additional-caption-inside-body.yml @@ -0,0 +1,26 @@ +- Tag: Div + /K: + - Tag: Caption + /K: + - Tag: Span + /Placement: Block + /K: + - Content: page=0 mcid=2 + - Tag: Caption + /K: + - Tag: Span + /Placement: Block + /K: + - Content: page=0 mcid=3 + - Content: page=0 mcid=4 + - Tag: Div + /Placement: Block + /K: + - Tag: Figure + /Alt: "A tiger" + /Placement: Block + /K: + - Content: page=0 mcid=0 + - Tag: P + /K: + - Content: page=0 mcid=1 diff --git a/tests/ref/pdftags/figure-tags-alt-with-different-lang.yml b/tests/ref/pdftags/figure-tags-alt-with-different-lang.yml new file mode 100644 index 0000000000..dc217967eb --- /dev/null +++ b/tests/ref/pdftags/figure-tags-alt-with-different-lang.yml @@ -0,0 +1,17 @@ +lang: "de" +--- +- Tag: P + /K: + - Content: page=0 mcid=0 +- Tag: Figure + /Lang: "en-UK" + /Alt: "A tiger" + /Placement: Block + /BBox: + page: 0 + left: 10.000 + top: 28.580 + right: 110.000 + bottom: 94.010 + /K: + - Content: page=0 mcid=1 diff --git a/tests/ref/pdftags/figure-tags-block-equation-with-caption.yml b/tests/ref/pdftags/figure-tags-block-equation-with-caption.yml new file mode 100644 index 0000000000..8788e6ae26 --- /dev/null +++ b/tests/ref/pdftags/figure-tags-block-equation-with-caption.yml @@ -0,0 +1,26 @@ +- Tag: Div + /K: + - Tag: Caption + /K: + - Tag: Span + /Placement: Block + /K: + - Content: page=0 mcid=8 + - Tag: Formula + /Alt: "The Pythagorean theorem: a squared plus b squared is c squared" + /Placement: Block + /BBox: + page: 0 + left: 33.655 + top: 10.000 + right: 85.743 + bottom: 19.108 + /K: + - Content: page=0 mcid=0 + - Content: page=0 mcid=1 + - Content: page=0 mcid=2 + - Content: page=0 mcid=3 + - Content: page=0 mcid=4 + - Content: page=0 mcid=5 + - Content: page=0 mcid=6 + - Content: page=0 mcid=7 diff --git a/tests/ref/pdftags/figure-tags-image-basic.yml b/tests/ref/pdftags/figure-tags-image-basic.yml new file mode 100644 index 0000000000..5e28ba823d --- /dev/null +++ b/tests/ref/pdftags/figure-tags-image-basic.yml @@ -0,0 +1,11 @@ +- Tag: Figure + /Alt: "A tiger" + /Placement: Block + /BBox: + page: 0 + left: 10.000 + top: 10.000 + right: 110.000 + bottom: 75.430 + /K: + - Content: page=0 mcid=0 diff --git a/tests/ref/pdftags/figure-tags-image-figure-with-caption.yml b/tests/ref/pdftags/figure-tags-image-figure-with-caption.yml new file mode 100644 index 0000000000..65f2713d07 --- /dev/null +++ b/tests/ref/pdftags/figure-tags-image-figure-with-caption.yml @@ -0,0 +1,19 @@ +- Tag: Div + /K: + - Tag: Caption + /K: + - Tag: Span + /Placement: Block + /K: + - Content: page=0 mcid=1 + - Tag: Figure + /Alt: "A tiger" + /Placement: Block + /BBox: + page: 0 + left: 10.000 + top: 10.000 + right: 110.000 + bottom: 75.430 + /K: + - Content: page=0 mcid=0 diff --git a/tests/ref/pdftags/figure-tags-inline-equation-with-caption.yml b/tests/ref/pdftags/figure-tags-inline-equation-with-caption.yml new file mode 100644 index 0000000000..a67fb9c56f --- /dev/null +++ b/tests/ref/pdftags/figure-tags-inline-equation-with-caption.yml @@ -0,0 +1,27 @@ +- Tag: Div + /K: + - Tag: Caption + /K: + - Tag: Span + /Placement: Block + /K: + - Content: page=0 mcid=8 + - Tag: P + /K: + - Tag: Formula + /Alt: "The Pythagorean theorem: a squared plus b squared is c squared" + /BBox: + page: 0 + left: 33.655 + top: 8.552 + right: 85.743 + bottom: 17.660 + /K: + - Content: page=0 mcid=0 + - Content: page=0 mcid=1 + - Content: page=0 mcid=2 + - Content: page=0 mcid=3 + - Content: page=0 mcid=4 + - Content: page=0 mcid=5 + - Content: page=0 mcid=6 + - Content: page=0 mcid=7 diff --git a/tests/ref/pdftags/figure-tags-listing.yml b/tests/ref/pdftags/figure-tags-listing.yml new file mode 100644 index 0000000000..2d03b0c0c8 --- /dev/null +++ b/tests/ref/pdftags/figure-tags-listing.yml @@ -0,0 +1,26 @@ +- Tag: Code + /Placement: Block + /K: + - Tag: P + /K: + - Content: page=0 mcid=0 + - Content: page=0 mcid=1 + - Content: page=0 mcid=2 + - Content: page=0 mcid=3 + - Content: page=0 mcid=4 + - Content: page=0 mcid=5 + - Content: page=0 mcid=6 + - Tag: P + /K: + - Content: page=0 mcid=7 + - Content: page=0 mcid=8 + - Content: page=0 mcid=9 + - Content: page=0 mcid=10 + - Content: page=0 mcid=11 + - Content: page=0 mcid=12 + - Content: page=0 mcid=13 + - Content: page=0 mcid=14 + - Content: page=0 mcid=15 + - Tag: P + /K: + - Content: page=0 mcid=16 diff --git a/tests/ref/pdftags/figure-tags-only-marked-content.yml b/tests/ref/pdftags/figure-tags-only-marked-content.yml new file mode 100644 index 0000000000..e513a749de --- /dev/null +++ b/tests/ref/pdftags/figure-tags-only-marked-content.yml @@ -0,0 +1,2 @@ +- Tag: Figure + /Placement: Block diff --git a/tests/ref/pdftags/figure-tags-with-alt-flatten-content-basic.yml b/tests/ref/pdftags/figure-tags-with-alt-flatten-content-basic.yml new file mode 100644 index 0000000000..c8b558c7d8 --- /dev/null +++ b/tests/ref/pdftags/figure-tags-with-alt-flatten-content-basic.yml @@ -0,0 +1,26 @@ +- Tag: Figure + /Alt: "alt text" + /Placement: Block + /BBox: + page: 0 + left: 33.655 + top: 8.552 + right: 85.743 + bottom: 40.230 + /K: + - Content: page=0 mcid=0 + - Content: page=0 mcid=1 + - Content: page=0 mcid=2 + - Content: page=0 mcid=3 + - Content: page=0 mcid=4 + - Content: page=0 mcid=5 + - Content: page=0 mcid=6 + - Content: page=0 mcid=7 + - Content: page=0 mcid=8 + - Content: page=0 mcid=9 + - Content: page=0 mcid=10 + - Content: page=0 mcid=11 + - Content: page=0 mcid=12 + - Content: page=0 mcid=13 + - Content: page=0 mcid=14 + - Content: page=0 mcid=15 diff --git a/tests/ref/pdftags/figure-tags-with-alt-flatten-content-complex.yml b/tests/ref/pdftags/figure-tags-with-alt-flatten-content-complex.yml new file mode 100644 index 0000000000..671c812995 --- /dev/null +++ b/tests/ref/pdftags/figure-tags-with-alt-flatten-content-complex.yml @@ -0,0 +1,17 @@ +- Tag: Figure + /Alt: "alt text" + /Placement: Block + /BBox: + page: 0 + left: 9.500 + top: 9.500 + right: 110.500 + bottom: 76.332 + /K: + - Tag: Link + /K: + - Annotation: page=0 index=0 + - Content: page=0 mcid=0 + - Content: page=0 mcid=1 + - Content: page=0 mcid=2 + - Content: page=0 mcid=3 diff --git a/tests/ref/pdftags/footnote-tags-basic.yml b/tests/ref/pdftags/footnote-tags-basic.yml new file mode 100644 index 0000000000..f379e60a13 --- /dev/null +++ b/tests/ref/pdftags/footnote-tags-basic.yml @@ -0,0 +1,27 @@ +- Tag: P + /K: + - Content: page=0 mcid=0 + - Tag: Lbl + /K: + - Tag: Link + /K: + - Annotation: page=0 index=0 + - Tag: Span + /BaselineShift: 3.500 + /LineHeight: 6.000 + /K: + - Content: page=0 mcid=1 + - Tag: Note + /K: + - Tag: Lbl + /K: + - Tag: Link + /K: + - Annotation: page=0 index=1 + - Tag: Span + /BaselineShift: 2.975 + /LineHeight: 5.100 + /K: + - Content: page=0 mcid=3 + - Content: page=0 mcid=4 + - Content: page=0 mcid=2 diff --git a/tests/ref/pdftags/footnote-tags-different-lang.yml b/tests/ref/pdftags/footnote-tags-different-lang.yml new file mode 100644 index 0000000000..4241b97a43 --- /dev/null +++ b/tests/ref/pdftags/footnote-tags-different-lang.yml @@ -0,0 +1,28 @@ +- Tag: P + /K: + - Content: page=0 mcid=0 + - Tag: Lbl + /K: + - Tag: Link + /K: + - Annotation: page=0 index=0 + - Tag: Span + /BaselineShift: 3.500 + /LineHeight: 6.000 + /K: + - Content: page=0 mcid=1 + - Tag: Note + /Lang: "de" + /K: + - Tag: Lbl + /K: + - Tag: Link + /K: + - Annotation: page=0 index=1 + - Tag: Span + /BaselineShift: 2.975 + /LineHeight: 5.100 + /K: + - Content: page=0 mcid=3 + - Content: page=0 mcid=4 + - Content: page=0 mcid=2 diff --git a/tests/ref/pdftags/footnote-tags-ref-to-other-footnote.yml b/tests/ref/pdftags/footnote-tags-ref-to-other-footnote.yml new file mode 100644 index 0000000000..71de1906fd --- /dev/null +++ b/tests/ref/pdftags/footnote-tags-ref-to-other-footnote.yml @@ -0,0 +1,38 @@ +- Tag: P + /K: + - Content: page=0 mcid=0 + - Tag: Lbl + /K: + - Tag: Link + /K: + - Annotation: page=0 index=0 + - Tag: Span + /BaselineShift: 3.500 + /LineHeight: 6.000 + /K: + - Content: page=0 mcid=1 + - Tag: Note + /K: + - Tag: Lbl + /K: + - Tag: Link + /K: + - Annotation: page=0 index=2 + - Tag: Span + /BaselineShift: 2.975 + /LineHeight: 5.100 + /K: + - Content: page=0 mcid=5 + - Content: page=0 mcid=6 + - Content: page=0 mcid=2 + - Tag: Lbl + /K: + - Tag: Link + /K: + - Annotation: page=0 index=1 + - Tag: Span + /BaselineShift: 3.500 + /LineHeight: 6.000 + /K: + - Content: page=0 mcid=3 + - Content: page=0 mcid=4 diff --git a/tests/ref/pdftags/grid-headers.yml b/tests/ref/pdftags/grid-headers.yml new file mode 100644 index 0000000000..4249de4735 --- /dev/null +++ b/tests/ref/pdftags/grid-headers.yml @@ -0,0 +1,409 @@ +- Tag: Table + /BorderColor: #000000 + /K: + - Tag: THead + /K: + - Tag: TR + /K: + - Tag: TH + /Id: "U1x0y0" + /Scope: Column + /Headers: [] + /ColSpan: 5 + /BorderStyle: Solid + /BorderThickness: 1.000 + /K: + - Tag: Strong + /K: + - Content: page=0 mcid=0 + - Tag: TR + /K: + - Tag: TH + /Id: "U1x0y1" + /Scope: Column + /Headers: [] + /BorderColor: + before: #ff4136 + after: #ff4136 + start: #ff4136 + end: #7fdbff + /BorderStyle: Solid + /BorderThickness: 1.000 + /K: + - Tag: Strong + /K: + - Content: page=0 mcid=1 + - Tag: TH + /Id: "U1x1y1" + /Scope: Column + /Headers: [] + /BorderColor: + before: #7fdbff + after: #2ecc40 + start: #7fdbff + end: #7fdbff + /BorderStyle: Solid + /BorderThickness: 1.000 + /K: + - Tag: Strong + /K: + - Content: page=0 mcid=2 + - Tag: TH + /Id: "U1x2y1" + /Scope: Column + /Headers: [] + /BorderColor: + before: #000000 + after: #ffdc00 + start: #7fdbff + end: #000000 + /BorderStyle: Solid + /BorderThickness: 1.000 + /K: + - Tag: Strong + /K: + - Content: page=0 mcid=3 + - Tag: TH + /Id: "U1x3y1" + /Scope: Column + /Headers: [] + /BorderStyle: Solid + /BorderThickness: 1.000 + /K: + - Tag: Strong + /K: + - Content: page=0 mcid=4 + - Tag: TH + /Id: "U1x4y1" + /Scope: Column + /Headers: [] + /BorderStyle: Solid + /BorderThickness: 1.000 + /K: + - Tag: Strong + /K: + - Content: page=0 mcid=5 + - Tag: TBody + /K: + - Tag: TR + /K: + - Tag: TD + /Headers: ["U1x0y0", "U1x0y1"] + /BorderColor: + before: #ff4136 + after: #000000 + start: #000000 + end: #2ecc40 + /BorderStyle: Solid + /BorderThickness: 1.000 + /K: + - Content: page=0 mcid=6 + - Tag: TD + /Headers: ["U1x0y0", "U1x1y1"] + /BorderColor: + before: #2ecc40 + after: #2ecc40 + start: #2ecc40 + end: #0074d9 + /BorderStyle: Solid + /BorderThickness: 1.000 + /K: + - Content: page=0 mcid=7 + - Tag: TD + /Headers: ["U1x0y0", "U1x2y1"] + /BorderColor: + before: #ffdc00 + after: #0074d9 + start: #0074d9 + end: #0074d9 + /BorderStyle: Solid + /BorderThickness: 1.000 + /K: + - Content: page=0 mcid=8 + - Tag: TD + /Headers: ["U1x0y0", "U1x3y1"] + /BorderColor: + before: #000000 + after: #000000 + start: #0074d9 + end: #000000 + /BorderStyle: Solid + /BorderThickness: 1.000 + /K: + - Content: page=0 mcid=9 + - Tag: TD + /Headers: ["U1x0y0", "U1x4y1"] + /BorderColor: + before: #000000 + after: #ff4136 + start: #000000 + end: #000000 + /BorderStyle: Solid + /BorderThickness: 1.000 + /K: + - Content: page=0 mcid=10 + - Tag: TR + /K: + - Tag: TD + /Headers: ["U1x0y0", "U1x0y1"] + /BorderColor: + before: #000000 + after: #000000 + start: #000000 + end: #2ecc40 + /BorderStyle: Solid + /BorderThickness: 1.000 + /K: + - Content: page=0 mcid=11 + - Tag: TD + /Headers: ["U1x0y0", "U1x1y1"] + /BorderColor: + before: #2ecc40 + after: #2ecc40 + start: #2ecc40 + end: #0074d9 + /BorderStyle: Solid + /BorderThickness: 1.000 + /K: + - Content: page=0 mcid=12 + - Tag: TD + /Headers: ["U1x0y0", "U1x2y1"] + /BorderColor: #0074d9 + /BorderStyle: Solid + /BorderThickness: 1.000 + /K: + - Content: page=0 mcid=13 + - Tag: TD + /Headers: ["U1x0y0", "U1x3y1"] + /BorderColor: + before: #000000 + after: #000000 + start: #0074d9 + end: #000000 + /BorderStyle: Solid + /BorderThickness: 1.000 + /K: + - Content: page=0 mcid=14 + - Tag: TD + /Headers: ["U1x0y0", "U1x4y1"] + /BorderColor: + before: #ff4136 + after: #ff4136 + start: #000000 + end: #000000 + /BorderStyle: Solid + /BorderThickness: 1.000 + /K: + - Content: page=0 mcid=15 + - Tag: TR + /K: + - Tag: TD + /Headers: ["U1x0y0", "U1x0y1"] + /BorderColor: + before: #000000 + after: #000000 + start: #000000 + end: #2ecc40 + /BorderStyle: Solid + /BorderThickness: 1.000 + /K: + - Content: page=0 mcid=16 + - Tag: TD + /Headers: ["U1x0y0", "U1x1y1"] + /BorderColor: + before: #2ecc40 + after: #2ecc40 + start: #2ecc40 + end: #0074d9 + /BorderStyle: Solid + /BorderThickness: 1.000 + /K: + - Content: page=0 mcid=17 + - Tag: TD + /Headers: ["U1x0y0", "U1x2y1"] + /BorderColor: #0074d9 + /BorderStyle: Solid + /BorderThickness: 1.000 + /K: + - Content: page=0 mcid=18 + - Tag: TD + /Headers: ["U1x0y0", "U1x3y1"] + /BorderColor: + before: #000000 + after: #000000 + start: #0074d9 + end: #000000 + /BorderStyle: Solid + /BorderThickness: 1.000 + /K: + - Content: page=0 mcid=19 + - Tag: TD + /Headers: ["U1x0y0", "U1x4y1"] + /BorderColor: + before: #ff4136 + after: #ff4136 + start: #000000 + end: #000000 + /BorderStyle: Solid + /BorderThickness: 1.000 + /K: + - Content: page=0 mcid=20 + - Tag: TR + /K: + - Tag: TD + /Headers: ["U1x0y0", "U1x0y1"] + /BorderColor: + before: #000000 + after: #000000 + start: #000000 + end: #2ecc40 + /BorderStyle: Solid + /BorderThickness: 1.000 + /K: + - Content: page=0 mcid=21 + - Tag: TD + /Headers: ["U1x0y0", "U1x1y1"] + /BorderColor: + before: #2ecc40 + after: #2ecc40 + start: #2ecc40 + end: #0074d9 + /BorderStyle: Solid + /BorderThickness: 1.000 + /K: + - Content: page=0 mcid=22 + - Tag: TD + /Headers: ["U1x0y0", "U1x2y1"] + /BorderColor: #0074d9 + /BorderStyle: Solid + /BorderThickness: 1.000 + /K: + - Content: page=0 mcid=23 + - Tag: TD + /Headers: ["U1x0y0", "U1x3y1"] + /BorderColor: + before: #000000 + after: #000000 + start: #0074d9 + end: #000000 + /BorderStyle: Solid + /BorderThickness: 1.000 + /K: + - Content: page=0 mcid=24 + - Tag: TD + /Headers: ["U1x0y0", "U1x4y1"] + /BorderColor: + before: #ff4136 + after: #ff4136 + start: #000000 + end: #000000 + /BorderStyle: Solid + /BorderThickness: 1.000 + /K: + - Content: page=0 mcid=25 + - Tag: TR + /K: + - Tag: TD + /Headers: ["U1x0y0", "U1x0y1"] + /BorderColor: + before: #000000 + after: #000000 + start: #000000 + end: #2ecc40 + /BorderStyle: Solid + /BorderThickness: 1.000 + /K: + - Content: page=1 mcid=0 + - Tag: TD + /Headers: ["U1x0y0", "U1x1y1"] + /BorderColor: + before: #2ecc40 + after: #2ecc40 + start: #2ecc40 + end: #0074d9 + /BorderStyle: Solid + /BorderThickness: 1.000 + /K: + - Content: page=1 mcid=1 + - Tag: TD + /Headers: ["U1x0y0", "U1x2y1"] + /BorderColor: #0074d9 + /BorderStyle: Solid + /BorderThickness: 1.000 + /K: + - Content: page=1 mcid=2 + - Tag: TD + /Headers: ["U1x0y0", "U1x3y1"] + /BorderColor: + before: #000000 + after: #000000 + start: #0074d9 + end: #000000 + /BorderStyle: Solid + /BorderThickness: 1.000 + /K: + - Content: page=1 mcid=3 + - Tag: TD + /Headers: ["U1x0y0", "U1x4y1"] + /BorderColor: + before: #ff4136 + after: #ff4136 + start: #000000 + end: #000000 + /BorderStyle: Solid + /BorderThickness: 1.000 + /K: + - Content: page=1 mcid=4 + - Tag: TR + /K: + - Tag: TD + /Headers: ["U1x0y0", "U1x0y1"] + /BorderColor: + before: #000000 + after: #000000 + start: #000000 + end: #2ecc40 + /BorderStyle: Solid + /BorderThickness: 1.000 + /K: + - Content: page=1 mcid=5 + - Tag: TD + /Headers: ["U1x0y0", "U1x1y1"] + /BorderColor: + before: #2ecc40 + after: #2ecc40 + start: #2ecc40 + end: #0074d9 + /BorderStyle: Solid + /BorderThickness: 1.000 + /K: + - Content: page=1 mcid=6 + - Tag: TD + /Headers: ["U1x0y0", "U1x2y1"] + /BorderColor: #0074d9 + /BorderStyle: Solid + /BorderThickness: 1.000 + /K: + - Content: page=1 mcid=7 + - Tag: TD + /Headers: ["U1x0y0", "U1x3y1"] + /BorderColor: + before: #000000 + after: #000000 + start: #0074d9 + end: #000000 + /BorderStyle: Solid + /BorderThickness: 1.000 + /K: + - Content: page=1 mcid=8 + - Tag: TD + /Headers: ["U1x0y0", "U1x4y1"] + /BorderColor: + before: #ff4136 + after: #ff4136 + start: #000000 + end: #000000 + /BorderStyle: Solid + /BorderThickness: 1.000 + /K: + - Content: page=1 mcid=9 diff --git a/tests/ref/pdftags/grid-tags-cell-breaking.yml b/tests/ref/pdftags/grid-tags-cell-breaking.yml new file mode 100644 index 0000000000..c6b3489e5d --- /dev/null +++ b/tests/ref/pdftags/grid-tags-cell-breaking.yml @@ -0,0 +1,48 @@ +- Tag: Div + /K: + - Tag: Div + /K: + - Tag: P + /K: + - Content: page=0 mcid=0 + - Content: page=0 mcid=1 + - Tag: P + /K: + - Content: page=0 mcid=2 + - Content: page=0 mcid=3 + - Content: page=0 mcid=4 + - Content: page=1 mcid=0 + - Content: page=1 mcid=1 + - Content: page=1 mcid=2 + - Content: page=1 mcid=3 + - Tag: Div + /K: + - Tag: Span + /Placement: Block + /K: + - Content: page=0 mcid=5 + - Content: page=0 mcid=6 + - Tag: Div + /K: + - Tag: Span + /Placement: Block + /K: + - Content: page=1 mcid=4 + - Tag: Div + /K: + - Tag: Span + /Placement: Block + /K: + - Content: page=1 mcid=5 + - Tag: Div + /K: + - Tag: Span + /Placement: Block + /K: + - Content: page=2 mcid=0 + - Tag: Div + /K: + - Tag: Span + /Placement: Block + /K: + - Content: page=2 mcid=1 diff --git a/tests/ref/pdftags/grid-tags-internal-grid-layout-breaking-bibliography.yml b/tests/ref/pdftags/grid-tags-internal-grid-layout-breaking-bibliography.yml new file mode 100644 index 0000000000..792a5684bd --- /dev/null +++ b/tests/ref/pdftags/grid-tags-internal-grid-layout-breaking-bibliography.yml @@ -0,0 +1,41 @@ +- Tag: P + /K: + - Tag: Link + /K: + - Content: page=0 mcid=0 + - Annotation: page=0 index=0 +- Tag: H1 + /T: "Bibliography" + /K: + - Content: page=0 mcid=1 +- Tag: L + /Numbering: Decimal + /K: + - Tag: LI + /K: + - Tag: Lbl + /K: + - Tag: Link + /K: + - Content: page=0 mcid=2 + - Annotation: page=0 index=1 + - Tag: LBody + /K: + - Tag: BibEntry + /K: + - Content: page=0 mcid=3 + - Tag: Em + /K: + - Content: page=0 mcid=4 + - Content: page=0 mcid=5 + - Content: page=0 mcid=6 + - Content: page=0 mcid=7 + - Content: page=0 mcid=8 + - Content: page=0 mcid=9 + - Tag: Link + /K: + - Content: page=0 mcid=10 + - Annotation: page=0 index=2 + - Content: page=1 mcid=0 + - Annotation: page=1 index=0 + - Content: page=1 mcid=1 diff --git a/tests/ref/pdftags/grid-tags-rowspan-split-3.yml b/tests/ref/pdftags/grid-tags-rowspan-split-3.yml new file mode 100644 index 0000000000..d04d69cb41 --- /dev/null +++ b/tests/ref/pdftags/grid-tags-rowspan-split-3.yml @@ -0,0 +1,96 @@ +- Tag: Div + /K: + - Tag: Div + /K: + - Tag: Strong + /Placement: Block + /K: + - Content: page=0 mcid=4 + - Tag: P + /K: + - Content: page=0 mcid=5 + - Content: page=0 mcid=6 + - Content: page=1 mcid=4 + - Content: page=1 mcid=5 + - Content: page=2 mcid=2 + - Content: page=2 mcid=3 + - Content: page=3 mcid=0 + - Content: page=3 mcid=1 + - Content: page=4 mcid=0 + - Content: page=4 mcid=1 + - Tag: Strong + /Placement: Block + /K: + - Content: page=4 mcid=2 + - Tag: Div + /K: + - Tag: Span + /Placement: Block + /K: + - Content: page=0 mcid=0 + - Tag: Div + /K: + - Tag: Span + /Placement: Block + /K: + - Content: page=0 mcid=1 + - Tag: Div + /K: + - Tag: Span + /Placement: Block + /K: + - Content: page=0 mcid=2 + - Tag: Div + /K: + - Tag: Span + /Placement: Block + /K: + - Content: page=0 mcid=3 + - Tag: Div + /K: + - Tag: Span + /Placement: Block + /K: + - Content: page=1 mcid=0 + - Tag: Div + /K: + - Tag: Span + /Placement: Block + /K: + - Content: page=1 mcid=1 + - Tag: Div + /K: + - Tag: Span + /Placement: Block + /K: + - Content: page=1 mcid=2 + - Tag: Div + /K: + - Tag: Span + /Placement: Block + /K: + - Content: page=1 mcid=3 + - Tag: Div + /K: + - Tag: Span + /Placement: Block + /K: + - Content: page=2 mcid=0 + - Tag: Div + /K: + - Tag: Span + /Placement: Block + /K: + - Content: page=2 mcid=1 + - Tag: Div + /K: + - Tag: Span + /Placement: Block + /K: + - Content: page=4 mcid=3 + - Tag: Div + /K: + - Tag: Span + /Placement: Block + /K: + - Content: page=4 mcid=4 diff --git a/tests/ref/pdftags/grid-tags-rowspan.yml b/tests/ref/pdftags/grid-tags-rowspan.yml new file mode 100644 index 0000000000..8a0d008c8d --- /dev/null +++ b/tests/ref/pdftags/grid-tags-rowspan.yml @@ -0,0 +1,45 @@ +- Tag: Div + /K: + - Tag: Div + /K: + - Tag: Code + /Placement: Block + /K: + - Content: page=0 mcid=4 + - Tag: Div + /K: + - Tag: Span + /Placement: Block + /K: + - Content: page=0 mcid=0 + - Tag: Div + /K: + - Tag: Span + /Placement: Block + /K: + - Content: page=0 mcid=1 + - Tag: Div + /K: + - Tag: Span + /Placement: Block + /K: + - Content: page=0 mcid=2 + - Tag: Div + /K: + - Tag: Span + /Placement: Block + /K: + - Content: page=0 mcid=3 + - Tag: Div + /K: + - Tag: Span + /Placement: Block + /TextDecorationType: Underline + /K: + - Content: page=0 mcid=5 + - Tag: Div + /K: + - Tag: Span + /Placement: Block + /K: + - Content: page=0 mcid=6 diff --git a/tests/ref/pdftags/heading-offset.yml b/tests/ref/pdftags/heading-offset.yml new file mode 100644 index 0000000000..a08d5d9425 --- /dev/null +++ b/tests/ref/pdftags/heading-offset.yml @@ -0,0 +1,30 @@ +- Tag: H1 + /T: "Level 1" + /K: + - Content: page=0 mcid=0 + - Content: page=0 mcid=1 +- Tag: H1 + /T: "We're twins" + /K: + - Content: page=0 mcid=2 + - Content: page=0 mcid=3 +- Tag: H1 + /T: "We're twins" + /K: + - Content: page=0 mcid=4 + - Content: page=0 mcid=5 +- Tag: H2 + /T: "Real level 2" + /K: + - Content: page=0 mcid=6 + - Content: page=0 mcid=7 +- Tag: H2 + /T: "Fake level 2" + /K: + - Content: page=0 mcid=8 + - Content: page=0 mcid=9 +- Tag: H3 + /T: "Fake level 3" + /K: + - Content: page=0 mcid=10 + - Content: page=0 mcid=11 diff --git a/tests/ref/pdftags/heading-tags-basic.yml b/tests/ref/pdftags/heading-tags-basic.yml new file mode 100644 index 0000000000..454dead021 --- /dev/null +++ b/tests/ref/pdftags/heading-tags-basic.yml @@ -0,0 +1,12 @@ +- Tag: H1 + /T: "Level 1" + /K: + - Content: page=0 mcid=0 +- Tag: H2 + /T: "Level 2" + /K: + - Content: page=0 mcid=1 +- Tag: H3 + /T: "Level 3" + /K: + - Content: page=0 mcid=2 diff --git a/tests/ref/pdftags/heading-tags-complex.yml b/tests/ref/pdftags/heading-tags-complex.yml new file mode 100644 index 0000000000..f690503175 --- /dev/null +++ b/tests/ref/pdftags/heading-tags-complex.yml @@ -0,0 +1,52 @@ +- Tag: H1 + /T: "Level 1" + /K: + - Content: page=0 mcid=0 +- Tag: H2 + /T: "Level 2" + /K: + - Content: page=0 mcid=1 +- Tag: H3 + /T: "Level 3" + /K: + - Content: page=0 mcid=2 +- Tag: H3 + /T: "Level 3" + /K: + - Content: page=0 mcid=3 +- Tag: H2 + /T: "Level 2" + /K: + - Content: page=0 mcid=4 +- Tag: H3 + /T: "Level 3" + /K: + - Content: page=0 mcid=5 +- Tag: H4 + /T: "Level 4" + /K: + - Content: page=0 mcid=6 +- Tag: H2 + /T: "Level 2" + /K: + - Content: page=0 mcid=7 +- Tag: H3 + /T: "Level 3" + /K: + - Content: page=0 mcid=8 +- Tag: H3 + /T: "Level 3" + /K: + - Content: page=0 mcid=9 +- Tag: H3 + /T: "Level 3" + /K: + - Content: page=0 mcid=10 +- Tag: H1 + /T: "Level 1" + /K: + - Content: page=0 mcid=11 +- Tag: H2 + /T: "Level 2" + /K: + - Content: page=0 mcid=12 diff --git a/tests/ref/pdftags/lang-tags-pars-basic.yml b/tests/ref/pdftags/lang-tags-pars-basic.yml new file mode 100644 index 0000000000..a11c265bf6 --- /dev/null +++ b/tests/ref/pdftags/lang-tags-pars-basic.yml @@ -0,0 +1,13 @@ +lang: "uk" +--- +- Tag: P + /K: + - Content: page=0 mcid=0 +- Tag: P + /Lang: "sr" + /K: + - Content: page=0 mcid=1 +- Tag: P + /Lang: "be" + /K: + - Content: page=0 mcid=2 diff --git a/tests/ref/pdftags/lang-tags-propagation.yml b/tests/ref/pdftags/lang-tags-propagation.yml new file mode 100644 index 0000000000..6b0b2f5346 --- /dev/null +++ b/tests/ref/pdftags/lang-tags-propagation.yml @@ -0,0 +1,50 @@ +lang: "nl" +--- +- Tag: P + /K: + - Content: page=0 mcid=0 +- Tag: L + /Lang: "es-CO" + /Numbering: Circle + /K: + - Tag: LI + /K: + - Tag: Lbl + /K: + - Content: page=0 mcid=1 + - Tag: LBody + /Lang: "de" + /K: + - Tag: P + /K: + - Content: page=0 mcid=2 + - Tag: L + /Numbering: Circle + /K: + - Tag: LI + /K: + - Tag: Lbl + /K: + - Content: page=0 mcid=3 + - Tag: LBody + /Lang: "de-AT" + /K: + - Content: page=0 mcid=4 + - Tag: LI + /K: + - Tag: Lbl + /K: + - Content: page=0 mcid=5 + - Tag: LBody + /Lang: "de" + /K: + - Content: page=0 mcid=6 + - Tag: LI + /K: + - Tag: Lbl + /K: + - Content: page=0 mcid=7 + - Tag: LBody + /Lang: "de" + /K: + - Content: page=0 mcid=8 diff --git a/tests/ref/pdftags/layout-tags-placement-float.yml b/tests/ref/pdftags/layout-tags-placement-float.yml new file mode 100644 index 0000000000..8aa9947a32 --- /dev/null +++ b/tests/ref/pdftags/layout-tags-placement-float.yml @@ -0,0 +1,36 @@ +lang: "de" +--- +- Tag: Div + /Lang: "be" + /K: + - Tag: Div + /K: + - Tag: P + /K: + - Content: page=0 mcid=1 + - Tag: Code + /Lang: "en" + /Placement: Block + /K: + - Content: page=0 mcid=0 + - Tag: Div + /Lang: "de" + /K: + - Tag: P + /K: + - Content: page=0 mcid=3 + - Tag: Span + /Placement: Block + /K: + - Content: page=0 mcid=2 + - Tag: P + /K: + - Content: page=0 mcid=4 + - Tag: Div + /Lang: "es" + /K: + - Tag: Span + /Placement: Block + /K: + - Content: page=0 mcid=5 + - Tag: Div diff --git a/tests/ref/pdftags/link-basic.yml b/tests/ref/pdftags/link-basic.yml new file mode 100644 index 0000000000..c40e6738c6 --- /dev/null +++ b/tests/ref/pdftags/link-basic.yml @@ -0,0 +1,36 @@ +- Tag: P + /K: + - Tag: Link + /K: + - Content: page=0 mcid=0 + - Annotation: page=0 index=0 +- Tag: P + /K: + - Tag: Link + /K: + - Content: page=0 mcid=1 + - Annotation: page=0 index=1 +- Tag: P + /K: + - Content: page=0 mcid=2 + - Tag: Link + /K: + - Content: page=0 mcid=3 + - Annotation: page=0 index=2 + - Content: page=0 mcid=4 + - Content: page=0 mcid=5 +- Tag: P + /K: + - Content: page=0 mcid=6 + - Tag: Link + /K: + - Content: page=0 mcid=7 + - Annotation: page=0 index=3 + - Content: page=0 mcid=8 + - Content: page=0 mcid=9 + - Tag: Link + /K: + - Content: page=0 mcid=10 + - Annotation: page=0 index=4 + - Content: page=0 mcid=11 + - Content: page=0 mcid=12 diff --git a/tests/ref/pdftags/link-tags-contact-prefix.yml b/tests/ref/pdftags/link-tags-contact-prefix.yml new file mode 100644 index 0000000000..24def55916 --- /dev/null +++ b/tests/ref/pdftags/link-tags-contact-prefix.yml @@ -0,0 +1,12 @@ +- Tag: P + /K: + - Tag: Link + /K: + - Content: page=0 mcid=0 + - Annotation: page=0 index=0 +- Tag: P + /K: + - Tag: Link + /K: + - Content: page=0 mcid=1 + - Annotation: page=0 index=1 diff --git a/tests/ref/pdftags/link-tags-heading-with-numbering.yml b/tests/ref/pdftags/link-tags-heading-with-numbering.yml new file mode 100644 index 0000000000..db29c19409 --- /dev/null +++ b/tests/ref/pdftags/link-tags-heading-with-numbering.yml @@ -0,0 +1,11 @@ +- Tag: H1 + /T: "Heading" + /K: + - Content: page=0 mcid=0 + - Content: page=0 mcid=1 +- Tag: P + /K: + - Tag: Link + /K: + - Content: page=0 mcid=2 + - Annotation: page=0 index=0 diff --git a/tests/ref/pdftags/link-tags-heading-without-numbering.yml b/tests/ref/pdftags/link-tags-heading-without-numbering.yml new file mode 100644 index 0000000000..9dc85eb6e9 --- /dev/null +++ b/tests/ref/pdftags/link-tags-heading-without-numbering.yml @@ -0,0 +1,10 @@ +- Tag: H1 + /T: "Heading" + /K: + - Content: page=0 mcid=0 +- Tag: P + /K: + - Tag: Link + /K: + - Content: page=0 mcid=1 + - Annotation: page=0 index=0 diff --git a/tests/ref/pdftags/link-tags-non-refable-location.yml b/tests/ref/pdftags/link-tags-non-refable-location.yml new file mode 100644 index 0000000000..813ed4125d --- /dev/null +++ b/tests/ref/pdftags/link-tags-non-refable-location.yml @@ -0,0 +1,9 @@ +- Tag: P + /K: + - Content: page=0 mcid=0 +- Tag: P + /K: + - Tag: Link + /K: + - Content: page=0 mcid=1 + - Annotation: page=0 index=0 diff --git a/tests/ref/pdftags/link-tags-position.yml b/tests/ref/pdftags/link-tags-position.yml new file mode 100644 index 0000000000..00395dd136 --- /dev/null +++ b/tests/ref/pdftags/link-tags-position.yml @@ -0,0 +1,6 @@ +- Tag: P + /K: + - Tag: Link + /K: + - Content: page=0 mcid=0 + - Annotation: page=0 index=0 diff --git a/tests/ref/pdftags/link-tags-with-parbreak.yml b/tests/ref/pdftags/link-tags-with-parbreak.yml new file mode 100644 index 0000000000..91aa18d35d --- /dev/null +++ b/tests/ref/pdftags/link-tags-with-parbreak.yml @@ -0,0 +1,14 @@ +- Tag: P + /K: + - Content: page=0 mcid=0 + - Tag: Link + /K: + - Content: page=0 mcid=1 + - Annotation: page=0 index=0 +- Tag: P + /K: + - Tag: Link + /K: + - Content: page=0 mcid=2 + - Annotation: page=0 index=1 + - Content: page=0 mcid=3 diff --git a/tests/ref/pdftags/list-indent-specifics.yml b/tests/ref/pdftags/list-indent-specifics.yml new file mode 100644 index 0000000000..74b18057e5 --- /dev/null +++ b/tests/ref/pdftags/list-indent-specifics.yml @@ -0,0 +1,40 @@ +- Tag: L + /Numbering: Circle + /K: + - Tag: LI + /K: + - Tag: Lbl + /K: + - Content: page=0 mcid=0 + - Tag: LBody + /K: + - Tag: P + /K: + - Content: page=0 mcid=1 + - Tag: L + /Numbering: Circle + /K: + - Tag: LI + /K: + - Tag: Lbl + /K: + - Content: page=0 mcid=2 + - Tag: LBody + /K: + - Content: page=0 mcid=3 + - Tag: LI + /K: + - Tag: Lbl + /K: + - Content: page=0 mcid=4 + - Tag: LBody + /K: + - Content: page=0 mcid=5 + - Tag: LI + /K: + - Tag: Lbl + /K: + - Content: page=0 mcid=6 + - Tag: LBody + /K: + - Content: page=0 mcid=7 diff --git a/tests/ref/pdftags/list-tags-basic.yml b/tests/ref/pdftags/list-tags-basic.yml new file mode 100644 index 0000000000..0580afd41b --- /dev/null +++ b/tests/ref/pdftags/list-tags-basic.yml @@ -0,0 +1,74 @@ +- Tag: L + /Numbering: Circle + /K: + - Tag: LI + /K: + - Tag: Lbl + /K: + - Content: page=0 mcid=0 + - Tag: LBody + /K: + - Tag: P + /K: + - Content: page=0 mcid=1 + - Tag: L + /Numbering: Circle + /K: + - Tag: LI + /K: + - Tag: Lbl + /K: + - Content: page=0 mcid=2 + - Tag: LBody + /K: + - Content: page=0 mcid=3 + - Tag: LI + /K: + - Tag: Lbl + /K: + - Content: page=0 mcid=4 + - Tag: LBody + /K: + - Tag: P + /K: + - Content: page=0 mcid=5 + - Tag: L + /Numbering: Circle + /K: + - Tag: LI + /K: + - Tag: Lbl + /K: + - Content: page=0 mcid=6 + - Tag: LBody + /K: + - Tag: P + /K: + - Content: page=0 mcid=7 + - Tag: L + /Numbering: Circle + /K: + - Tag: LI + /K: + - Tag: Lbl + /K: + - Content: page=0 mcid=8 + - Tag: LBody + /K: + - Content: page=0 mcid=9 + - Tag: LI + /K: + - Tag: Lbl + /K: + - Content: page=0 mcid=10 + - Tag: LBody + /K: + - Content: page=0 mcid=11 + - Tag: LI + /K: + - Tag: Lbl + /K: + - Content: page=0 mcid=12 + - Tag: LBody + /K: + - Content: page=0 mcid=13 diff --git a/tests/ref/pdftags/list-tags-complex-item-with-nested-list.yml b/tests/ref/pdftags/list-tags-complex-item-with-nested-list.yml new file mode 100644 index 0000000000..059737f894 --- /dev/null +++ b/tests/ref/pdftags/list-tags-complex-item-with-nested-list.yml @@ -0,0 +1,77 @@ +- Tag: L + /Numbering: Circle + /K: + - Tag: LI + /K: + - Tag: Lbl + /K: + - Content: page=0 mcid=0 + - Tag: LBody + /K: + - Tag: BlockQuote + /K: + - Tag: Span + /Placement: Block + /K: + - Content: page=0 mcid=1 + - Tag: P + /K: + - Tag: Lbl + /K: + - Tag: Link + /K: + - Annotation: page=0 index=0 + - Tag: Span + /BaselineShift: 3.500 + /LineHeight: 6.000 + /K: + - Content: page=0 mcid=2 + - Tag: Note + /K: + - Tag: Lbl + /K: + - Tag: Link + /K: + - Annotation: page=0 index=1 + - Tag: Span + /BaselineShift: 2.975 + /LineHeight: 5.100 + /K: + - Content: page=0 mcid=12 + - Content: page=0 mcid=13 + - Content: page=0 mcid=3 + - Tag: L + /Numbering: Circle + /K: + - Tag: LI + /K: + - Tag: Lbl + /K: + - Content: page=0 mcid=4 + - Tag: LBody + /K: + - Content: page=0 mcid=5 + - Tag: LI + /K: + - Tag: Lbl + /K: + - Content: page=0 mcid=6 + - Tag: LBody + /K: + - Content: page=0 mcid=7 + - Tag: LI + /K: + - Tag: Lbl + /K: + - Content: page=0 mcid=8 + - Tag: LBody + /K: + - Content: page=0 mcid=9 + - Tag: LI + /K: + - Tag: Lbl + /K: + - Content: page=0 mcid=10 + - Tag: LBody + /K: + - Content: page=0 mcid=11 diff --git a/tests/ref/pdftags/list-tags-complex-item-with-sub-list.yml b/tests/ref/pdftags/list-tags-complex-item-with-sub-list.yml new file mode 100644 index 0000000000..059737f894 --- /dev/null +++ b/tests/ref/pdftags/list-tags-complex-item-with-sub-list.yml @@ -0,0 +1,77 @@ +- Tag: L + /Numbering: Circle + /K: + - Tag: LI + /K: + - Tag: Lbl + /K: + - Content: page=0 mcid=0 + - Tag: LBody + /K: + - Tag: BlockQuote + /K: + - Tag: Span + /Placement: Block + /K: + - Content: page=0 mcid=1 + - Tag: P + /K: + - Tag: Lbl + /K: + - Tag: Link + /K: + - Annotation: page=0 index=0 + - Tag: Span + /BaselineShift: 3.500 + /LineHeight: 6.000 + /K: + - Content: page=0 mcid=2 + - Tag: Note + /K: + - Tag: Lbl + /K: + - Tag: Link + /K: + - Annotation: page=0 index=1 + - Tag: Span + /BaselineShift: 2.975 + /LineHeight: 5.100 + /K: + - Content: page=0 mcid=12 + - Content: page=0 mcid=13 + - Content: page=0 mcid=3 + - Tag: L + /Numbering: Circle + /K: + - Tag: LI + /K: + - Tag: Lbl + /K: + - Content: page=0 mcid=4 + - Tag: LBody + /K: + - Content: page=0 mcid=5 + - Tag: LI + /K: + - Tag: Lbl + /K: + - Content: page=0 mcid=6 + - Tag: LBody + /K: + - Content: page=0 mcid=7 + - Tag: LI + /K: + - Tag: Lbl + /K: + - Content: page=0 mcid=8 + - Tag: LBody + /K: + - Content: page=0 mcid=9 + - Tag: LI + /K: + - Tag: Lbl + /K: + - Content: page=0 mcid=10 + - Tag: LBody + /K: + - Content: page=0 mcid=11 diff --git a/tests/ref/pdftags/list-tags-mixed-with-enum.yml b/tests/ref/pdftags/list-tags-mixed-with-enum.yml new file mode 100644 index 0000000000..90d0fb5797 --- /dev/null +++ b/tests/ref/pdftags/list-tags-mixed-with-enum.yml @@ -0,0 +1,74 @@ +- Tag: L + /Numbering: Circle + /K: + - Tag: LI + /K: + - Tag: Lbl + /K: + - Content: page=0 mcid=0 + - Tag: LBody + /K: + - Tag: P + /K: + - Content: page=0 mcid=1 + - Tag: L + /Numbering: Decimal + /K: + - Tag: LI + /K: + - Tag: Lbl + /K: + - Content: page=0 mcid=2 + - Tag: LBody + /K: + - Content: page=0 mcid=3 + - Tag: LI + /K: + - Tag: Lbl + /K: + - Content: page=0 mcid=4 + - Tag: LBody + /K: + - Tag: P + /K: + - Content: page=0 mcid=5 + - Tag: L + /Numbering: Decimal + /K: + - Tag: LI + /K: + - Tag: Lbl + /K: + - Content: page=0 mcid=6 + - Tag: LBody + /K: + - Tag: P + /K: + - Content: page=0 mcid=7 + - Tag: L + /Numbering: Circle + /K: + - Tag: LI + /K: + - Tag: Lbl + /K: + - Content: page=0 mcid=8 + - Tag: LBody + /K: + - Content: page=0 mcid=9 + - Tag: LI + /K: + - Tag: Lbl + /K: + - Content: page=0 mcid=10 + - Tag: LBody + /K: + - Content: page=0 mcid=11 + - Tag: LI + /K: + - Tag: Lbl + /K: + - Content: page=0 mcid=12 + - Tag: LBody + /K: + - Content: page=0 mcid=13 diff --git a/tests/ref/pdftags/list-tags-terms-basic-wide.yml b/tests/ref/pdftags/list-tags-terms-basic-wide.yml new file mode 100644 index 0000000000..ee79b9f407 --- /dev/null +++ b/tests/ref/pdftags/list-tags-terms-basic-wide.yml @@ -0,0 +1,39 @@ +- Tag: L + /Numbering: None + /K: + - Tag: LI + /K: + - Tag: Lbl + /K: + - Tag: Strong + /K: + - Content: page=0 mcid=0 + - Tag: LBody + /K: + - Tag: P + /K: + - Content: page=0 mcid=1 + - Tag: LI + /K: + - Tag: Lbl + /K: + - Tag: Strong + /K: + - Content: page=0 mcid=2 + - Tag: LBody + /K: + - Tag: P + /K: + - Content: page=0 mcid=3 + - Tag: LI + /K: + - Tag: Lbl + /K: + - Tag: Strong + /K: + - Content: page=0 mcid=4 + - Tag: LBody + /K: + - Tag: P + /K: + - Content: page=0 mcid=5 diff --git a/tests/ref/pdftags/list-tags-terms-basic.yml b/tests/ref/pdftags/list-tags-terms-basic.yml new file mode 100644 index 0000000000..a62a9e1310 --- /dev/null +++ b/tests/ref/pdftags/list-tags-terms-basic.yml @@ -0,0 +1,33 @@ +- Tag: L + /Numbering: None + /K: + - Tag: LI + /K: + - Tag: Lbl + /K: + - Tag: Strong + /K: + - Content: page=0 mcid=0 + - Tag: LBody + /K: + - Content: page=0 mcid=1 + - Tag: LI + /K: + - Tag: Lbl + /K: + - Tag: Strong + /K: + - Content: page=0 mcid=2 + - Tag: LBody + /K: + - Content: page=0 mcid=3 + - Tag: LI + /K: + - Tag: Lbl + /K: + - Tag: Strong + /K: + - Content: page=0 mcid=4 + - Tag: LBody + /K: + - Content: page=0 mcid=5 diff --git a/tests/ref/pdftags/list-tags-terms-body-with-parbreak.yml b/tests/ref/pdftags/list-tags-terms-body-with-parbreak.yml new file mode 100644 index 0000000000..c58635a00f --- /dev/null +++ b/tests/ref/pdftags/list-tags-terms-body-with-parbreak.yml @@ -0,0 +1,28 @@ +- Tag: L + /Numbering: None + /K: + - Tag: LI + /K: + - Tag: Lbl + /K: + - Tag: Strong + /K: + - Content: page=0 mcid=0 + - Tag: LBody + /K: + - Tag: P + /K: + - Content: page=0 mcid=1 + - Tag: P + /K: + - Content: page=0 mcid=2 + - Tag: LI + /K: + - Tag: Lbl + /K: + - Tag: Strong + /K: + - Content: page=0 mcid=3 + - Tag: LBody + /K: + - Content: page=0 mcid=4 diff --git a/tests/ref/pdftags/list-tags-terms-indented.yml b/tests/ref/pdftags/list-tags-terms-indented.yml new file mode 100644 index 0000000000..32b8dfbe58 --- /dev/null +++ b/tests/ref/pdftags/list-tags-terms-indented.yml @@ -0,0 +1,48 @@ +- Tag: L + /Numbering: None + /K: + - Tag: LI + /K: + - Tag: Lbl + /K: + - Tag: Strong + /K: + - Content: page=0 mcid=0 + - Tag: LBody + /K: + - Content: page=0 mcid=1 + - Tag: LI + /K: + - Tag: Lbl + /K: + - Tag: Strong + /K: + - Content: page=0 mcid=2 + - Tag: LBody + /K: + - Tag: P + /K: + - Content: page=0 mcid=3 + - Tag: L + /Numbering: None + /K: + - Tag: LI + /K: + - Tag: Lbl + /K: + - Tag: Strong + /K: + - Content: page=0 mcid=4 + - Tag: LBody + /K: + - Content: page=0 mcid=5 + - Tag: LI + /K: + - Tag: Lbl + /K: + - Tag: Strong + /K: + - Content: page=0 mcid=6 + - Tag: LBody + /K: + - Content: page=0 mcid=7 diff --git a/tests/ref/pdftags/list-tags-terms-label-with-parbreak.yml b/tests/ref/pdftags/list-tags-terms-label-with-parbreak.yml new file mode 100644 index 0000000000..56000368eb --- /dev/null +++ b/tests/ref/pdftags/list-tags-terms-label-with-parbreak.yml @@ -0,0 +1,32 @@ +- Tag: L + /Numbering: None + /K: + - Tag: LI + /K: + - Tag: Lbl + /K: + - Tag: P + /K: + - Tag: Strong + /K: + - Content: page=0 mcid=0 + - Tag: P + /K: + - Tag: Strong + /K: + - Content: page=0 mcid=1 + - Tag: LBody + /K: + - Tag: P + /K: + - Content: page=0 mcid=2 + - Tag: LI + /K: + - Tag: Lbl + /K: + - Tag: Strong + /K: + - Content: page=0 mcid=3 + - Tag: LBody + /K: + - Content: page=0 mcid=4 diff --git a/tests/ref/pdftags/list-tags-wide-with-nested-list.yml b/tests/ref/pdftags/list-tags-wide-with-nested-list.yml new file mode 100644 index 0000000000..0ee0dd7f61 --- /dev/null +++ b/tests/ref/pdftags/list-tags-wide-with-nested-list.yml @@ -0,0 +1,78 @@ +- Tag: L + /Numbering: Circle + /K: + - Tag: LI + /K: + - Tag: Lbl + /K: + - Content: page=0 mcid=0 + - Tag: LBody + /K: + - Tag: P + /K: + - Content: page=0 mcid=1 + - Tag: L + /Numbering: Circle + /K: + - Tag: LI + /K: + - Tag: Lbl + /K: + - Content: page=0 mcid=2 + - Tag: LBody + /K: + - Content: page=0 mcid=3 + - Tag: LI + /K: + - Tag: Lbl + /K: + - Content: page=0 mcid=4 + - Tag: LBody + /K: + - Tag: P + /K: + - Content: page=0 mcid=5 + - Tag: L + /Numbering: Circle + /K: + - Tag: LI + /K: + - Tag: Lbl + /K: + - Content: page=0 mcid=6 + - Tag: LBody + /K: + - Tag: P + /K: + - Content: page=0 mcid=7 + - Tag: L + /Numbering: Circle + /K: + - Tag: LI + /K: + - Tag: Lbl + /K: + - Content: page=0 mcid=8 + - Tag: LBody + /K: + - Content: page=0 mcid=9 + - Tag: LI + /K: + - Tag: Lbl + /K: + - Content: page=0 mcid=10 + - Tag: LBody + /K: + - Tag: P + /K: + - Content: page=0 mcid=11 + - Tag: LI + /K: + - Tag: Lbl + /K: + - Content: page=0 mcid=12 + - Tag: LBody + /K: + - Tag: P + /K: + - Content: page=0 mcid=13 diff --git a/tests/ref/pdftags/logical-children-tags-decorations-in-broken-grid-cell.yml b/tests/ref/pdftags/logical-children-tags-decorations-in-broken-grid-cell.yml new file mode 100644 index 0000000000..fa128f8364 --- /dev/null +++ b/tests/ref/pdftags/logical-children-tags-decorations-in-broken-grid-cell.yml @@ -0,0 +1,26 @@ +- Tag: Div + /K: + - Tag: Div + /K: + - Tag: Span + /Placement: Block + /TextDecorationType: Underline + /K: + - Content: page=0 mcid=0 + - Content: page=0 mcid=1 + - Content: page=1 mcid=0 + - Content: page=1 mcid=1 + - Content: page=2 mcid=0 + - Content: page=2 mcid=1 + - Tag: Div + /K: + - Tag: Span + /Placement: Block + /TextDecorationType: Overline + /K: + - Content: page=0 mcid=2 + - Content: page=0 mcid=3 + - Content: page=1 mcid=2 + - Content: page=1 mcid=3 + - Content: page=2 mcid=2 + - Content: page=2 mcid=3 diff --git a/tests/ref/pdftags/logical-children-tags-hide-around-footnote.yml b/tests/ref/pdftags/logical-children-tags-hide-around-footnote.yml new file mode 100644 index 0000000000..0bb7e20c27 --- /dev/null +++ b/tests/ref/pdftags/logical-children-tags-hide-around-footnote.yml @@ -0,0 +1,17 @@ +- Tag: P + /K: + - Content: page=0 mcid=0 +- Tag: Note + /Placement: Block + /K: + - Tag: Lbl + /K: + - Tag: Link + /K: + - Annotation: page=0 index=0 + - Tag: Span + /BaselineShift: 2.975 + /LineHeight: 5.100 + /K: + - Content: page=0 mcid=1 + - Content: page=0 mcid=2 diff --git a/tests/ref/pdftags/logical-children-tags-hide-around-place.yml b/tests/ref/pdftags/logical-children-tags-hide-around-place.yml new file mode 100644 index 0000000000..9370253527 --- /dev/null +++ b/tests/ref/pdftags/logical-children-tags-hide-around-place.yml @@ -0,0 +1,3 @@ +- Tag: P + /K: + - Content: page=0 mcid=0 diff --git a/tests/ref/pdftags/logical-children-tags-underline-around-footnote.yml b/tests/ref/pdftags/logical-children-tags-underline-around-footnote.yml new file mode 100644 index 0000000000..d846b6f422 --- /dev/null +++ b/tests/ref/pdftags/logical-children-tags-underline-around-footnote.yml @@ -0,0 +1,37 @@ +- Tag: P + /K: + - Tag: Span + /TextDecorationType: Underline + /K: + - Content: page=0 mcid=0 + - Tag: Lbl + /K: + - Tag: Link + /K: + - Annotation: page=0 index=0 + - Tag: Span + /BaselineShift: 3.500 + /LineHeight: 6.000 + /TextDecorationType: Underline + /K: + - Content: page=0 mcid=1 + - Tag: Note + /K: + - Tag: Lbl + /K: + - Tag: Link + /K: + - Annotation: page=0 index=1 + - Tag: Span + /BaselineShift: 2.975 + /LineHeight: 5.100 + /K: + - Content: page=0 mcid=4 + - Content: page=0 mcid=5 + - Tag: Span + /TextDecorationType: Underline + /K: + - Content: page=0 mcid=2 +- Tag: P + /K: + - Content: page=0 mcid=3 diff --git a/tests/ref/pdftags/logical-children-tags-underline-around-place.yml b/tests/ref/pdftags/logical-children-tags-underline-around-place.yml new file mode 100644 index 0000000000..a3deffc90a --- /dev/null +++ b/tests/ref/pdftags/logical-children-tags-underline-around-place.yml @@ -0,0 +1,20 @@ +- Tag: P + /K: + - Tag: Span + /TextDecorationType: Underline + /K: + - Content: page=0 mcid=0 +- Tag: Span + /Placement: Block + /TextDecorationType: Underline + /K: + - Content: page=0 mcid=3 +- Tag: P + /K: + - Tag: Span + /TextDecorationType: Underline + /K: + - Content: page=0 mcid=1 +- Tag: P + /K: + - Content: page=0 mcid=2 diff --git a/tests/ref/pdftags/outline-spacing.yml b/tests/ref/pdftags/outline-spacing.yml new file mode 100644 index 0000000000..be76676111 --- /dev/null +++ b/tests/ref/pdftags/outline-spacing.yml @@ -0,0 +1,85 @@ +- Tag: H1 + /T: "Contents" + /K: + - Content: page=0 mcid=0 +- Tag: TOC + /K: + - Tag: TOCI + /K: + - Tag: Reference + /Placement: Block + /K: + - Tag: Link + /K: + - Tag: Lbl + /K: + - Content: page=0 mcid=1 + - Content: page=0 mcid=2 + - Content: page=0 mcid=3 + - Annotation: page=0 index=0 + - Tag: TOC + /K: + - Tag: TOCI + /K: + - Tag: Reference + /Placement: Block + /K: + - Tag: Link + /K: + - Tag: Lbl + /K: + - Content: page=0 mcid=4 + - Content: page=0 mcid=5 + - Content: page=0 mcid=6 + - Annotation: page=0 index=1 + - Tag: TOCI + /K: + - Tag: Reference + /Placement: Block + /K: + - Tag: Link + /K: + - Tag: Lbl + /K: + - Content: page=0 mcid=7 + - Content: page=0 mcid=8 + - Content: page=0 mcid=9 + - Annotation: page=0 index=2 + - Tag: TOCI + /K: + - Tag: Reference + /Placement: Block + /K: + - Tag: Link + /K: + - Tag: Lbl + /K: + - Content: page=0 mcid=10 + - Content: page=0 mcid=11 + - Content: page=0 mcid=12 + - Annotation: page=0 index=3 + - Tag: TOC + /K: + - Tag: TOCI + /K: + - Tag: Reference + /Placement: Block + /K: + - Tag: Link + /K: + - Tag: Lbl + /K: + - Content: page=0 mcid=13 + - Content: page=0 mcid=14 + - Content: page=0 mcid=15 + - Annotation: page=0 index=4 +- Tag: H1 + /T: "A" +- Tag: H2 + /T: "B" +- Tag: H2 + /T: "C" +- Tag: H1 + /T: "D" +- Tag: H2 + /T: "E" diff --git a/tests/ref/pdftags/par-basic.yml b/tests/ref/pdftags/par-basic.yml new file mode 100644 index 0000000000..5a7b2a106d --- /dev/null +++ b/tests/ref/pdftags/par-basic.yml @@ -0,0 +1,23 @@ +- Tag: P + /K: + - Content: page=0 mcid=0 + - Content: page=0 mcid=1 + - Content: page=0 mcid=2 + - Content: page=0 mcid=3 + - Content: page=0 mcid=4 + - Content: page=0 mcid=5 + - Content: page=0 mcid=6 + - Content: page=1 mcid=0 + - Content: page=1 mcid=1 +- Tag: P + /K: + - Content: page=1 mcid=2 + - Content: page=1 mcid=3 + - Content: page=1 mcid=4 + - Content: page=1 mcid=5 + - Content: page=1 mcid=6 + - Content: page=2 mcid=0 + - Content: page=2 mcid=1 + - Content: page=2 mcid=2 + - Content: page=2 mcid=3 + - Content: page=2 mcid=4 diff --git a/tests/ref/pdftags/par-first-line-indent-all-terms.yml b/tests/ref/pdftags/par-first-line-indent-all-terms.yml new file mode 100644 index 0000000000..6e39d29b24 --- /dev/null +++ b/tests/ref/pdftags/par-first-line-indent-all-terms.yml @@ -0,0 +1,34 @@ +- Tag: L + /Numbering: None + /K: + - Tag: LI + /K: + - Tag: Lbl + /K: + - Tag: Strong + /K: + - Content: page=0 mcid=0 + - Tag: LBody + /K: + - Tag: P + /K: + - Content: page=0 mcid=1 + - Content: page=0 mcid=2 + - Tag: P + /K: + - Content: page=0 mcid=3 + - Tag: P + /K: + - Content: page=0 mcid=4 + - Tag: LI + /K: + - Tag: Lbl + /K: + - Tag: Strong + /K: + - Content: page=0 mcid=5 + - Tag: LBody + /K: + - Tag: P + /K: + - Content: page=0 mcid=6 diff --git a/tests/ref/pdftags/query-tags-duplicate-heading.yml b/tests/ref/pdftags/query-tags-duplicate-heading.yml new file mode 100644 index 0000000000..1aec44f80a --- /dev/null +++ b/tests/ref/pdftags/query-tags-duplicate-heading.yml @@ -0,0 +1,8 @@ +- Tag: H1 + /T: "Hi" + /K: + - Content: page=0 mcid=0 +- Tag: H1 + /T: "Hi" + /K: + - Content: page=0 mcid=1 diff --git a/tests/ref/pdftags/query-tags-duplicate-labelled-element.yml b/tests/ref/pdftags/query-tags-duplicate-labelled-element.yml new file mode 100644 index 0000000000..ce96b80064 --- /dev/null +++ b/tests/ref/pdftags/query-tags-duplicate-labelled-element.yml @@ -0,0 +1,22 @@ +- Tag: Figure + /Alt: "Text saying: hello there" + /Placement: Block + /BBox: + page: 0 + left: 38.225 + top: 9.600 + right: 81.495 + bottom: 16.680 + /K: + - Content: page=0 mcid=0 +- Tag: Figure + /Alt: "Text saying: hello there" + /Placement: Block + /BBox: + page: 0 + left: 38.225 + top: 28.180 + right: 81.495 + bottom: 35.260 + /K: + - Content: page=0 mcid=1 diff --git a/tests/ref/pdftags/quote-dir-align.yml b/tests/ref/pdftags/quote-dir-align.yml new file mode 100644 index 0000000000..dd9134704a --- /dev/null +++ b/tests/ref/pdftags/quote-dir-align.yml @@ -0,0 +1,20 @@ +lang: "ar" +--- +- Tag: BlockQuote + /Lang: "en" + /K: + - Tag: Span + /Placement: Block + /K: + - Content: page=0 mcid=0 + - Content: page=0 mcid=1 +- Tag: BlockQuote + /K: + - Tag: Span + /Placement: Block + /K: + - Content: page=0 mcid=2 + - Content: page=0 mcid=3 + - Content: page=0 mcid=4 + - Content: page=0 mcid=5 + - Content: page=0 mcid=6 diff --git a/tests/ref/pdftags/quote-dir-author-pos.yml b/tests/ref/pdftags/quote-dir-author-pos.yml new file mode 100644 index 0000000000..570b026ca0 --- /dev/null +++ b/tests/ref/pdftags/quote-dir-author-pos.yml @@ -0,0 +1,20 @@ +lang: "ar" +--- +- Tag: P + /Lang: "en" + /K: + - Content: page=0 mcid=0 + - Tag: InlineQuote + /K: + - Content: page=0 mcid=1 + - Content: page=0 mcid=2 + - Content: page=0 mcid=3 +- Tag: P + /K: + - Tag: InlineQuote + /K: + - Content: page=0 mcid=4 + - Content: page=0 mcid=5 + - Content: page=0 mcid=6 + - Content: page=0 mcid=7 + - Content: page=0 mcid=8 diff --git a/tests/ref/pdftags/raw-tags-basic-block.yml b/tests/ref/pdftags/raw-tags-basic-block.yml new file mode 100644 index 0000000000..c4bf34661e --- /dev/null +++ b/tests/ref/pdftags/raw-tags-basic-block.yml @@ -0,0 +1,43 @@ +- Tag: Code + /Placement: Block + /K: + - Tag: P + /K: + - Content: page=0 mcid=0 + - Content: page=0 mcid=1 + - Content: page=0 mcid=2 + - Content: page=0 mcid=3 + - Content: page=0 mcid=4 + - Content: page=0 mcid=5 + - Content: page=0 mcid=6 + - Content: page=0 mcid=7 + - Content: page=0 mcid=8 + - Content: page=0 mcid=9 + - Content: page=0 mcid=10 + - Content: page=0 mcid=11 + - Content: page=0 mcid=12 + - Content: page=0 mcid=13 + - Tag: P + - Tag: P + /K: + - Content: page=0 mcid=14 + - Content: page=0 mcid=15 + - Content: page=0 mcid=16 + - Content: page=0 mcid=17 + - Content: page=0 mcid=18 + - Content: page=0 mcid=19 + - Content: page=0 mcid=20 + - Tag: P + /K: + - Content: page=0 mcid=21 + - Content: page=0 mcid=22 + - Content: page=0 mcid=23 + - Content: page=0 mcid=24 + - Content: page=0 mcid=25 + - Content: page=0 mcid=26 + - Content: page=0 mcid=27 + - Content: page=0 mcid=28 + - Content: page=0 mcid=29 + - Tag: P + /K: + - Content: page=0 mcid=30 diff --git a/tests/ref/pdftags/raw-tags-basic-inline.yml b/tests/ref/pdftags/raw-tags-basic-inline.yml new file mode 100644 index 0000000000..17817bc34c --- /dev/null +++ b/tests/ref/pdftags/raw-tags-basic-inline.yml @@ -0,0 +1,13 @@ +- Tag: P + /K: + - Content: page=0 mcid=0 + - Tag: Code + /K: + - Content: page=0 mcid=1 + - Content: page=0 mcid=2 + - Content: page=0 mcid=3 + - Tag: Code + /K: + - Content: page=0 mcid=4 + - Content: page=0 mcid=5 + - Content: page=0 mcid=6 diff --git a/tests/ref/pdftags/table-empty.yml b/tests/ref/pdftags/table-empty.yml new file mode 100644 index 0000000000..cdbf6bf1bc --- /dev/null +++ b/tests/ref/pdftags/table-empty.yml @@ -0,0 +1 @@ +- Tag: Table diff --git a/tests/ref/pdftags/table-tags-basic.yml b/tests/ref/pdftags/table-tags-basic.yml new file mode 100644 index 0000000000..ac4ef301c2 --- /dev/null +++ b/tests/ref/pdftags/table-tags-basic.yml @@ -0,0 +1,71 @@ +- Tag: Table + /BBox: + page: 0 + left: 9.500 + top: 9.500 + right: 76.350 + bottom: 60.240 + /BorderColor: #000000 + /BorderThickness: 1.000 + /K: + - Tag: THead + /K: + - Tag: TR + /K: + - Tag: TH + /Id: "U1x0y0" + /Scope: Column + /Headers: [] + /BorderStyle: Solid + /K: + - Content: page=0 mcid=0 + - Tag: TH + /Id: "U1x1y0" + /Scope: Column + /Headers: [] + /BorderStyle: Solid + /K: + - Content: page=0 mcid=1 + - Tag: TH + /Id: "U1x2y0" + /Scope: Column + /Headers: [] + /BorderStyle: Solid + /K: + - Content: page=0 mcid=2 + - Tag: TBody + /K: + - Tag: TR + /K: + - Tag: TD + /Headers: ["U1x0y0"] + /BorderStyle: Solid + /K: + - Content: page=0 mcid=3 + - Tag: TD + /Headers: ["U1x1y0"] + /BorderStyle: Solid + /K: + - Content: page=0 mcid=4 + - Tag: TD + /Headers: ["U1x2y0"] + /BorderStyle: Solid + /K: + - Content: page=0 mcid=5 + - Tag: TR + /K: + - Tag: TD + /Headers: ["U1x0y0"] + /BorderStyle: Solid + /K: + - Content: page=0 mcid=6 + - Tag: TD + /Headers: ["U1x1y0"] + /BorderStyle: Solid + /K: + - Content: page=0 mcid=7 + - Tag: TD + /Headers: ["U1x2y0"] + /BorderStyle: Solid + /K: + - Content: page=0 mcid=8 diff --git a/tests/ref/pdftags/table-tags-column-and-row-header.yml b/tests/ref/pdftags/table-tags-column-and-row-header.yml new file mode 100644 index 0000000000..7029965fa2 --- /dev/null +++ b/tests/ref/pdftags/table-tags-column-and-row-header.yml @@ -0,0 +1,71 @@ +- Tag: Table + /BBox: + page: 0 + left: 9.500 + top: 9.500 + right: 85.360 + bottom: 60.240 + /BorderColor: #000000 + /BorderThickness: 1.000 + /K: + - Tag: TR + /K: + - Tag: TH + /Id: "U1x0y0" + /Scope: Column + /Headers: [] + /BorderStyle: Solid + /K: + - Content: page=0 mcid=0 + - Tag: TH + /Id: "U1x1y0" + /Scope: Column + /Headers: [] + /BorderStyle: Solid + /K: + - Content: page=0 mcid=1 + - Tag: TH + /Id: "U1x2y0" + /Scope: Column + /Headers: [] + /BorderStyle: Solid + /K: + - Content: page=0 mcid=2 + - Tag: TR + /K: + - Tag: TH + /Id: "U1x0y1" + /Scope: Row + /Headers: ["U1x0y0"] + /BorderStyle: Solid + /K: + - Content: page=0 mcid=3 + - Tag: TD + /Headers: ["U1x1y0", "U1x0y1"] + /BorderStyle: Solid + /K: + - Content: page=0 mcid=4 + - Tag: TD + /Headers: ["U1x2y0", "U1x0y1"] + /BorderStyle: Solid + /K: + - Content: page=0 mcid=5 + - Tag: TR + /K: + - Tag: TH + /Id: "U1x0y2" + /Scope: Row + /Headers: ["U1x0y0"] + /BorderStyle: Solid + /K: + - Content: page=0 mcid=6 + - Tag: TD + /Headers: ["U1x1y0", "U1x0y2"] + /BorderStyle: Solid + /K: + - Content: page=0 mcid=7 + - Tag: TD + /Headers: ["U1x2y0", "U1x0y2"] + /BorderStyle: Solid + /K: + - Content: page=0 mcid=8 diff --git a/tests/ref/pdftags/table-tags-different-default-border.yml b/tests/ref/pdftags/table-tags-different-default-border.yml new file mode 100644 index 0000000000..579b40f846 --- /dev/null +++ b/tests/ref/pdftags/table-tags-different-default-border.yml @@ -0,0 +1,87 @@ +- Tag: Table + /BBox: + page: 0 + left: 9.000 + top: 9.000 + right: 40.630 + bottom: 60.740 + /BorderColor: #ff4136 + /K: + - Tag: TR + /K: + - Tag: TD + /Headers: [] + /BorderColor: + before: #000000 + after: #ff4136 + start: #ff4136 + end: #ff4136 + /BorderStyle: Solid + /BorderThickness: + before: 1.000 + after: 2.000 + start: 2.000 + end: 2.000 + /K: + - Content: page=0 mcid=0 + - Tag: TD + /Headers: [] + /BorderColor: + before: #000000 + after: #ff4136 + start: #ff4136 + end: #ff4136 + /BorderStyle: Solid + /BorderThickness: + before: 1.000 + after: 2.000 + start: 2.000 + end: 2.000 + /K: + - Content: page=0 mcid=1 + - Tag: TR + /K: + - Tag: TD + /Headers: [] + /BorderStyle: Solid + /BorderThickness: 2.000 + /K: + - Content: page=0 mcid=2 + - Tag: TD + /Headers: [] + /BorderStyle: Solid + /BorderThickness: 2.000 + /K: + - Content: page=0 mcid=3 + - Tag: TR + /K: + - Tag: TD + /Headers: [] + /BorderColor: + before: #ff4136 + after: #000000 + start: #ff4136 + end: #ff4136 + /BorderStyle: Solid + /BorderThickness: + before: 2.000 + after: 1.000 + start: 2.000 + end: 2.000 + /K: + - Content: page=0 mcid=4 + - Tag: TD + /Headers: [] + /BorderColor: + before: #ff4136 + after: #000000 + start: #ff4136 + end: #ff4136 + /BorderStyle: Solid + /BorderThickness: + before: 2.000 + after: 1.000 + start: 2.000 + end: 2.000 + /K: + - Content: page=0 mcid=5 diff --git a/tests/ref/pdftags/table-tags-explicit-lines.yml b/tests/ref/pdftags/table-tags-explicit-lines.yml new file mode 100644 index 0000000000..b3387274fd --- /dev/null +++ b/tests/ref/pdftags/table-tags-explicit-lines.yml @@ -0,0 +1,57 @@ +- Tag: Table + /BBox: + page: 0 + left: 9.500 + top: 9.500 + right: 40.130 + bottom: 43.660 + /BorderColor: #000000 + /K: + - Tag: TR + /K: + - Tag: TD + /Headers: [] + /BorderColor: + before: #000000 + after: #ff4136 + start: #000000 + end: #2ecc40 + /BorderStyle: Solid + /BorderThickness: 1.000 + /K: + - Content: page=0 mcid=0 + - Tag: TD + /Headers: [] + /BorderColor: + before: #000000 + after: #ff4136 + start: #2ecc40 + end: #000000 + /BorderStyle: Solid + /BorderThickness: 1.000 + /K: + - Content: page=0 mcid=1 + - Tag: TR + /K: + - Tag: TD + /Headers: [] + /BorderColor: + before: #ff4136 + after: #0074d9 + start: #000000 + end: #2ecc40 + /BorderStyle: Solid + /BorderThickness: 1.000 + /K: + - Content: page=0 mcid=2 + - Tag: TD + /Headers: [] + /BorderColor: + before: #ff4136 + after: #0074d9 + start: #2ecc40 + end: #000000 + /BorderStyle: Solid + /BorderThickness: 1.000 + /K: + - Content: page=0 mcid=3 diff --git a/tests/ref/pdftags/table-tags-missing-cells.yml b/tests/ref/pdftags/table-tags-missing-cells.yml new file mode 100644 index 0000000000..01a5ee76ef --- /dev/null +++ b/tests/ref/pdftags/table-tags-missing-cells.yml @@ -0,0 +1,124 @@ +- Tag: Table + /BBox: + page: 0 + left: 9.500 + top: 9.500 + right: 76.350 + bottom: 96.820 + /BorderColor: #000000 + /BorderThickness: 1.000 + /K: + - Tag: THead + /K: + - Tag: TR + /K: + - Tag: TH + /Id: "U1x0y0" + /Scope: Column + /Headers: [] + /BorderStyle: Solid + /K: + - Content: page=0 mcid=0 + - Tag: TH + /Id: "U1x1y0" + /Scope: Column + /Headers: [] + /BorderStyle: Solid + /K: + - Content: page=0 mcid=1 + - Tag: TH + /Id: "U1x2y0" + /Scope: Column + /Headers: [] + /BorderStyle: Solid + /K: + - Content: page=0 mcid=2 + - Tag: TR + /K: + - Tag: TH + /Id: "U1x0y1" + /Scope: Column + /Headers: ["U1x0y0"] + /BorderStyle: Solid + /K: + - Content: page=0 mcid=3 + - Tag: TH + /Id: "U1x1y1" + /Scope: Column + /Headers: ["U1x1y0"] + /BorderStyle: Solid + /K: + - Content: page=0 mcid=4 + - Tag: TH + /Id: "U1x2y1" + /Scope: Column + /Headers: ["U1x2y0"] + /BorderStyle: Solid + /K: + - Content: page=0 mcid=5 + - Tag: TBody + /K: + - Tag: TR + /K: + - Tag: TD + /Headers: ["U1x0y1"] + /BorderStyle: Solid + - Tag: TD + /Headers: ["U1x1y1"] + /BorderStyle: Solid + - Tag: TD + /Headers: ["U1x2y1"] + /BorderStyle: Solid + - Tag: TBody + /K: + - Tag: TR + /K: + - Tag: TH + /Id: "U1x0y3" + /Scope: Column + /Headers: ["U1x0y0"] + /BorderStyle: Solid + /K: + - Content: page=0 mcid=6 + - Tag: TH + /Id: "U1x1y3" + /Scope: Column + /Headers: ["U1x1y0"] + /BorderStyle: Solid + /K: + - Content: page=0 mcid=7 + - Tag: TH + /Id: "U1x2y3" + /Scope: Column + /Headers: ["U1x2y0"] + /BorderStyle: Solid + - Tag: TBody + /K: + - Tag: TR + /K: + - Tag: TD + /Headers: ["U1x0y3"] + /BorderStyle: Solid + - Tag: TD + /Headers: ["U1x1y3"] + /BorderStyle: Solid + - Tag: TD + /Headers: ["U1x2y3"] + /BorderStyle: Solid + - Tag: TFoot + /K: + - Tag: TR + /K: + - Tag: TD + /Headers: ["U1x0y3"] + /BorderStyle: Solid + - Tag: TD + /Headers: ["U1x1y3"] + /BorderStyle: Solid + /K: + - Content: page=0 mcid=8 + - Tag: TD + /Headers: ["U1x2y3"] + /BorderStyle: Solid + /K: + - Content: page=0 mcid=9 diff --git a/tests/ref/pdftags/table-tags-rowspan-split-1.yml b/tests/ref/pdftags/table-tags-rowspan-split-1.yml new file mode 100644 index 0000000000..f51def5596 --- /dev/null +++ b/tests/ref/pdftags/table-tags-rowspan-split-1.yml @@ -0,0 +1,34 @@ +- Tag: Table + /BorderColor: #000000 + /BorderThickness: 1.000 + /K: + - Tag: TR + /K: + - Tag: TD + /Headers: [] + /RowSpan: 3 + /BorderStyle: Solid + /K: + - Content: page=0 mcid=1 + - Content: page=0 mcid=2 + - Content: page=2 mcid=0 + - Content: page=2 mcid=1 + - Tag: TD + /Headers: [] + /BorderStyle: Solid + /K: + - Content: page=0 mcid=0 + - Tag: TR + /K: + - Tag: TD + /Headers: [] + /BorderStyle: Solid + /K: + - Content: page=1 mcid=0 + - Tag: TR + /K: + - Tag: TD + /Headers: [] + /BorderStyle: Solid + /K: + - Content: page=2 mcid=2 diff --git a/tests/ref/pdftags/table-tags-rowspan-split-2.yml b/tests/ref/pdftags/table-tags-rowspan-split-2.yml new file mode 100644 index 0000000000..60906f18f2 --- /dev/null +++ b/tests/ref/pdftags/table-tags-rowspan-split-2.yml @@ -0,0 +1,50 @@ +- Tag: Table + /BorderColor: #000000 + /BorderThickness: 1.000 + /K: + - Tag: TR + /K: + - Tag: TD + /Headers: [] + /BorderStyle: Solid + /K: + - Content: page=0 mcid=0 + - Tag: TD + /Headers: [] + /RowSpan: 3 + /BorderStyle: Solid + /K: + - Content: page=0 mcid=2 + - Content: page=0 mcid=3 + - Content: page=1 mcid=2 + - Content: page=2 mcid=0 + - Content: page=2 mcid=1 + - Tag: TD + /Headers: [] + /BorderStyle: Solid + /K: + - Content: page=0 mcid=1 + - Tag: TR + /K: + - Tag: TD + /Headers: [] + /BorderStyle: Solid + /K: + - Content: page=1 mcid=0 + - Tag: TD + /Headers: [] + /BorderStyle: Solid + /K: + - Content: page=1 mcid=1 + - Tag: TR + /K: + - Tag: TD + /Headers: [] + /BorderStyle: Solid + /K: + - Content: page=2 mcid=2 + - Tag: TD + /Headers: [] + /BorderStyle: Solid + /K: + - Content: page=2 mcid=3 diff --git a/tests/ref/pdftags/table-tags-show-rule.yml b/tests/ref/pdftags/table-tags-show-rule.yml new file mode 100644 index 0000000000..1450e6ab88 --- /dev/null +++ b/tests/ref/pdftags/table-tags-show-rule.yml @@ -0,0 +1,15 @@ +- Tag: P + /K: + - Tag: Table + /K: + - Tag: Code + /K: + - Content: page=0 mcid=0 + - Content: page=0 mcid=1 + - Content: page=0 mcid=2 + - Content: page=0 mcid=3 + - Content: page=0 mcid=4 + - Content: page=0 mcid=5 + - Content: page=0 mcid=6 + - Content: page=0 mcid=7 + - Content: page=0 mcid=8 diff --git a/tests/ref/pdftags/table-tags-unset-bottom-line.yml b/tests/ref/pdftags/table-tags-unset-bottom-line.yml new file mode 100644 index 0000000000..0954137ea7 --- /dev/null +++ b/tests/ref/pdftags/table-tags-unset-bottom-line.yml @@ -0,0 +1,53 @@ +- Tag: Table + /BBox: + page: 0 + left: 9.500 + top: 9.500 + right: 40.130 + bottom: 43.660 + /BorderColor: #000000 + /K: + - Tag: TR + /K: + - Tag: TD + /Headers: [] + /BorderStyle: Solid + /BorderThickness: 1.000 + /K: + - Content: page=0 mcid=0 + - Tag: TD + /Headers: [] + /BorderStyle: Solid + /BorderThickness: 1.000 + /K: + - Content: page=0 mcid=1 + - Tag: TR + /K: + - Tag: TD + /Headers: [] + /BorderStyle: + before: Solid + after: None + start: Solid + end: Solid + /BorderThickness: + before: 1.000 + after: 0.000 + start: 1.000 + end: 1.000 + /K: + - Content: page=0 mcid=2 + - Tag: TD + /Headers: [] + /BorderStyle: + before: Solid + after: None + start: Solid + end: Solid + /BorderThickness: + before: 1.000 + after: 0.000 + start: 1.000 + end: 1.000 + /K: + - Content: page=0 mcid=3 diff --git a/tests/ref/pdftags/table-tags-unstable-functions.yml b/tests/ref/pdftags/table-tags-unstable-functions.yml new file mode 100644 index 0000000000..46ee1568c2 --- /dev/null +++ b/tests/ref/pdftags/table-tags-unstable-functions.yml @@ -0,0 +1,39 @@ +- Tag: Table + /Summary: "The table summary" + /BBox: + page: 0 + left: 9.500 + top: 9.500 + right: 110.500 + bottom: 69.820 + /BorderColor: #000000 + /BorderThickness: 1.000 + /K: + - Tag: TR + /K: + - Tag: TD + /Headers: [] + /BorderStyle: Solid + - Tag: TH + /Id: "U1x1y0" + /Scope: Column + /Headers: [] + /BorderStyle: Solid + /K: + - Content: page=0 mcid=0 + - Content: page=0 mcid=1 + - Tag: TR + /K: + - Tag: TH + /Id: "U1x0y1" + /Scope: Row + /Headers: [] + /BorderStyle: Solid + /K: + - Content: page=0 mcid=2 + - Content: page=0 mcid=3 + - Tag: TD + /Headers: ["U1x1y0", "U1x0y1"] + /BorderStyle: Solid + /K: + - Content: page=0 mcid=4 diff --git a/tests/ref/pdftags/terms-constructor.yml b/tests/ref/pdftags/terms-constructor.yml new file mode 100644 index 0000000000..60affce123 --- /dev/null +++ b/tests/ref/pdftags/terms-constructor.yml @@ -0,0 +1,23 @@ +- Tag: L + /Numbering: None + /K: + - Tag: LI + /K: + - Tag: Lbl + /K: + - Tag: Strong + /K: + - Content: page=0 mcid=0 + - Tag: LBody + /K: + - Content: page=0 mcid=1 + - Tag: LI + /K: + - Tag: Lbl + /K: + - Tag: Strong + /K: + - Content: page=0 mcid=2 + - Tag: LBody + /K: + - Content: page=0 mcid=3 diff --git a/tests/ref/pdftags/text-lang-region.yml b/tests/ref/pdftags/text-lang-region.yml new file mode 100644 index 0000000000..d9b4f90b67 --- /dev/null +++ b/tests/ref/pdftags/text-lang-region.yml @@ -0,0 +1,7 @@ +lang: "zh-TW" +--- +- Tag: H1 + /T: "目錄" + /K: + - Content: page=0 mcid=0 +- Tag: TOC diff --git a/tests/ref/pdftags/text-lang-unknown-region.yml b/tests/ref/pdftags/text-lang-unknown-region.yml new file mode 100644 index 0000000000..20e7a2f187 --- /dev/null +++ b/tests/ref/pdftags/text-lang-unknown-region.yml @@ -0,0 +1,8 @@ +lang: "zh-XX" +--- +- Tag: H1 + /T: "目录" + /K: + - Content: page=0 mcid=0 + - Content: page=0 mcid=1 +- Tag: TOC diff --git a/tests/ref/pdftags/text-lang.yml b/tests/ref/pdftags/text-lang.yml new file mode 100644 index 0000000000..2b4793e205 --- /dev/null +++ b/tests/ref/pdftags/text-lang.yml @@ -0,0 +1,8 @@ +lang: "zh" +--- +- Tag: H1 + /T: "目录" + /K: + - Content: page=0 mcid=0 + - Content: page=0 mcid=1 +- Tag: TOC diff --git a/tests/ref/pdftags/title.yml b/tests/ref/pdftags/title.yml new file mode 100644 index 0000000000..ecd3e17022 --- /dev/null +++ b/tests/ref/pdftags/title.yml @@ -0,0 +1,8 @@ +- Tag: Title + /K: + - Content: page=0 mcid=0 +- Tag: H1 + /T: "A level one heading" + /K: + - Content: page=0 mcid=1 + - Content: page=0 mcid=2 diff --git a/tests/ref/presentation-selectors.png b/tests/ref/presentation-selectors.png new file mode 100644 index 0000000000..4ee34996b1 Binary files /dev/null and b/tests/ref/presentation-selectors.png differ diff --git a/tests/ref/raw-default-json-theme.png b/tests/ref/raw-default-json-theme.png new file mode 100644 index 0000000000..5b61df4f27 Binary files /dev/null and b/tests/ref/raw-default-json-theme.png differ diff --git a/tests/ref/raw-default-yaml-theme.png b/tests/ref/raw-default-yaml-theme.png new file mode 100644 index 0000000000..67a7dd20dd Binary files /dev/null and b/tests/ref/raw-default-yaml-theme.png differ diff --git a/tests/ref/raw-highlight-typm-extra.png b/tests/ref/raw-highlight-typm-extra.png new file mode 100644 index 0000000000..18fd6eb219 Binary files /dev/null and b/tests/ref/raw-highlight-typm-extra.png differ diff --git a/tests/ref/rect-stroke-caps.png b/tests/ref/rect-stroke-caps.png new file mode 100644 index 0000000000..13a34ad9aa Binary files /dev/null and b/tests/ref/rect-stroke-caps.png differ diff --git a/tests/ref/ref-to-empty-label-not-possible.png b/tests/ref/ref-to-empty-label-not-possible.png new file mode 100644 index 0000000000..774b79589c Binary files /dev/null and b/tests/ref/ref-to-empty-label-not-possible.png differ diff --git a/tests/ref/script-metrics-bundled-fonts.png b/tests/ref/script-metrics-bundled-fonts.png new file mode 100644 index 0000000000..fb99b1bd67 Binary files /dev/null and b/tests/ref/script-metrics-bundled-fonts.png differ diff --git a/tests/ref/smartquote-nesting-twice.png b/tests/ref/smartquote-nesting-twice.png new file mode 100644 index 0000000000..69f3668073 Binary files /dev/null and b/tests/ref/smartquote-nesting-twice.png differ diff --git a/tests/ref/smartquote-uk.png b/tests/ref/smartquote-uk.png new file mode 100644 index 0000000000..7ac1c032e5 Binary files /dev/null and b/tests/ref/smartquote-uk.png differ diff --git a/tests/ref/sub-super-italic-compensation.png b/tests/ref/sub-super-italic-compensation.png new file mode 100644 index 0000000000..b6c8ad06ae Binary files /dev/null and b/tests/ref/sub-super-italic-compensation.png differ diff --git a/tests/ref/sub-super-typographic.png b/tests/ref/sub-super-typographic.png new file mode 100644 index 0000000000..a0c53d5002 Binary files /dev/null and b/tests/ref/sub-super-typographic.png differ diff --git a/tests/ref/super-highlight.png b/tests/ref/super-highlight.png new file mode 100644 index 0000000000..c0cf612b95 Binary files /dev/null and b/tests/ref/super-highlight.png differ diff --git a/tests/ref/symbol-modifier-deprecated.png b/tests/ref/symbol-modifier-deprecated.png new file mode 100644 index 0000000000..6932515550 Binary files /dev/null and b/tests/ref/symbol-modifier-deprecated.png differ diff --git a/tests/ref/tags-textual.png b/tests/ref/tags-textual.png new file mode 100644 index 0000000000..539a0c19b8 Binary files /dev/null and b/tests/ref/tags-textual.png differ diff --git a/tests/ref/text-font-covers-repeat.png b/tests/ref/text-font-covers-repeat.png new file mode 100644 index 0000000000..aceb8d0079 Binary files /dev/null and b/tests/ref/text-font-covers-repeat.png differ diff --git a/tests/ref/text-font-covers-riffle.png b/tests/ref/text-font-covers-riffle.png new file mode 100644 index 0000000000..577e4f23d9 Binary files /dev/null and b/tests/ref/text-font-covers-riffle.png differ diff --git a/tests/ref/title-show-set.png b/tests/ref/title-show-set.png new file mode 100644 index 0000000000..4f7431b983 Binary files /dev/null and b/tests/ref/title-show-set.png differ diff --git a/tests/ref/title-with-body-auto.png b/tests/ref/title-with-body-auto.png new file mode 100644 index 0000000000..3c861186a6 Binary files /dev/null and b/tests/ref/title-with-body-auto.png differ diff --git a/tests/ref/title-with-body.png b/tests/ref/title-with-body.png new file mode 100644 index 0000000000..d71df8b1a7 Binary files /dev/null and b/tests/ref/title-with-body.png differ diff --git a/tests/ref/title.png b/tests/ref/title.png new file mode 100644 index 0000000000..9495e96b1c Binary files /dev/null and b/tests/ref/title.png differ diff --git a/tests/ref/transform-combinations.png b/tests/ref/transform-combinations.png new file mode 100644 index 0000000000..6786c39c60 Binary files /dev/null and b/tests/ref/transform-combinations.png differ diff --git a/tests/src/collect.rs b/tests/src/collect.rs index c6deba77b2..0291027f21 100644 --- a/tests/src/collect.rs +++ b/tests/src/collect.rs @@ -1,13 +1,26 @@ +<<<<<<< HEAD use std::collections::{HashMap, HashSet}; +======= +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 use std::fmt::{self, Display, Formatter}; use std::ops::Range; use std::path::{Path, PathBuf}; use std::str::FromStr; use std::sync::LazyLock; +<<<<<<< HEAD use ecow::{eco_format, EcoString}; use typst_syntax::package::PackageVersion; use typst_syntax::{is_id_continue, is_ident, is_newline, FileId, Source, VirtualPath}; +======= +use bitflags::bitflags; +use ecow::{EcoString, eco_format}; +use rustc_hash::{FxHashMap, FxHashSet}; +use typst_syntax::package::PackageVersion; +use typst_syntax::{ + FileId, Lines, Source, VirtualPath, is_id_continue, is_ident, is_newline, +}; +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 use unscanny::Scanner; /// Collects all tests from all files. @@ -23,14 +36,23 @@ pub fn collect() -> Result<(Vec, usize), Vec> { pub struct Test { pub pos: FilePos, pub name: EcoString, +<<<<<<< HEAD pub attrs: Vec, +======= + pub attrs: Attrs, +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 pub source: Source, pub notes: Vec, } impl Display for Test { fn fmt(&self, f: &mut Formatter) -> fmt::Result { +<<<<<<< HEAD write!(f, "{} ({})", self.name, self.pos) +======= + // underline path + write!(f, "{} (\x1B[4m{}\x1B[0m)", self.name, self.pos) +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 } } @@ -57,12 +79,69 @@ impl Display for FilePos { } } +<<<<<<< HEAD /// A test attribute, given after the test name. #[derive(Clone, Debug, PartialEq)] pub enum Attr { Html, Render, Large, +======= +bitflags! { + #[derive(Copy, Clone)] + struct AttrFlags: u8 { + const RENDER = 1 << 0; + const HTML = 1 << 1; + const PDFTAGS = 1 << 2; + const LARGE = 1 << 3; + const NOPDFUA = 1 << 4; + } +} + +impl AttrFlags { + const NON_RENDER: Self = Self::HTML.union(Self::PDFTAGS); + + pub fn targets(self) -> Targets { + let mut targets = Targets::empty(); + if self.contains(Self::RENDER) || (self & Self::NON_RENDER).is_empty() { + targets |= Targets::RENDER; + } + if self.contains(Self::HTML) { + targets |= Targets::HTML; + } + if self.contains(Self::PDFTAGS) { + targets |= Targets::PDFTAGS; + } + targets + } +} + +#[derive(Debug, Default, Copy, Clone, Eq, PartialEq)] +pub struct Attrs { + pub large: bool, + pub pdf_ua: bool, + pub targets: Targets, +} + +bitflags! { + #[derive(Debug, Default, Copy, Clone, Eq, PartialEq)] + pub struct Targets: u8 { + const RENDER = 0x1; + const HTML = 0x2; + const PDFTAGS = 0x4; + } +} + +impl Targets { + pub fn from_file_extension(ext: &str) -> Option { + Some(match ext { + "png" => Self::RENDER, + "html" => Self::HTML, + "yml" => Self::PDFTAGS, + _ => return None, + }) + } +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 } /// The size of a file. @@ -78,6 +157,11 @@ impl Display for FileSize { pub struct Note { pub pos: FilePos, pub kind: NoteKind, +<<<<<<< HEAD +======= + /// The file [`Self::range`] belongs to. + pub file: FileId, +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 pub range: Option>, pub message: String, } @@ -117,7 +201,11 @@ impl Display for NoteKind { struct Collector { tests: Vec, errors: Vec, +<<<<<<< HEAD seen: HashMap)>, +======= + seen: FxHashMap, +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 skipped: usize, } @@ -127,7 +215,11 @@ impl Collector { Self { tests: vec![], errors: vec![], +<<<<<<< HEAD seen: HashMap::new(), +======= + seen: FxHashMap::default(), +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 skipped: 0, } } @@ -149,7 +241,11 @@ impl Collector { for entry in walkdir::WalkDir::new(crate::SUITE_PATH).sort_by_file_name() { let entry = entry.unwrap(); let path = entry.path(); +<<<<<<< HEAD if !path.extension().is_some_and(|ext| ext == "typ") { +======= + if path.extension().is_none_or(|ext| ext != "typ") { +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 continue; } @@ -168,9 +264,18 @@ impl Collector { for entry in walkdir::WalkDir::new(crate::REF_PATH).sort_by_file_name() { let entry = entry.unwrap(); let path = entry.path(); +<<<<<<< HEAD if !path.extension().is_some_and(|ext| ext == "png") { continue; } +======= + let Some(file_target) = path.extension().and_then(|ext| { + let str = ext.to_str()?; + Targets::from_file_extension(str) + }) else { + continue; + }; +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 let stem = path.file_stem().unwrap().to_string_lossy(); let name = &*stem; @@ -183,8 +288,20 @@ impl Collector { continue; }; +<<<<<<< HEAD let len = path.metadata().unwrap().len() as usize; if !attrs.contains(&Attr::Large) && len > crate::REF_LIMIT { +======= + if !attrs.targets.contains(file_target) { + self.errors.push(TestParseError { + pos: FilePos::new(path, 0), + message: "dangling reference output".into(), + }); + } + + let len = path.metadata().unwrap().len() as usize; + if !attrs.large && len > crate::REF_LIMIT { +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 self.errors.push(TestParseError { pos: pos.clone(), message: format!( @@ -224,7 +341,11 @@ impl<'a> Parser<'a> { while !self.s.done() { let mut name = EcoString::new(); +<<<<<<< HEAD let mut attrs = Vec::new(); +======= + let mut attrs = Attrs::default(); +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 let mut notes = vec![]; if self.s.eat_if("---") { self.s.eat_while(' '); @@ -254,7 +375,11 @@ impl<'a> Parser<'a> { self.test_start_line = self.line; let pos = FilePos::new(self.path, self.test_start_line); +<<<<<<< HEAD self.collector.seen.insert(name.clone(), (pos.clone(), attrs.clone())); +======= + self.collector.seen.insert(name.clone(), (pos.clone(), attrs)); +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 while !self.s.done() && !self.s.at("---") { self.s.eat_until(is_newline); @@ -292,6 +417,7 @@ impl<'a> Parser<'a> { } } +<<<<<<< HEAD fn parse_attrs(&mut self) -> Vec { let mut attrs = vec![]; while !self.s.eat_if("---") { @@ -299,6 +425,18 @@ impl<'a> Parser<'a> { "large" => Attr::Large, "html" => Attr::Html, "render" => Attr::Render, +======= + fn parse_attrs(&mut self) -> Attrs { + let mut parsed = AttrFlags::empty(); + while !self.s.eat_if("---") { + let attr = self.s.eat_until(char::is_whitespace); + let flag = match attr { + "large" => AttrFlags::LARGE, + "html" => AttrFlags::HTML, + "render" => AttrFlags::RENDER, + "pdftags" => AttrFlags::PDFTAGS, + "nopdfua" => AttrFlags::NOPDFUA, +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 found => { self.error(format!( "expected attribute or closing ---, found `{found}`" @@ -306,6 +444,7 @@ impl<'a> Parser<'a> { break; } }; +<<<<<<< HEAD if attrs.contains(&attr) { self.error(format!("duplicate attribute {attr:?}")); } @@ -313,6 +452,20 @@ impl<'a> Parser<'a> { self.s.eat_while(' '); } attrs +======= + if parsed.contains(flag) { + self.error(format!("duplicate attribute `{attr}`")); + } + parsed.insert(flag); + self.s.eat_while(' '); + } + + Attrs { + large: parsed.contains(AttrFlags::LARGE), + pdf_ua: !parsed.contains(AttrFlags::NOPDFUA), + targets: parsed.targets(), + } +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 } /// Skips the preamble of a test. @@ -340,9 +493,34 @@ impl<'a> Parser<'a> { let kind: NoteKind = head.parse().ok()?; self.s.eat_if(' '); +<<<<<<< HEAD let mut range = None; if self.s.at('-') || self.s.at(char::is_numeric) { range = self.parse_range(source); +======= + let mut file = None; + if self.s.eat_if('"') { + let path = self.s.eat_until(|c| is_newline(c) || c == '"'); + if !self.s.eat_if('"') { + self.error("expected closing quote after file path"); + return None; + } + + let vpath = VirtualPath::new(path); + file = Some(FileId::new(None, vpath)); + + self.s.eat_if(' '); + } + + let mut range = None; + if self.s.at('-') || self.s.at(char::is_numeric) { + if let Some(file) = file { + range = self.parse_range_external(file); + } else { + range = self.parse_range(source); + } + +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 if range.is_none() { self.error("range is malformed"); return None; @@ -358,11 +536,84 @@ impl<'a> Parser<'a> { Some(Note { pos: FilePos::new(self.path, self.line), kind, +<<<<<<< HEAD +======= + file: file.unwrap_or(source.id()), +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 range, message, }) } +<<<<<<< HEAD +======= + #[cfg(not(feature = "default"))] + fn parse_range_external(&mut self, _file: FileId) -> Option> { + panic!("external file ranges are not expected when testing `typst_syntax`"); + } + + /// Parse a range in an external file, optionally abbreviated as just a position + /// if the range is empty. + #[cfg(feature = "default")] + fn parse_range_external(&mut self, file: FileId) -> Option> { + use typst::foundations::Bytes; + + use crate::world::{read, system_path}; + + let path = match system_path(file) { + Ok(path) => path, + Err(err) => { + self.error(err.to_string()); + return None; + } + }; + + let bytes = match read(&path) { + Ok(data) => Bytes::new(data), + Err(err) => { + self.error(err.to_string()); + return None; + } + }; + + let start = self.parse_line_col()?; + let lines = Lines::try_from(&bytes).expect( + "errors shouldn't be annotated for files \ + that aren't human readable (not valid utf-8)", + ); + let range = if self.s.eat_if('-') { + let (line, col) = start; + let start = lines.line_column_to_byte(line, col); + let (line, col) = self.parse_line_col()?; + let end = lines.line_column_to_byte(line, col); + Option::zip(start, end).map(|(a, b)| a..b) + } else { + let (line, col) = start; + lines.line_column_to_byte(line, col).map(|i| i..i) + }; + if range.is_none() { + self.error("range is out of bounds"); + } + range + } + + /// Parses absolute `line:column` indices in an external file. + fn parse_line_col(&mut self) -> Option<(usize, usize)> { + let line = self.parse_number()?; + if !self.s.eat_if(':') { + self.error("positions in external files always require both `:`"); + return None; + } + let col = self.parse_number()?; + if line < 0 || col < 0 { + self.error("line and column numbers must be positive"); + return None; + } + + Some(((line as usize).saturating_sub(1), (col as usize).saturating_sub(1))) + } + +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 /// Parse a range, optionally abbreviated as just a position if the range /// is empty. fn parse_range(&mut self, source: &Source) -> Option> { @@ -388,13 +639,21 @@ impl<'a> Parser<'a> { let line_idx = (line_idx_in_test + comments).checked_add_signed(line_delta)?; let column_idx = if column < 0 { // Negative column index is from the back. +<<<<<<< HEAD let range = source.line_to_range(line_idx)?; +======= + let range = source.lines().line_to_range(line_idx)?; +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 text[range].chars().count().saturating_add_signed(column) } else { usize::try_from(column).ok()?.checked_sub(1)? }; +<<<<<<< HEAD source.line_column_to_byte(line_idx, column_idx) +======= + source.lines().line_column_to_byte(line_idx, column_idx) +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 } /// Parse a number. @@ -416,7 +675,11 @@ impl<'a> Parser<'a> { /// Whether a test is within the selected set to run. fn selected(name: &str, abs: PathBuf) -> bool { +<<<<<<< HEAD static SKIPPED: LazyLock> = LazyLock::new(|| { +======= + static SKIPPED: LazyLock> = LazyLock::new(|| { +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 String::leak(std::fs::read_to_string(crate::SKIP_PATH).unwrap()) .lines() .map(|line| line.trim()) @@ -437,11 +700,15 @@ fn selected(name: &str, abs: PathBuf) -> bool { let patterns = &crate::ARGS.pattern; patterns.is_empty() || patterns.iter().any(|pattern: ®ex::Regex| { +<<<<<<< HEAD if exact { name == pattern.as_str() } else { pattern.is_match(name) } +======= + if exact { name == pattern.as_str() } else { pattern.is_match(name) } +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 }) } diff --git a/tests/src/custom.rs b/tests/src/custom.rs index 965312abc6..88259a79dd 100644 --- a/tests/src/custom.rs +++ b/tests/src/custom.rs @@ -1,9 +1,17 @@ use std::fmt::Write; +<<<<<<< HEAD use typst::foundations::Smart; use typst::layout::PagedDocument; use typst::model::DocumentInfo; use typst::World; +======= +use typst::World; +use typst::foundations::Smart; +use typst::introspection::{Location, Tag}; +use typst::layout::{Frame, FrameItem, PagedDocument}; +use typst::model::DocumentInfo; +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 use crate::collect::Test; use crate::world::TestWorld; @@ -36,6 +44,18 @@ pub fn check(test: &Test, world: &TestWorld, doc: Option<&PagedDocument>) -> Str test_eq!(sink, info.author, ["Changed"]); test_eq!(sink, info.title.as_deref(), Some("Alternative")); } +<<<<<<< HEAD +======= + "tags-grouping" | "tags-textual" => { + if let Some(doc) = doc { + if let Err(message) = check_balanced(doc) { + sink.push_str(message); + } + } else { + sink.push_str("missing document"); + } + } +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 _ => {} } sink @@ -45,3 +65,43 @@ pub fn check(test: &Test, world: &TestWorld, doc: Option<&PagedDocument>) -> Str fn info(doc: Option<&PagedDocument>) -> DocumentInfo { doc.map(|doc| doc.info.clone()).unwrap_or_default() } +<<<<<<< HEAD +======= + +/// Naive check for whether tags are balanced in the document. +/// +/// This is kept minimal for now: It does not handle groups with parents and +/// does not print useful debugging information. This is currently only run for +/// specific tests that are known not to have those. We might want to extend +/// this to the whole test suite in the future. Then we'll need to handle +/// insertions and provide a better debugging experience. However, there are +/// scenarios that are inherently (and correctly) unbalanced and we'd need some +/// way to opt out for those (via something like `large`). +fn check_balanced(doc: &PagedDocument) -> Result<(), &'static str> { + fn visit(stack: &mut Vec, frame: &Frame) -> Result<(), &'static str> { + for (_, item) in frame.items() { + match item { + FrameItem::Tag(tag) => match tag { + Tag::Start(..) => stack.push(tag.location()), + Tag::End(..) => { + if stack.pop() != Some(tag.location()) { + return Err("tags are unbalanced"); + } + } + }, + FrameItem::Group(group) => { + if group.parent.is_some() { + return Err("groups with parents are not supported"); + } + visit(stack, &group.frame)? + } + _ => {} + } + } + Ok(()) + } + + let mut stack = Vec::new(); + doc.pages.iter().try_for_each(|page| visit(&mut stack, &page.frame)) +} +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 diff --git a/tests/src/run.rs b/tests/src/run.rs index f9a3c04340..679639bed0 100644 --- a/tests/src/run.rs +++ b/tests/src/run.rs @@ -4,6 +4,7 @@ use std::path::PathBuf; use ecow::eco_vec; use tiny_skia as sk; +<<<<<<< HEAD use typst::diag::{SourceDiagnostic, Warned}; use typst::html::HtmlDocument; use typst::layout::{Abs, Frame, FrameItem, PagedDocument, Transform}; @@ -14,6 +15,19 @@ use typst_pdf::PdfOptions; use crate::collect::{Attr, FileSize, NoteKind, Test}; use crate::logger::TestResult; use crate::world::TestWorld; +======= +use typst::diag::{SourceDiagnostic, SourceResult, Warned}; +use typst::layout::{Abs, Frame, FrameItem, PagedDocument, Transform}; +use typst::visualize::Color; +use typst::{World, WorldExt}; +use typst_html::HtmlDocument; +use typst_pdf::{PdfOptions, PdfStandard, PdfStandards}; +use typst_syntax::{FileId, Lines}; + +use crate::collect::{FileSize, NoteKind, Targets, Test}; +use crate::logger::TestResult; +use crate::world::{TestWorld, system_path}; +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 /// Runs a single test. /// @@ -63,6 +77,7 @@ impl<'a> Runner<'a> { log!(into: self.result.infos, "tree: {:#?}", self.test.source.root()); } +<<<<<<< HEAD let html = self.test.attrs.contains(&Attr::Html); let render = !html || self.test.attrs.contains(&Attr::Render); if render { @@ -71,6 +86,17 @@ impl<'a> Runner<'a> { if html { self.run_test::(); } +======= + if self.test.attrs.targets.contains(Targets::RENDER) { + self.run_test::(); + } + if self.test.attrs.targets.contains(Targets::HTML) { + self.run_test::(); + } + if self.test.attrs.targets.contains(Targets::PDFTAGS) { + self.run_test::(); + } +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 self.handle_not_emitted(); self.handle_not_annotated(); @@ -80,18 +106,41 @@ impl<'a> Runner<'a> { /// Run test specific to document format. fn run_test(&mut self) { +<<<<<<< HEAD let Warned { output, warnings } = typst::compile(&self.world); let (doc, errors) = match output { +======= + let Warned { output, warnings } = D::compile(&self.world, self.test); + let (doc, mut errors) = match output { +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 Ok(doc) => (Some(doc), eco_vec![]), Err(errors) => (None, errors), }; +<<<<<<< HEAD if doc.is_none() && errors.is_empty() { log!(self, "no document, but also no errors"); } D::check_custom(self, doc.as_ref()); self.check_output(doc.as_ref()); +======= + D::check_custom(self, doc.as_ref()); + + let output = doc.and_then(|doc| match doc.make_live() { + Ok(live) => Some((doc, live)), + Err(list) => { + errors.extend(list); + None + } + }); + + if output.is_none() && errors.is_empty() { + log!(self, "no document, but also no errors"); + } + + self.check_output(output); +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 for error in &errors { self.check_diagnostic(NoteKind::Error, error); @@ -117,7 +166,11 @@ impl<'a> Runner<'a> { if seen { continue; } +<<<<<<< HEAD let note_range = self.format_range(¬e.range); +======= + let note_range = self.format_range(note.file, ¬e.range); +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 if first { log!(self, "not emitted"); first = false; @@ -127,12 +180,20 @@ impl<'a> Runner<'a> { } /// Check that the document output is correct. +<<<<<<< HEAD fn check_output(&mut self, document: Option<&D>) { +======= + fn check_output(&mut self, output: Option<(D, D::Live)>) { +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 let live_path = D::live_path(&self.test.name); let ref_path = D::ref_path(&self.test.name); let ref_data = std::fs::read(&ref_path); +<<<<<<< HEAD let Some(document) = document else { +======= + let Some((document, live)) = output else { +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 if ref_data.is_ok() { log!(self, "missing document"); log!(self, " ref | {}", ref_path.display()); @@ -140,7 +201,11 @@ impl<'a> Runner<'a> { return; }; +<<<<<<< HEAD let skippable = match D::is_skippable(document) { +======= + let skippable = match D::is_skippable(&document) { +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 Ok(skippable) => skippable, Err(()) => { log!(self, "document has zero pages"); @@ -156,12 +221,31 @@ impl<'a> Runner<'a> { } // Render and save live version. +<<<<<<< HEAD let live = document.make_live(); document.save_live(&self.test.name, &live); // Compare against reference output if available. // Test that is ok doesn't need to be updated. if ref_data.as_ref().map_or(false, |r| D::matches(&live, r)) { +======= + if let Err(errors) = document.save_live(&self.test.name, &live) { + log!(self, "failed to save live version:"); + for e in errors { + if let Some(file) = e.span.id() { + let range = self.world.range(e.span); + let diag_range = self.format_range(file, &range); + log!(self, " Error: {diag_range} {}", e.message); + } else { + log!(self, " Error: {}", e.message); + } + } + } + + // Compare against reference output if available. + // Test that is ok doesn't need to be updated. + if ref_data.as_ref().is_ok_and(|r| D::matches(&live, r)) { +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 return; } @@ -174,6 +258,7 @@ impl<'a> Runner<'a> { ); } else { let ref_data = D::make_ref(live); +<<<<<<< HEAD if !self.test.attrs.contains(&Attr::Large) && ref_data.len() > crate::REF_LIMIT { @@ -182,6 +267,20 @@ impl<'a> Runner<'a> { log!(self, " size | {}", FileSize(ref_data.len())); log!(self, "please try to minimize the size of the test (smaller pages, less text, etc.)"); log!(self, "if you think the test cannot be reasonably minimized, mark it as `large`"); +======= + if !self.test.attrs.large && ref_data.len() > crate::REF_LIMIT { + log!(self, "reference output would exceed maximum size"); + log!(self, " maximum | {}", FileSize(crate::REF_LIMIT)); + log!(self, " size | {}", FileSize(ref_data.len())); + log!( + self, + "please try to minimize the size of the test (smaller pages, less text, etc.)" + ); + log!( + self, + "if you think the test cannot be reasonably minimized, mark it as `large`" + ); +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 return; } std::fs::write(&ref_path, &ref_data).unwrap(); @@ -208,15 +307,19 @@ impl<'a> Runner<'a> { /// Compare a subset of notes with a given kind against diagnostics of /// that same kind. fn check_diagnostic(&mut self, kind: NoteKind, diag: &SourceDiagnostic) { +<<<<<<< HEAD // Ignore diagnostics from other sources than the test file itself. if diag.span.id().is_some_and(|id| id != self.test.source.id()) { return; } +======= +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 // TODO: remove this once HTML export is stable if diag.message == "html export is under active development and incomplete" { return; } +<<<<<<< HEAD let message = diag.message.replace("\\", "/"); let range = self.world.range(diag.span); self.validate_note(kind, range.clone(), &message); @@ -224,6 +327,19 @@ impl<'a> Runner<'a> { // Check hints. for hint in &diag.hints { self.validate_note(NoteKind::Hint, range.clone(), hint); +======= + let message = if diag.message.contains("\\u{") { + &diag.message + } else { + &diag.message.replace("\\", "/") + }; + let range = self.world.range(diag.span); + self.validate_note(kind, diag.span.id(), range.clone(), message); + + // Check hints. + for hint in &diag.hints { + self.validate_note(NoteKind::Hint, diag.span.id(), range.clone(), hint); +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 } } @@ -235,15 +351,27 @@ impl<'a> Runner<'a> { fn validate_note( &mut self, kind: NoteKind, +<<<<<<< HEAD +======= + file: Option, +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 range: Option>, message: &str, ) { // Try to find perfect match. +<<<<<<< HEAD +======= + let file = file.unwrap_or(self.test.source.id()); +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 if let Some((i, _)) = self.test.notes.iter().enumerate().find(|&(i, note)| { !self.seen[i] && note.kind == kind && note.range == range && note.message == message +<<<<<<< HEAD +======= + && note.file == file +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 }) { self.seen[i] = true; return; @@ -257,7 +385,11 @@ impl<'a> Runner<'a> { && (note.range == range || note.message == message) }) else { // Not even a close match, diagnostic is not annotated. +<<<<<<< HEAD let diag_range = self.format_range(&range); +======= + let diag_range = self.format_range(file, &range); +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 log!(into: self.not_annotated, " {kind}: {diag_range} {}", message); return; }; @@ -267,10 +399,17 @@ impl<'a> Runner<'a> { // Range is wrong. if range != note.range { +<<<<<<< HEAD let note_range = self.format_range(¬e.range); let note_text = self.text_for_range(¬e.range); let diag_range = self.format_range(&range); let diag_text = self.text_for_range(&range); +======= + let note_range = self.format_range(note.file, ¬e.range); + let note_text = self.text_for_range(note.file, ¬e.range); + let diag_range = self.format_range(file, &range); + let diag_text = self.text_for_range(file, &range); +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 log!(self, "mismatched range ({}):", note.pos); log!(self, " message | {}", note.message); log!(self, " annotated | {note_range:<9} | {note_text}"); @@ -286,6 +425,7 @@ impl<'a> Runner<'a> { } /// Display the text for a range. +<<<<<<< HEAD fn text_for_range(&self, range: &Option>) -> String { let Some(range) = range else { return "No text".into() }; if range.is_empty() { @@ -302,10 +442,40 @@ impl<'a> Runner<'a> { self.format_pos(range.start) } else { format!("{}-{}", self.format_pos(range.start,), self.format_pos(range.end,)) +======= + fn text_for_range(&self, file: FileId, range: &Option>) -> String { + let Some(range) = range else { return "No text".into() }; + if range.is_empty() { + return "(empty)".into(); + } + + let lines = self.lookup(file); + lines.text()[range.clone()].replace('\n', "\\n").replace('\r', "\\r") + } + + /// Display a byte range as a line:column range. + fn format_range(&self, file: FileId, range: &Option>) -> String { + let Some(range) = range else { return "No range".into() }; + + let mut preamble = String::new(); + if file != self.test.source.id() { + preamble = format!("\"{}\" ", system_path(file).unwrap().display()); + } + + if range.start == range.end { + format!("{preamble}{}", self.format_pos(file, range.start)) + } else { + format!( + "{preamble}{}-{}", + self.format_pos(file, range.start), + self.format_pos(file, range.end) + ) +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 } } /// Display a position as a line:column pair. +<<<<<<< HEAD fn format_pos(&self, pos: usize) -> String { if let (Some(line_idx), Some(column_idx)) = (self.test.source.byte_to_line(pos), self.test.source.byte_to_column(pos)) @@ -319,18 +489,47 @@ impl<'a> Runner<'a> { } } else { "oob".into() +======= + fn format_pos(&self, file: FileId, pos: usize) -> String { + let lines = self.lookup(file); + + let res = lines.byte_to_line_column(pos).map(|(line, col)| (line + 1, col + 1)); + let Some((line, col)) = res else { + return "oob".into(); + }; + + if line == 1 { format!("{col}") } else { format!("{line}:{col}") } + } + + #[track_caller] + fn lookup(&self, file: FileId) -> Lines { + if self.test.source.id() == file { + self.test.source.lines().clone() + } else { + self.world.lookup(file) +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 } } } /// An output type we can test. +<<<<<<< HEAD trait OutputType: Document { +======= +trait OutputType: Sized { +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 /// The type that represents live output. type Live; /// The path at which the live output is stored. fn live_path(name: &str) -> PathBuf; +<<<<<<< HEAD +======= + /// Compiles the Typst test into this output type. + fn compile(world: &dyn World, test: &Test) -> Warned>; + +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 /// The path at which the reference output is stored. fn ref_path(name: &str) -> PathBuf; @@ -340,10 +539,17 @@ trait OutputType: Document { } /// Produces the live output. +<<<<<<< HEAD fn make_live(&self) -> Self::Live; /// Saves the live output. fn save_live(&self, name: &str, live: &Self::Live); +======= + fn make_live(&self) -> SourceResult; + + /// Saves the live output. + fn save_live(&self, name: &str, live: &Self::Live) -> SourceResult<()>; +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 /// Produces the reference output from the live output. fn make_ref(live: Self::Live) -> Vec; @@ -367,6 +573,13 @@ impl OutputType for PagedDocument { format!("{}/{}.png", crate::REF_PATH, name).into() } +<<<<<<< HEAD +======= + fn compile(world: &dyn World, _: &Test) -> Warned> { + typst::compile(world) + } + +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 fn is_skippable(&self) -> Result { /// Whether rendering of a frame can be skipped. fn skippable_frame(frame: &Frame) -> bool { @@ -387,11 +600,19 @@ impl OutputType for PagedDocument { } } +<<<<<<< HEAD fn make_live(&self) -> Self::Live { render(self, 1.0) } fn save_live(&self, name: &str, live: &Self::Live) { +======= + fn make_live(&self) -> SourceResult { + Ok(render(self, 1.0)) + } + + fn save_live(&self, name: &str, live: &Self::Live) -> SourceResult<()> { +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 // Save live version, possibly rerendering if different scale is // requested. let mut pixmap_live = live; @@ -407,7 +628,11 @@ impl OutputType for PagedDocument { // Write PDF if requested. if crate::ARGS.pdf() { let pdf_path = format!("{}/pdf/{}.pdf", crate::STORE_PATH, name); +<<<<<<< HEAD let pdf = typst_pdf::pdf(self, &PdfOptions::default()).unwrap(); +======= + let pdf = typst_pdf::pdf(self, &PdfOptions::default())?; +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 std::fs::write(pdf_path, pdf).unwrap(); } @@ -417,6 +642,11 @@ impl OutputType for PagedDocument { let svg = typst_svg::svg_merged(self, Abs::pt(5.0)); std::fs::write(svg_path, svg).unwrap(); } +<<<<<<< HEAD +======= + + Ok(()) +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 } fn make_ref(live: Self::Live) -> Vec { @@ -452,6 +682,7 @@ impl OutputType for HtmlDocument { format!("{}/html/{}.html", crate::REF_PATH, name).into() } +<<<<<<< HEAD fn make_live(&self) -> Self::Live { // TODO: Do this earlier to be able to process export errors. typst_html::html(self).unwrap() @@ -459,6 +690,19 @@ impl OutputType for HtmlDocument { fn save_live(&self, name: &str, live: &Self::Live) { std::fs::write(Self::live_path(name), live).unwrap(); +======= + fn compile(world: &dyn World, _: &Test) -> Warned> { + typst::compile(world) + } + + fn make_live(&self) -> SourceResult { + typst_html::html(self) + } + + fn save_live(&self, name: &str, live: &Self::Live) -> SourceResult<()> { + std::fs::write(Self::live_path(name), live).unwrap(); + Ok(()) +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 } fn make_ref(live: Self::Live) -> Vec { @@ -470,6 +714,67 @@ impl OutputType for HtmlDocument { } } +<<<<<<< HEAD +======= +struct Pdftags(String); + +impl OutputType for Pdftags { + type Live = String; + + fn live_path(name: &str) -> PathBuf { + format!("{}/pdftags/{}.yml", crate::STORE_PATH, name).into() + } + + fn ref_path(name: &str) -> PathBuf { + format!("{}/pdftags/{}.yml", crate::REF_PATH, name).into() + } + + fn compile(world: &dyn World, test: &Test) -> Warned> { + let Warned { output, warnings } = typst::compile::(world); + let mut doc = match output { + Ok(doc) => doc, + Err(errors) => return Warned { output: Err(errors), warnings }, + }; + if doc.info.title.is_none() { + doc.info.title = Some("".into()); + } + + let standards = if test.attrs.pdf_ua { + PdfStandards::new(&[PdfStandard::Ua_1]).unwrap() + } else { + PdfStandards::default() + }; + let options = PdfOptions { standards, ..Default::default() }; + let output = typst_pdf::pdf_tags(&doc, &options).map(Pdftags); + Warned { warnings, output } + } + + fn is_skippable(&self) -> Result { + Ok(self.0.is_empty()) + } + + fn make_live(&self) -> SourceResult { + Ok(self.0.clone()) + } + + fn save_live(&self, name: &str, live: &Self::Live) -> SourceResult<()> { + std::fs::write(Self::live_path(name), live).unwrap(); + Ok(()) + } + + fn make_ref(live: Self::Live) -> Vec { + live.into_bytes() + } + + fn matches(live: &Self::Live, ref_data: &[u8]) -> bool { + // Compare lines with newlines stripped, since on windows git might + // check out the ref files with CRLF line endings. + let ref_str = std::str::from_utf8(ref_data).unwrap(); + ref_str.lines().eq(live.lines()) + } +} + +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 /// Draw all frames into one image with padding in between. fn render(document: &PagedDocument, pixel_per_pt: f32) -> sk::Pixmap { for page in &document.pages { diff --git a/tests/src/tests.rs b/tests/src/tests.rs index 26eb63beb5..fcedfcd4bd 100644 --- a/tests/src/tests.rs +++ b/tests/src/tests.rs @@ -59,10 +59,19 @@ fn main() { fn setup() { // Make all paths relative to the workspace. That's nicer for IDEs when // clicking on paths printed to the terminal. +<<<<<<< HEAD std::env::set_current_dir("..").unwrap(); // Create the storage. for ext in ["render", "html", "pdf", "svg"] { +======= + let workspace_dir = + Path::new(env!("CARGO_MANIFEST_DIR")).join(std::path::Component::ParentDir); + std::env::set_current_dir(workspace_dir).unwrap(); + + // Create the storage. + for ext in ["render", "html", "pdf", "pdftags", "svg"] { +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 std::fs::create_dir_all(Path::new(STORE_PATH).join(ext)).unwrap(); } diff --git a/tests/src/world.rs b/tests/src/world.rs index 56ebc86832..b1c5039094 100644 --- a/tests/src/world.rs +++ b/tests/src/world.rs @@ -1,5 +1,8 @@ use std::borrow::Cow; +<<<<<<< HEAD use std::collections::HashMap; +======= +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 use std::fs; use std::io::Write; use std::path::{Path, PathBuf}; @@ -8,18 +11,33 @@ use std::sync::OnceLock; use comemo::Tracked; use parking_lot::Mutex; +<<<<<<< HEAD use typst::diag::{bail, At, FileError, FileResult, SourceResult, StrResult}; use typst::engine::Engine; use typst::foundations::{ func, Array, Bytes, Context, Datetime, IntoValue, NoneValue, Repr, Smart, Value, +======= +use rustc_hash::FxHashMap; +use typst::diag::{At, FileError, FileResult, SourceResult, StrResult, bail}; +use typst::engine::Engine; +use typst::foundations::{ + Array, Bytes, Context, Datetime, IntoValue, NoneValue, Repr, Smart, Value, func, +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 }; use typst::layout::{Abs, Margin, PageElem}; use typst::model::{Numbering, NumberingPattern}; use typst::syntax::{FileId, Source, Span}; use typst::text::{Font, FontBook, TextElem, TextSize}; +<<<<<<< HEAD use typst::utils::{singleton, LazyHash}; use typst::visualize::Color; use typst::{Feature, Library, World}; +======= +use typst::utils::{LazyHash, singleton}; +use typst::visualize::Color; +use typst::{Feature, Library, LibraryExt, World}; +use typst_syntax::Lines; +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 /// A world that provides access to the tests environment. #[derive(Clone)] @@ -67,7 +85,11 @@ impl World for TestWorld { } fn font(&self, index: usize) -> Option { +<<<<<<< HEAD Some(self.base.fonts[index].clone()) +======= + self.base.fonts.get(index).cloned() +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 } fn today(&self, _: Option) -> Option { @@ -84,6 +106,25 @@ impl TestWorld { let mut map = self.base.slots.lock(); f(map.entry(id).or_insert_with(|| FileSlot::new(id))) } +<<<<<<< HEAD +======= + + /// Lookup line metadata for a file by id. + #[track_caller] + pub(crate) fn lookup(&self, id: FileId) -> Lines { + self.slot(id, |slot| { + if let Some(source) = slot.source.get() { + let source = source.as_ref().expect("file is not valid"); + source.lines().clone() + } else if let Some(bytes) = slot.file.get() { + let bytes = bytes.as_ref().expect("file is not valid"); + Lines::try_from(bytes).expect("file is not valid utf-8") + } else { + panic!("file id does not point to any source file"); + } + }) + } +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 } /// Shared foundation of all test worlds. @@ -91,7 +132,11 @@ struct TestBase { library: LazyHash, book: LazyHash, fonts: Vec, +<<<<<<< HEAD slots: Mutex>, +======= + slots: Mutex>, +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 } impl Default for TestBase { @@ -105,7 +150,11 @@ impl Default for TestBase { library: LazyHash::new(library()), book: LazyHash::new(FontBook::from_fonts(&fonts)), fonts, +<<<<<<< HEAD slots: Mutex::new(HashMap::new()), +======= + slots: Mutex::new(FxHashMap::default()), +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 } } } @@ -149,7 +198,11 @@ impl FileSlot { } /// The file system path for a file ID. +<<<<<<< HEAD fn system_path(id: FileId) -> FileResult { +======= +pub(crate) fn system_path(id: FileId) -> FileResult { +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 let root: PathBuf = match id.package() { Some(spec) => format!("tests/packages/{}-{}", spec.name, spec.version).into(), None => PathBuf::new(), @@ -159,7 +212,11 @@ fn system_path(id: FileId) -> FileResult { } /// Read a file. +<<<<<<< HEAD fn read(path: &Path) -> FileResult> { +======= +pub(crate) fn read(path: &Path) -> FileResult> { +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 // Resolve asset. if let Ok(suffix) = path.strip_prefix("assets/") { return typst_dev_assets::get(&suffix.to_string_lossy()) @@ -181,7 +238,11 @@ fn library() -> Library { // exactly 100pt wide. Page height is unbounded and font size is 10pt so // that it multiplies to nice round numbers. let mut lib = Library::builder() +<<<<<<< HEAD .with_features([Feature::Html].into_iter().collect()) +======= + .with_features([Feature::Html, Feature::A11yExtras].into_iter().collect()) +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 .build(); // Hook up helpers into the global scope. @@ -197,6 +258,7 @@ fn library() -> Library { .define("forest", Color::from_u8(0x43, 0xA1, 0x27, 0xFF)); // Hook up default styles. +<<<<<<< HEAD lib.styles .set(PageElem::set_width(Smart::Custom(Abs::pt(120.0).into()))); lib.styles.set(PageElem::set_height(Smart::Auto)); @@ -204,6 +266,13 @@ fn library() -> Library { Abs::pt(10.0).into(), ))))); lib.styles.set(TextElem::set_size(TextSize(Abs::pt(10.0).into()))); +======= + lib.styles.set(PageElem::width, Smart::Custom(Abs::pt(120.0).into())); + lib.styles.set(PageElem::height, Smart::Auto); + lib.styles + .set(PageElem::margin, Margin::splat(Some(Smart::Custom(Abs::pt(10.0).into())))); + lib.styles.set(TextElem::size, TextSize(Abs::pt(10.0).into())); +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 lib } @@ -244,13 +313,21 @@ fn lines( engine: &mut Engine, context: Tracked, span: Span, +<<<<<<< HEAD count: usize, +======= + count: u64, +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 #[default(Numbering::Pattern(NumberingPattern::from_str("A").unwrap()))] numbering: Numbering, ) -> SourceResult { (1..=count) .map(|n| numbering.apply(engine, context, &[n])) .collect::>()? +<<<<<<< HEAD .join(engine, span, Some('\n'.into_value()), None) +======= + .join(Some('\n'.into_value()), None, None) +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 .at(span) } diff --git a/tests/suite/foundations/array.typ b/tests/suite/foundations/array.typ index 6228f471bf..844b9c8b81 100644 --- a/tests/suite/foundations/array.typ +++ b/tests/suite/foundations/array.typ @@ -179,6 +179,13 @@ #test((2,).last(), 2) #test((1, 2, 3).first(), 1) #test((1, 2, 3).last(), 3) +<<<<<<< HEAD +======= +#test((1, 2).first(default: 99), 1) +#test(().first(default: 99), 99) +#test((1, 2).last(default: 99), 2) +#test(().last(default: 99), 99) +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 --- array-first-empty --- // Error: 2-12 array is empty @@ -219,6 +226,11 @@ #test(range(10).slice(2, 6), (2, 3, 4, 5)) #test(range(10).slice(4, count: 3), (4, 5, 6)) #test(range(10).slice(-5, count: 2), (5, 6)) +<<<<<<< HEAD +======= +#test((1, 2, 3).slice(-3, count: 3), (1, 2, 3)) +#test((1, 2, 3).slice(-1, count: 1), (3,)) +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 #test((1, 2, 3).slice(2, -2), ()) #test((1, 2, 3).slice(-2, 2), (2,)) #test((1, 2, 3).slice(-3, 2), (1, 2)) @@ -228,6 +240,13 @@ // Error: 2-30 array index out of bounds (index: 12, len: 10) #range(10).slice(9, count: 3) +<<<<<<< HEAD +======= +--- array-slice-out-of-bounds-from-back --- +// Error: 2-31 array index out of bounds (index: 12, len: 10) +#range(10).slice(-2, count: 4) + +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 --- array-slice-out-of-bounds-negative --- // Error: 2-24 array index out of bounds (index: -4, len: 3) #(1, 2, 3).slice(0, -4) @@ -290,6 +309,14 @@ #test(("a", "b", "c").join(), "abc") #test("(" + ("a", "b", "c").join(", ") + ")", "(a, b, c)") +<<<<<<< HEAD +======= +--- array-join-default --- +#test(().join(default: "EMPTY", ", "), "EMPTY") +#test(("hello",).join(default: "EMPTY", ", "), "hello") +#test(("hello", "world").join(default: "EMPTY", ", "), "hello, world") + +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 --- array-join-bad-values --- // Error: 2-22 cannot join boolean with boolean #(true, false).join() @@ -355,6 +382,15 @@ #test((2, 1, 3, 10, 5, 8, 6, -7, 2).sorted(), (-7, 1, 2, 2, 3, 5, 6, 8, 10)) #test((2, 1, 3, -10, -5, 8, 6, -7, 2).sorted(key: x => x), (-10, -7, -5, 1, 2, 2, 3, 6, 8)) #test((2, 1, 3, -10, -5, 8, 6, -7, 2).sorted(key: x => x * x), (1, 2, 2, 3, -5, 6, -7, 8, -10)) +<<<<<<< HEAD +======= +#test(("I", "the", "hi", "text").sorted(by: (x, y) => x.len() < y.len()), ("I", "hi", "the", "text")) +#test(("I", "the", "hi", "text").sorted(key: x => x.len(), by: (x, y) => y < x), ("text", "the", "hi", "I")) + +--- array-sorted-invalid-by-function --- +// Error: 2-39 expected boolean from `by` function, got string +#(1, 2, 3).sorted(by: (_, _) => "hmm") +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 --- array-sorted-key-function-positional-1 --- // Error: 12-18 unexpected argument diff --git a/tests/suite/foundations/bytes.typ b/tests/suite/foundations/bytes.typ index c708927804..0121a335ff 100644 --- a/tests/suite/foundations/bytes.typ +++ b/tests/suite/foundations/bytes.typ @@ -29,3 +29,21 @@ --- bytes-bad-conversion-from-dict --- // Error: 8-14 expected string, array, or bytes, found dictionary #bytes((a: 1)) +<<<<<<< HEAD +======= + +--- bytes-slice --- +// Test the `slice` method. +#test(bytes("abcd").slice(2), bytes("cd")) +#test(bytes("abcd").slice(0, 3), bytes("abc")) +#test(bytes("abcd").slice(1, -1), bytes("bc")) +#test(bytes("abcd").slice(3, 3), bytes("")) +#test(bytes("abcd").slice(3, 0), bytes("")) +#test(bytes("abcd").slice(-2), bytes("cd")) +#test(bytes("abcd").slice(-3, 2), bytes("b")) +#test(bytes("abcd").slice(-3, -1), bytes("bc")) +#test(bytes("abcd").slice(-2, -2), bytes("")) +#test(bytes("abcd").slice(1, count: 3), bytes("bcd")) +#test(bytes("abcd").slice(-3, count: 3), bytes("bcd")) +#test(bytes("abcd").slice(2, count: 0), bytes("")) +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 diff --git a/tests/suite/foundations/context.typ b/tests/suite/foundations/context.typ index e506d50db4..74956a57dd 100644 --- a/tests/suite/foundations/context.typ +++ b/tests/suite/foundations/context.typ @@ -49,3 +49,10 @@ let fonts = ("nope", "Roboto") set text(font: fonts.at(n)) } +<<<<<<< HEAD +======= + +--- context-body-is-closure --- +// Regression test since this used to be a hard crash. +#(context (a: none) => {}) +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 diff --git a/tests/suite/foundations/dict.typ b/tests/suite/foundations/dict.typ index af9ad5e1ad..c7e7906019 100644 --- a/tests/suite/foundations/dict.typ +++ b/tests/suite/foundations/dict.typ @@ -145,6 +145,37 @@ #dict.remove("b") #test(dict.keys(), ("a", "c", "d")) +<<<<<<< HEAD +======= +--- dict-insert-order --- +#let dict = (a: 1, b: 2) +#let rhs = (c: 3, a: 4) + +// Add +#test((dict + rhs).keys(), ("a", "b", "c")) + +// Join +#test({ dict; rhs }.keys(), ("a", "b", "c")) + +// Spread +#test((:..dict, ..rhs).keys(), ("a", "b", "c")) + +// Insert +#{ + for (k, v) in rhs { + dict.insert(k, v) + } + test(dict.keys(), ("a", "b", "c")) +} + +// Assign +#{ + dict.a = 5 + dict.d = 6 + test(dict.keys(), ("a", "b", "c", "d")) +} + +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 --- dict-temporary-lvalue --- // Error: 3-15 cannot mutate a temporary value #((key: "val").other = "some") diff --git a/tests/suite/foundations/eval.typ b/tests/suite/foundations/eval.typ index f85146b235..4f2bfc28ed 100644 --- a/tests/suite/foundations/eval.typ +++ b/tests/suite/foundations/eval.typ @@ -52,3 +52,12 @@ _Tiger!_ #eval(mode: "math", "f(a) = cases(a + b\, space space x >= 3,a + b\, space space x = 5)") $f(a) = cases(a + b\, space space x >= 3,a + b\, space space x = 5)$ +<<<<<<< HEAD +======= + +--- issue-6067-eval-warnings --- +// Test that eval shows warnings from the executed code. +// Warning: 7-11 no text within stars +// Hint: 7-11 using multiple consecutive stars (e.g. **) has no additional effect +#eval("**", mode: "markup") +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 diff --git a/tests/suite/foundations/float.typ b/tests/suite/foundations/float.typ index a18e9f09a1..bf8b7891db 100644 --- a/tests/suite/foundations/float.typ +++ b/tests/suite/foundations/float.typ @@ -107,6 +107,7 @@ #123.E // this is a field access, so is fine syntactically #0.e #1.E+020 +<<<<<<< HEAD // Error: 2-10 invalid number: 123.456e #123.456e // Error: 2-11 invalid number: 123.456e+ @@ -114,4 +115,13 @@ // Error: 2-6 invalid number: .1E- #.1E- // Error: 2-4 invalid number: 0e +======= +// Error: 2-10 invalid floating point number: 123.456e +#123.456e +// Error: 2-11 invalid floating point number: 123.456e+ +#123.456e+ +// Error: 2-6 invalid floating point number: .1E- +#.1E- +// Error: 2-4 invalid floating point number: 0e +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 #0e diff --git a/tests/suite/foundations/label.typ b/tests/suite/foundations/label.typ index 3b84c2d709..c05003d54d 100644 --- a/tests/suite/foundations/label.typ +++ b/tests/suite/foundations/label.typ @@ -92,3 +92,10 @@ _Visible_ --- label-non-existent-error --- // Error: 5-10 sequence does not have field "label" #[].label +<<<<<<< HEAD +======= + +--- label-empty --- +// Error: 23-32 label name must not be empty += Something to label #label("") +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 diff --git a/tests/suite/foundations/repr.typ b/tests/suite/foundations/repr.typ index 2f2c055ad9..88ea8f2be8 100644 --- a/tests/suite/foundations/repr.typ +++ b/tests/suite/foundations/repr.typ @@ -35,6 +35,10 @@ #t(f, `f`) #t(rect , `rect`) #t(() => none, `(..) => ..`) +<<<<<<< HEAD +======= +#t(f.with(), `(..) => ..`) +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 // Types. #t(int, `int`) diff --git a/tests/suite/foundations/str.typ b/tests/suite/foundations/str.typ index 56756416d7..53f8e89469 100644 --- a/tests/suite/foundations/str.typ +++ b/tests/suite/foundations/str.typ @@ -86,6 +86,16 @@ // Error: 2-28 0x110000 is not a valid codepoint #str.from-unicode(0x110000) // 0x10ffff is the highest valid code point +<<<<<<< HEAD +======= +--- str-normalize --- +// Test the `normalize` method. +#test("e\u{0301}".normalize(form: "nfc"), "é") +#test("é".normalize(form: "nfd"), "e\u{0301}") +#test("ſ\u{0301}".normalize(form: "nfkc"), "ś") +#test("ſ\u{0301}".normalize(form: "nfkd"), "s\u{0301}") + +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 --- string-len --- // Test the `len` method. #test("Hello World!".len(), 12) @@ -96,6 +106,13 @@ #test("Hello".last(), "o") #test("🏳️‍🌈A🏳️‍⚧️".first(), "🏳️‍🌈") #test("🏳️‍🌈A🏳️‍⚧️".last(), "🏳️‍⚧️") +<<<<<<< HEAD +======= +#test("hey".first(default: "d"), "h") +#test("".first(default: "d"), "d") +#test("hey".last(default: "d"), "y") +#test("".last(default: "d"), "d") +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 --- string-first-empty --- // Error: 2-12 string is empty @@ -134,6 +151,11 @@ #test("abc🏡def".slice(2, 7), "c🏡") #test("abc🏡def".slice(2, -2), "c🏡d") #test("abc🏡def".slice(-3, -1), "de") +<<<<<<< HEAD +======= +#test("x🏡yz".slice(-2, count: 2), "yz") +#test("x🏡yz".slice(-7, count: 7), "x🏡yz") +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 --- string-slice-not-a-char-boundary --- // Error: 2-21 string index -1 is not a character boundary diff --git a/tests/suite/foundations/type.typ b/tests/suite/foundations/type.typ index 8f3dbea7b9..a667082b67 100644 --- a/tests/suite/foundations/type.typ +++ b/tests/suite/foundations/type.typ @@ -2,6 +2,7 @@ #test(type(1), int) #test(type(ltr), direction) #test(type(10 / 3), float) +<<<<<<< HEAD #test(type(10) == int, true) #test(type(10) != int, false) @@ -58,6 +59,8 @@ // Warning: 7-37 checking whether a type is contained in a dictionary is deprecated // Hint: 7-37 this compatibility behavior only exists because `type` used to return a string #test(int in (integer: 1, string: 2), true) +======= +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 --- issue-3110-type-constructor --- // Let the error message report the type name. diff --git a/tests/suite/html/elem.typ b/tests/suite/html/elem.typ index b416fdf946..118543235c 100644 --- a/tests/suite/html/elem.typ +++ b/tests/suite/html/elem.typ @@ -13,3 +13,28 @@ Text val }) #metadata("Hi") +<<<<<<< HEAD +======= + +--- html-elem-custom html --- +#html.elem("my-element")[Hi] +#html.elem("custom-button")[Hi] +#html.elem("multi-word-component")[Hi] +#html.elem("element-")[Hi] + +--- html-elem-invalid --- +// Error: 12-24 the character "@" is not valid in a tag name +#html.elem("my@element") + +--- html-elem-custom-bad-start html --- +// Error: 12-22 custom element name must start with a lowercase letter +#html.elem("1-custom") + +--- html-elem-custom-uppercase html --- +// Error: 12-21 custom element name must not contain uppercase letters +#html.elem("my-ELEM") + +--- html-elem-custom-reserved html --- +// Error: 12-28 name is reserved and not valid for a custom element +#html.elem("annotation-xml") +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 diff --git a/tests/suite/html/frame.typ b/tests/suite/html/frame.typ new file mode 100644 index 0000000000..e389dc5d65 --- /dev/null +++ b/tests/suite/html/frame.typ @@ -0,0 +1,9 @@ +--- html-frame html --- +A rectangle: +#html.frame(rect()) + +--- html-frame-in-layout --- +// Ensure that HTML frames are transparent in layout. This is less important for +// actual paged export than for _nested_ HTML frames, which take the same code +// path. +#html.frame[A] diff --git a/tests/suite/html/syntax.typ b/tests/suite/html/syntax.typ new file mode 100644 index 0000000000..06552c0626 --- /dev/null +++ b/tests/suite/html/syntax.typ @@ -0,0 +1,222 @@ +--- html-void-element-with-children html --- +// Error: 2-27 HTML void elements must not have children +#html.elem("img", [Hello]) + +--- html-space-collapsing html --- +// Note: .. = .. +#import html: span + += Single spaces +// No collapsing. +#"A B" +// -> A B + +// No collapsing, multiple text elements. +#"A"#" "#"B" +// -> A B + +// Across span boundaries: 0-1. +#span[A] B +// -> A B + +// With span in between. +#"A "#span()#" B" +// -> A B + +// With metadata in between. +#"A "#metadata(none)#" B" +// -> A B + +// Within span. +#span("A ")B +// -> A B + += Consecutive whitespace +// Single text element. +#"A B C" +// -> A B C + +// Multiple text elements. +A#" "B#" C" +// -> A B C + +// Across span boundaries: 1-1. +#span("A ") B +// -> A B + +// Across span boundaries: 1-2. +#span("A ")#" B" +// -> A B + +// Across span boundaries: 2-1. +#span("A ") B +// -> A B + +// Across span boundaries: 2-2. +#span("A ")#" B" +// -> A B + +// With span in between. +#"A "#span()#" B" +// -> A B + +// With metadata in between. +#"A "#metadata(none)#" B" +// -> A B + += Leading whitespace +// Leading space. +#" A" +// -> A + +// Leading space in span. +#span(" ")A +// -> A + +// Leading space with preceding empty element. +#span()#" "A +// -> A + += Trailing whitespace +// Trailing space. +#"A " +// -> A + +// Trailing space in element. +#span("A ") +// -> A + +// Trailing space in element with following empty element. +#span("A ")#span() +// -> A + += Tabs +// Single text element. +#"A\tB" +// -> A B + +// Multiple text elements. +#"A"#"\t"#"B" +// -> A B + +// Spaces + Tab. +#"A \t B" +// -> A B + += Newlines +// Normal line feed. +#"A\nB" +// -> A
B + +// CRLF. +#"A\r\nB" +// -> A
B + +// Spaces + newline. +#"A \n B" +// -> A
B + +// Explicit `
` element. +#"A "#html.br()#" B" +// -> A
B + +// Newline in span. +#"A "#span("\n")#" B" +// -> A
B + += With default ignorables +// With default ignorable in between. +#"A \u{200D} B" +// -> A ‍ B + +#"A \u{200D} B" +// -> A B + += Everything +// Everything at once. +#span(" A ")#"\r\n\t"B#" "#span() +// -> A
B + += Special +// Escapable raw. +#html.textarea("A B") +// -> + +// Preformatted. +#html.pre("A B") +// ->
A  B
+ +--- html-pre-starting-with-newline html --- +#html.pre("hello") +#html.pre("\nhello") +#html.pre("\n\nhello") + +--- html-textarea-starting-with-newline html --- +#html.textarea("\nenter") + +--- html-script html --- +// This should be pretty and indented. +#html.script( + ```js + const x = 1 + const y = 2 + console.log(x < y, Math.max(1, 2)) + ```.text, +) + +// This should have extra newlines, but no indent because of the multiline +// string literal. +#html.script("console.log(`Hello\nWorld`)") + +// This should be untouched. +#html.script( + type: "text/python", + ```py + x = 1 + y = 2 + print(x < y, max(x, y)) + ```.text, +) + +--- html-style html --- +// This should be pretty and indented. +#html.style( + ```css + body { + text: red; + } + ```.text, +) + +--- html-raw-text-contains-elem html --- +// Error: 14-32 HTML raw text element cannot have non-text children +#html.script(html.strong[Hello]) + +--- html-raw-text-contains-frame html --- +// Error: 14-31 HTML raw text element cannot have non-text children +#html.script(html.frame[Hello]) + +--- html-raw-text-contains-closing-tag html --- +// Error: 2-32 HTML raw text element cannot contain its own closing tag +// Hint: 2-32 the sequence `") + +--- html-non-char html --- +// Error: 1-9 the character `"\u{fdd0}"` cannot be encoded in HTML +\u{fdd0} + +--- html-raw-text-non-char html --- +// Error: 24-32 the character `"\u{fdd0}"` cannot be encoded in HTML +#html.script[const x = \u{fdd0}] + +--- html-escapable-raw-text-non-char html --- +// Error: 23-31 the character `"\u{fdd0}"` cannot be encoded in HTML +#html.textarea[Typing \u{fdd0}] diff --git a/tests/suite/html/typed.typ b/tests/suite/html/typed.typ new file mode 100644 index 0000000000..e8fa9f6e7d --- /dev/null +++ b/tests/suite/html/typed.typ @@ -0,0 +1,187 @@ +--- html-typed html --- +// String +#html.div(id: "hi") + +// Different kinds of options. +#html.div(aria-autocomplete: none) // "none" +#html.div(aria-expanded: none) // "undefined" +#html.link(referrerpolicy: none) // present + +// Different kinds of bools. +#html.div(autofocus: false) // absent +#html.div(autofocus: true) // present +#html.div(hidden: false) // absent +#html.div(hidden: true) // present +#html.div(aria-atomic: false) // "false" +#html.div(aria-atomic: true) // "true" +#html.div(translate: false) // "no" +#html.div(translate: true) // "yes" +#html.form(autocomplete: false) // "on" +#html.form(autocomplete: true) // "off" + +// Char +#html.div(accesskey: "K") + +// Int +#html.div(aria-colcount: 2) +#html.object(width: 120, height: 10) +#html.td(rowspan: 2) + +// Float +#html.meter(low: 3.4, high: 7.9) + +// Space-separated strings. +#html.div(class: "alpha") +#html.div(class: "alpha beta") +#html.div(class: ("alpha", "beta")) + +// Comma-separated strings. +#html.div(html.input(accept: "image/jpeg")) +#html.div(html.input(accept: "image/jpeg, image/png")) +#html.div(html.input(accept: ("image/jpeg", "image/png"))) + +// Comma-separated floats. +#html.area(coords: (2.3, 4, 5.6)) + +// Colors. +#for c in ( + red, + red.lighten(10%), + luma(50%), + cmyk(10%, 20%, 30%, 40%), + oklab(27%, 20%, -3%, 50%), + color.linear-rgb(20%, 30%, 40%, 50%), + color.hsl(20deg, 10%, 20%), + color.hsv(30deg, 20%, 30%), +) { + html.link(color: c) +} + +// Durations & datetimes. +#for d in ( + duration(weeks: 3, seconds: 4), + duration(days: 1, minutes: 4), + duration(), + datetime(day: 10, month: 7, year: 2005), + datetime(day: 1, month: 2, year: 0), + datetime(hour: 6, minute: 30, second: 0), + datetime(day: 1, month: 2, year: 0, hour: 11, minute: 11, second: 0), + datetime(day: 1, month: 2, year: 0, hour: 6, minute: 0, second: 9), +) { + html.div(html.time(datetime: d)) +} + +// Direction +#html.div(dir: ltr)[RTL] + +// Image candidate and source size. +#html.img( + src: "image.png", + alt: "My wonderful image", + srcset: ( + (src: "/image-120px.png", width: 120), + (src: "/image-60px.png", width: 60), + ), + sizes: ( + (condition: "min-width: 800px", size: 400pt), + (condition: "min-width: 400px", size: 250pt), + ) +) + +// String enum. +#html.form(enctype: "text/plain") +#html.form(role: "complementary") +#html.div(hidden: "until-found") + +// Or. +#html.div(aria-checked: false) +#html.div(aria-checked: true) +#html.div(aria-checked: "mixed") + +// Input value. +#html.div(html.input(value: 5.6)) +#html.div(html.input(value: red)) +#html.div(html.input(min: 3, max: 9)) + +// Icon size. +#html.link(rel: "icon", sizes: ((32, 24), (64, 48))) + +--- html-typed-dir-str html --- +// Error: 16-21 expected direction or auto, found string +#html.div(dir: "ltr") + +--- html-typed-char-too-long html --- +// Error: 22-35 expected exactly one character +#html.div(accesskey: ("Ctrl", "K")) + +--- html-typed-int-negative html --- +// Error: 18-21 number must be at least zero +#html.img(width: -10) + +--- html-typed-int-zero html --- +// Error: 22-23 number must be positive +#html.textarea(rows: 0) + +--- html-typed-float-negative html --- +// Error: 19-23 number must be positive +#html.input(step: -3.4) + +--- html-typed-string-array-with-space html --- +// Error: 18-41 array item may not contain a space +// Hint: 18-41 the array attribute will be encoded as a space-separated string +#html.div(class: ("alpha beta", "gamma")) + +--- html-typed-float-array-invalid-shorthand html --- +// Error: 20-23 expected array, found float +#html.area(coords: 4.5) + +--- html-typed-dir-vertical html --- +// Error: 16-19 direction must be horizontal +#html.div(dir: ttb) + +--- html-typed-string-enum-invalid html --- +// Error: 21-28 expected "application/x-www-form-urlencoded", "multipart/form-data", or "text/plain" +#html.form(enctype: "utf-8") + +--- html-typed-or-invalid --- +// Error: 25-31 expected boolean or "mixed" +#html.div(aria-checked: "nope") + +--- html-typed-string-enum-or-array-invalid --- +// Error: 27-33 expected array, "additions", "additions text", "all", "removals", or "text" +// Error: 49-54 expected boolean or "mixed" +#html.link(aria-relevant: "nope", aria-checked: "yes") + +--- html-typed-srcset-both-width-and-density html --- +// Error: 19-64 cannot specify both `width` and `density` +#html.img(srcset: ((src: "img.png", width: 120, density: 0.5),)) + +--- html-typed-srcset-src-comma html --- +// Error: 19-50 `src` must not start or end with a comma +#html.img(srcset: ((src: "img.png,", width: 50),)) + +--- html-typed-sizes-string-size html --- +// Error: 18-66 expected length, found string +// Hint: 18-66 CSS lengths that are not expressible as Typst lengths are not yet supported +// Hint: 18-66 you can use `html.elem` to create a raw attribute +#html.img(sizes: ((condition: "min-width: 100px", size: "10px"),)) + +--- html-typed-input-value-invalid html --- +// Error: 20-25 expected string, float, datetime, color, or array, found boolean +#html.input(value: false) + +--- html-typed-input-bound-invalid html --- +// Error: 18-21 expected string, float, or datetime, found color +#html.input(min: red) + +--- html-typed-icon-size-invalid html --- +// Error: 32-45 expected array, found string +#html.link(rel: "icon", sizes: "10x20 20x30") + +--- html-typed-hidden-none html --- +// Error: 19-23 expected boolean or "until-found", found none +#html.div(hidden: none) + +--- html-typed-invalid-body html --- +// Error: 10-14 unexpected argument +#html.img[hi] diff --git a/tests/suite/introspection/counter.typ b/tests/suite/introspection/counter.typ index 2f095f2fb4..7d06ec09ba 100644 --- a/tests/suite/introspection/counter.typ +++ b/tests/suite/introspection/counter.typ @@ -164,3 +164,25 @@ B #context test(c.get(), (1,)) #c.step(level: 3) #context test(c.get(), (1, 0, 1)) +<<<<<<< HEAD +======= + +--- counter-huge --- +// Test values greater than 32-bits +#let c = counter("c") +#c.update(100000000001) +#context test(c.get(), (100000000001,)) +#c.step() +#context test(c.get(), (100000000002,)) +#c.update(n => n + 2) +#context test(c.get(), (100000000004,)) + +--- counter-rtl --- +#set page(width: auto) +#let c = counter("c") +#let s = context c.display() + c.step() +#let tree = [درخت] +#let line = [A #s B #tree #s #tree #s #tree C #s D #s] +#line \ +#line +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 diff --git a/tests/suite/introspection/locate.typ b/tests/suite/introspection/locate.typ index 18611dded8..e41fb4072f 100644 --- a/tests/suite/introspection/locate.typ +++ b/tests/suite/introspection/locate.typ @@ -11,6 +11,28 @@ #v(10pt) #context test(here().position().y, 20pt) +<<<<<<< HEAD +======= +--- locate-start-of-par --- +#metadata(none)A#metadata(none)B + +// The first metadata has its end tag before the paragraph, so it does not +// become part of the paragraph and thus its Y position is determined by the +// flow. +#context assert( + locate().position().y < locate().position().y +) + +// The first footnote becomes part of the paragraph. Thus, its Y position is +// determined by inline layout. +#footnote[c]C#footnote[d]D + +#context test( + locate().position().y, + locate().position().y, +) + +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 --- locate-missing-label --- // Error: 10-25 label `` does not exist in the document #context locate() @@ -72,6 +94,21 @@ B #pagebreak(weak: true) #metadata(none) +<<<<<<< HEAD +======= +--- locate-migrated-breakable --- +// Ensure that when a breakable element fully migrates to the next page without +// orphan frames, its position correctly reflects that. +#set page(height: 40pt) +A +#block[B] + +#context test( + locate().position(), + (page: 2, x: 10pt, y: 10pt), +) + +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 --- issue-4029-locate-after-spacing --- #set page(margin: 10pt) #show heading: it => v(40pt) + it diff --git a/tests/suite/introspection/tags.typ b/tests/suite/introspection/tags.typ new file mode 100644 index 0000000000..dcc53bff83 --- /dev/null +++ b/tests/suite/introspection/tags.typ @@ -0,0 +1,87 @@ +--- tags-grouping --- +// Test how grouping rules handle tags at their edges. To observe this scenario, +// we have a link at the start or end of a paragraph and see whether the two +// nest correctly. +// +// The tag nesting check is done as a custom check as, unfortunately, there isn't +// really a way to test end tags from Typst code. +// +// On top that we are checking that trailing start/end combos tags after the +// grouping, but before a tag that is matched in the group are also kept in the +// grouping. This we can check from within Typst code via show rules with +// metadata, which is done below. + +// Hide everything ... we don't need a reference image. +#set text(size: 0pt) +#show: hide +#show ref: [Ref] + +#let case(body, output) = context { + // Get a unique key for the case. + let key = here() + let tagged(s, it) = { + metadata((key, "<" + s + ">")) + it + metadata((key, "")) + } + + // Note: This only works for locatable elements because otherwise the + // metadata tags won't be sandwiched by other tags and not forced into the + // paragraph grouping. + show par: tagged.with("p") + show link: tagged.with("a") + show ref: tagged.with("ref") + body + + context test( + // Finds only metadata keyed by `key`, which is unique for this case. + query(metadata) + .filter(e => e.value.first() == key) + .map(e => e.value.last()) + .join(), + output + ) +} + +// Because `par` is not currently locatable, we need another way to ensure +// tags are generated around it. This can be removed once par is locatable. +#show par: quote +#show quote: it => it.body + +// Both link and ref are contained in the paragraph. +#case( + [@ref #link("A")[A]], + "

" +) + +// When there's a trailing space, that's okay. +#case( + [@ref #link("A")[A ]], + "

" +) + +// Both link and ref are contained in the paragraph. +#case( + [#link("A")[A] @ref], + "

" +) + +// When there's a leading space, that's okay. +#case( + [#link("A")[ A] @ref], + "

" +) + +// When there's only a link, it will surround the paragraph. +#case( + link("A")[A], + "

" +) + +--- tags-textual --- +// Ensure that tags and spaces aren't reordered in textual grouping. +A#metadata(none) #metadata(none)#box[B] + +#context assert( + locate().position().x + 1pt < locate().position().x +) diff --git a/tests/suite/layout/align.typ b/tests/suite/layout/align.typ index c4ed9ab953..0783dcc0e3 100644 --- a/tests/suite/layout/align.typ +++ b/tests/suite/layout/align.typ @@ -34,7 +34,11 @@ To the right! Where the sunlight peeks behind the mountain. #align(start)[Start] #align(end)[Ende] +<<<<<<< HEAD #set text(lang: "ar") +======= +#set text(lang: "ar", font: "Noto Sans Arabic") +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 #align(start)[يبدأ] #align(end)[نهاية] diff --git a/tests/suite/layout/container.typ b/tests/suite/layout/container.typ index f15ddfe4a4..38dbf53a05 100644 --- a/tests/suite/layout/container.typ +++ b/tests/suite/layout/container.typ @@ -64,6 +64,15 @@ First! is the sun. ] +<<<<<<< HEAD +======= +--- block-multiple-pages-empty --- +#set page(height: 60pt) +A +#block(height: 30pt) +B + +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 --- block-box-fill --- #set page(height: 100pt) #let words = lorem(18).split() @@ -152,6 +161,29 @@ Paragraph #show bibliography: none #bibliography("/assets/bib/works.bib") +<<<<<<< HEAD +======= +--- box-inset-ratio --- +#let body-width = 10pt +#context for inset in range(10).map(n => n / 10) { + // If there's infinite available space, then: + // ``` + // measured-width = body-width + measured-width × inset. + // ``` + // (not counting truncation errors) + let (width: measured-width) = measure( + box( + // Outset should not affect inset. + outset: 137pt, + inset: (left: 100% * inset), + block(width: body-width) + ), + width: auto, + ) + assert.eq(measured-width, body-width / (1 - inset)) +} + +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 --- block-sticky --- #set page(height: 100pt) #lines(3) @@ -287,6 +319,40 @@ Paragraph #block(width: 100%, fill: red, box("a box")) #block(width: 100%, fill: red, [#box("a box") #box()]) +<<<<<<< HEAD +======= +--- issue-2914-block-height-cut-off --- +// Ensure that breaking a block doesn't shrink its height. +#set page(height: 65pt) +#set block(fill: aqua, width: 25pt, height: 25pt, inset: 5pt) + +#block[A] +#block[B] + +--- issue-2914-block-fill-skip-nested --- +// Ensure that fill and stroke are skipped for an empty frame with a nested block. +#set page(height: 50pt) +A +#block(fill: aqua, stroke: blue, inset: 5pt, width: 100%, block[B]) + +--- issue-6304-block-skip-label --- +// Ensure that labeling is skipped for an empty orphan frame. +#set page(height: 60pt) +A +#block(sticky: true)[B] +#block[C] #metadata(none) Hi] + +#link()[A] // creates empty span +#link()[B] // creates second empty span +#link()[C] // links to #a because the generated span is contained in it + +--- link-html-frame html --- += Frame 1 +#html.frame(block( + stroke: 1pt, + width: 200pt, + height: 500pt, +)[ + #place(center, dy: 100pt, stack( + dir: ltr, + spacing: 10pt, + link(, square(size: 10pt, fill: teal)), + link(, square(size: 10pt, fill: black)), + link(, square(size: 10pt, fill: yellow)), + )) + #place(center, dy: 200pt)[ + #square(size: 10pt, fill: teal) + ] +]) + += Text +#link()[Go to teal square] + += Frame 2 +#html.frame(block( + stroke: 1pt, + width: 200pt, + height: 500pt, +)[ + #place(center, dy: 100pt)[ + #square(size: 10pt, fill: yellow) + ] +]) + +--- link-html-frame-ref html --- +// Test that reference links work in `html.frame`. Currently, references (and a +// few other elements) do not internally use `LinkElem`s, so they trigger a +// slightly different code path; see `typst-html/src/link.rs`. The text show +// rule is only there to keep the output small. +#set heading(numbering: "1") +#show "Section" + sym.space.nobreak + "1": rect() +#html.frame[@intro] += Introduction + +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 --- link-to-label-missing --- // Error: 2-20 label `` does not exist in the document #link()[Nope.] @@ -76,8 +196,17 @@ Text // Error: 2-20 label `` occurs multiple times in the document #link()[Nope.] +<<<<<<< HEAD --- link-empty-block --- #link("", block(height: 10pt, width: 100%)) +======= +--- link-empty-url --- +// Error: 7-9 URL must not be empty +#link("")[Empty] + +--- link-empty-block --- +#link("https://example.com", block(height: 10pt, width: 100%)) +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 --- issue-758-link-repeat --- #let url = "https://typst.org/" diff --git a/tests/suite/model/list.typ b/tests/suite/model/list.typ index 9bed930bbf..cadb1e7d5e 100644 --- a/tests/suite/model/list.typ +++ b/tests/suite/model/list.typ @@ -28,7 +28,11 @@ _Shopping list_ - Top-level indent - is fine. +<<<<<<< HEAD --- list-indent-specifics --- +======= +--- list-indent-specifics render pdftags --- +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 - A - B - C @@ -304,3 +308,14 @@ World - C - = D E +<<<<<<< HEAD +======= + +--- issue-6242-tight-list-attach-spacing --- +// Nested tight lists should be uniformly spaced when list spacing is set. +#set list(spacing: 1.2em) +- A + - B + - C +- C +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 diff --git a/tests/suite/model/numbering.typ b/tests/suite/model/numbering.typ index 6af989ff1d..37419fa778 100644 --- a/tests/suite/model/numbering.typ +++ b/tests/suite/model/numbering.typ @@ -19,6 +19,7 @@ // Greek. #t( pat: "α", +<<<<<<< HEAD "𐆊", "αʹ", "βʹ", "γʹ", "δʹ", "εʹ", "ϛʹ", "ζʹ", "ηʹ", "θʹ", "ιʹ", "ιαʹ", "ιβʹ", "ιγʹ", "ιδʹ", "ιεʹ", "ιϛʹ", "ιζʹ", "ιηʹ", "ιθʹ", "κʹ", 241, "σμαʹ", @@ -56,13 +57,38 @@ "𐆊", "Αʹ", "Βʹ", "Γʹ", "Δʹ", "Εʹ", "Ϛʹ", "Ζʹ", "Ηʹ", "Θʹ", "Ιʹ", "ΙΑʹ", "ΙΒʹ", "ΙΓʹ", "ΙΔʹ", "ΙΕʹ", "ΙϚʹ", "ΙΖʹ", "ΙΗʹ", "ΙΘʹ", "Κʹ", 241, "ΣΜΑʹ", +======= + "𐆊", "α", "β", "γ", "δ", "ε", "ϛ", "ζ", "η", "θ", "ι", + "ια", "ιβ", "ιγ", "ιδ", "ιε", "ιϛ", "ιζ", "ιη", "ιθ", "κ", + 241, "σμα", + 999, "ϡϟθ", + 1005, "͵αε", + 1999, "͵αϡϟθ", + 2999, "͵βϡϟθ", + 3000, "͵γ", + 3398, "͵γτϟη", + 4444, "͵δυμδ", + 5683, "͵εχπγ", + 9184, "͵θρπδ", + 9999, "͵θϡϟθ", +) +#t( + pat: sym.Alpha, + "𐆊", "Α", "Β", "Γ", "Δ", "Ε", "Ϛ", "Ζ", "Η", "Θ", "Ι", + "ΙΑ", "ΙΒ", "ΙΓ", "ΙΔ", "ΙΕ", "ΙϚ", "ΙΖ", "ΙΗ", "ΙΘ", "Κ", + 241, "ΣΜΑ", +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 ) // Symbols. #t(pat: "*", "-", "*", "†", "‡", "§", "¶", "‖", "**") // Hebrew. +<<<<<<< HEAD #t(pat: "א", step: 2, 9, "ט׳", "י״א", "י״ג") +======= +#t(pat: "א", step: 2, 9, "ט", "יא", "יג", 15, "טו", 16, "טז") +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 // Chinese. #t(pat: "一", step: 2, 9, "九", "十一", "十三", "十五", "十七", "十九") diff --git a/tests/suite/model/outline.typ b/tests/suite/model/outline.typ index 49fd7d7cb4..6afd74cdcd 100644 --- a/tests/suite/model/outline.typ +++ b/tests/suite/model/outline.typ @@ -1,4 +1,8 @@ +<<<<<<< HEAD --- outline-spacing --- +======= +--- outline-spacing render pdftags --- +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 #set heading(numbering: "1.a.") #set outline.entry(fill: none) #show outline.entry.where(level: 1): set block(above: 1.2em) @@ -252,6 +256,34 @@ A = B = C +<<<<<<< HEAD +======= +--- outline-html html --- +#set heading(numbering: "1.1.") + +#outline() + += A += B += C += D +== E +== F +#heading(outlined: false, [G]) +=== H // Should not be nested under F +===== I +#heading(level: 4, bookmarked: false)[J] // `bookmarked` has no effect += K + +--- outline-figure-html html --- +#outline(target: figure, title: [List of Figures]) +#figure([A], caption: [The A]) +#set text(lang: "fr") +#figure([B], caption: [Le B]) +#set text(lang: "de") +#figure([C], caption: figure.caption(separator: " ~ ")[Das C]) + +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 --- issue-2048-outline-multiline --- // Without the word joiner between the dots and the page number, // the page number would be alone in its line. diff --git a/tests/suite/model/par.typ b/tests/suite/model/par.typ index d2c3416e09..fcab849a22 100644 --- a/tests/suite/model/par.typ +++ b/tests/suite/model/par.typ @@ -1,6 +1,10 @@ // Test configuring paragraph properties. +<<<<<<< HEAD --- par-basic --- +======= +--- par-basic render pdftags --- +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 #set page(width: 250pt, height: 120pt) But, soft! what light through yonder window breaks? It is the east, and Juliet @@ -194,7 +198,11 @@ Even the first. + D +<<<<<<< HEAD --- par-first-line-indent-all-terms --- +======= +--- par-first-line-indent-all-terms render pdftags --- +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 #show terms.where(tight: false): set terms(spacing: 1.2em) #set terms(hanging-indent: 10pt) #set par( @@ -231,7 +239,11 @@ Welcome \ here. Does this work well? --- par-hanging-indent-rtl --- #set par(hanging-indent: 2em) +<<<<<<< HEAD #set text(dir: rtl) +======= +#set text(dir: rtl, font: ("Libertinus Serif", "Noto Sans Arabic")) +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 لآن وقد أظلم الليل وبدأت النجوم تنضخ وجه الطبيعة التي أعْيَتْ من طول ما انبعثت في النهار diff --git a/tests/suite/model/quote.typ b/tests/suite/model/quote.typ index 51c4bba59b..09a4aa3f38 100644 --- a/tests/suite/model/quote.typ +++ b/tests/suite/model/quote.typ @@ -1,14 +1,26 @@ // Test the quote element. +<<<<<<< HEAD --- quote-dir-author-pos --- // Text direction affects author positioning +======= +--- quote-dir-author-pos render pdftags --- +// Text direction affects author positioning +#set text(font: ("Libertinus Serif", "Noto Sans Arabic")) +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 And I quote: #quote(attribution: [René Descartes])[cogito, ergo sum]. #set text(lang: "ar") #quote(attribution: [عالم])[مرحبًا] +<<<<<<< HEAD --- quote-dir-align --- // Text direction affects block alignment +======= +--- quote-dir-align render pdftags --- +// Text direction affects block alignment +#set text(font: ("Libertinus Serif", "Noto Sans Arabic")) +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 #set quote(block: true) #quote(attribution: [René Descartes])[cogito, ergo sum] @@ -48,7 +60,11 @@ And I quote: #quote(attribution: [René Descartes])[cogito, ergo sum]. #quote(attribution: )[In a hole in the ground there lived a hobbit.] #show bibliography: none +<<<<<<< HEAD #bibliography("/assets/bib/works.bib", style: "chicago-notes") +======= +#bibliography("/assets/bib/works.bib", style: "chicago-shortened-notes") +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 --- quote-cite-format-author-date --- // Citation-format: author-date or author @@ -118,3 +134,9 @@ An inline #quote[quote.] #quote(block: true, attribution: [The Test Author])[ A block-level quote. ] +<<<<<<< HEAD +======= + +--- issue-5536-quote-inline-quotes-false --- +Lorem #quote(block: false, quotes: false)[dolor]. +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 diff --git a/tests/suite/model/ref.typ b/tests/suite/model/ref.typ index 2f8e2fa251..ebdf21f142 100644 --- a/tests/suite/model/ref.typ +++ b/tests/suite/model/ref.typ @@ -1,6 +1,10 @@ // Test references. +<<<<<<< HEAD --- ref-basic --- +======= +--- ref-basic render html --- +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 #set heading(numbering: "1.") = Introduction @@ -51,7 +55,12 @@ $ A = 1 $ // Test ambiguous reference. = Introduction +<<<<<<< HEAD // Error: 1-7 label occurs in the document and its bibliography +======= +// Error: 1-7 label `` occurs both in the document and its bibliography +// Hint: 1-7 change either the heading's label or the bibliography key to resolve the ambiguity +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 @arrgh #bibliography("/assets/bib/works.bib") @@ -85,3 +94,17 @@ Text seen on #ref(, form: "page", supplement: "Page"). // Test reference with non-whitespace before it. #figure[] <1> #test([(#ref(<1>))], [(@1)]) +<<<<<<< HEAD +======= + +--- ref-to-empty-label-not-possible --- +// @ without any following label should just produce the symbol in the output +// and not produce a reference to a label with an empty name. +@ + +--- ref-function-empty-label --- +// using ref() should also not be possible +// Error: 6-7 unexpected less-than operator +// Error: 7-8 unexpected greater-than operator +#ref(<>) +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 diff --git a/tests/suite/model/terms.typ b/tests/suite/model/terms.typ index 103a8033ee..272740c8fc 100644 --- a/tests/suite/model/terms.typ +++ b/tests/suite/model/terms.typ @@ -1,6 +1,10 @@ // Test term list. +<<<<<<< HEAD --- terms-constructor --- +======= +--- terms-constructor render pdftags --- +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 // Test with constructor. #terms( ([One], [First]), diff --git a/tests/suite/model/title.typ b/tests/suite/model/title.typ new file mode 100644 index 0000000000..9f610539fc --- /dev/null +++ b/tests/suite/model/title.typ @@ -0,0 +1,24 @@ +// Test title element. + +--- title render html pdftags --- +#set document(title: "My title") +#title() += A level one heading + +--- title-with-body render html --- +#set document(title: "My title") +#title[My display title] + +--- title-with-body-auto render --- +#set document(title: "My title") +#title(auto) + +--- title-show-set --- +#show title: set text(blue) +#title[A blue title] + +--- title-unset --- +// Error: 2-9 document title was not set +// Hint: 2-9 set the title with `set document(title: [...])` +// Hint: 2-9 or provide an explicit body with `title[..]` +#title() diff --git a/tests/suite/pdf/attach.typ b/tests/suite/pdf/attach.typ new file mode 100644 index 0000000000..99d3e58697 --- /dev/null +++ b/tests/suite/pdf/attach.typ @@ -0,0 +1,39 @@ +// Test file attachments. The tests here so far are unsatisfactory because we +// have no PDF testing infrastructure. That should be improved in the future. + +--- pdf-attach --- +#pdf.attach("/assets/text/hello.txt") +#pdf.attach( + "/assets/data/details.toml", + relationship: "supplement", + mime-type: "application/toml", + description: "Information about a secret project", +) + +--- pdf-attach-bytes --- +#pdf.attach("hello.txt", read("/assets/text/hello.txt", encoding: none)) +#pdf.attach( + "a_file_name.txt", + read("/assets/text/hello.txt", encoding: none), + relationship: "supplement", + mime-type: "text/plain", + description: "A description", +) + +--- pdf-attach-invalid-relationship --- +#pdf.attach( + "/assets/text/hello.txt", + // Error: 17-23 expected "source", "data", "alternative", "supplement", or none + relationship: "test", + mime-type: "text/plain", + description: "A test file", +) + +--- pdf-attach-invalid-data --- +// Error: 39-46 expected bytes, found string +#pdf.attach("/assets/text/hello.txt", "hello") + +--- pdf-embed-deprecated --- +// Warning: 6-11 the name `embed` is deprecated, use `attach` instead +// Hint: 6-11 it will be removed in Typst 0.15.0 +#pdf.embed("/assets/text/hello.txt") diff --git a/tests/suite/pdftags/break.typ b/tests/suite/pdftags/break.typ new file mode 100644 index 0000000000..37eb582ced --- /dev/null +++ b/tests/suite/pdftags/break.typ @@ -0,0 +1,26 @@ +--- break-tags-nested-parbreak pdftags nopdfua --- +#let target = "tel:123" + +Start of the first paragraph #link(target)[ + #quote[ + Part of the first paragraph. + + Start of the second paragraph + ] +] Part of the second paragraph. + +--- break-tags-nested-parbreak-with-nested-groups pdftags nopdfua --- +#let target = "tel:123" + +Start of the first paragraph #link(target)[ + `group before` + #quote[ + `group before` + Part of the first paragraph. + + Start of the second paragraph + ] +] Part of the second paragraph. + +--- break-tags-issue-7020 pdftags nopdfua --- +Foo #quote($$ + parbreak()) diff --git a/tests/suite/pdftags/deco.typ b/tests/suite/pdftags/deco.typ new file mode 100644 index 0000000000..a429a445aa --- /dev/null +++ b/tests/suite/pdftags/deco.typ @@ -0,0 +1,61 @@ +--- deco-tags-underline pdftags --- +#show: underline.with(stroke: red) + +// The content in this paragraph is grouped into one span tag with the +// corresponding text attributes. +red underlined text +red underlined text + +red underlined text + +--- deco-tags-different-color pdftags --- +#show: underline.with(stroke: red) +red underlined text +#show: underline.with(stroke: blue) +blue underlined text + +--- deco-tags-different-stroke-thickness pdftags --- +#show: underline.with(stroke: 2pt) +thick underlined +#show: underline.with(stroke: 1pt) +thin underlined + +--- deco-tags-different-type pdftags --- +#underline[underlined]\ +#overline[overlined]\ +#strike[striked]\ + +--- deco-tags-multiple-styles pdftags --- +#show: underline +// Error: 2-16 PDF/UA-1 error: cannot combine underline, overline, or strike +#show: overline +text with a bunch of lines + +--- deco-tags-highlight-basic pdftags --- +A #highlight[highlighted] alksjdflk asdjlkfj alskdj word. + +--- deco-tags-subscript-basic pdftags --- +CO#sub[2] emissions. +A2#sub[hex] + +--- deco-tags-superscript-basic pdftags --- +CI#super[-] has a negative charge. + +--- deco-tags-script-custom-baseline pdftags --- +// NOTE: the baseline shift values attribute is inverted. +#set sub(baseline: 2.5pt) +#set super(baseline: -9.5pt) +#sub[sub] +#super[super] + +--- deco-tags-emph-basic pdftags --- +Cats are _cute_ animals. + +--- deco-tags-strong-basic pdftags --- +This *HERE* is important! + +--- deco-tags-strong-and-em pdftags --- +_*strong and emph*_ + +--- deco-tags-strong-em-and-more-attrs pdftags --- +#underline(stroke: green)[_*strong and emph*_] diff --git a/tests/suite/pdftags/disable.typ b/tests/suite/pdftags/disable.typ new file mode 100644 index 0000000000..1c6a5b3933 --- /dev/null +++ b/tests/suite/pdftags/disable.typ @@ -0,0 +1,60 @@ +--- disable-tags-artifact pdftags --- += Heading 1 +#pdf.artifact[ + #table( + columns: 2, + [a], [b], + [c], [d], + ) +] + += Heading 2 + +--- disable-tags-tiling pdftags --- += Rectangle + +#let pat = tiling(size: (20pt, 20pt))[ + - a + - b + - c +] +#rect(fill: pat) + +--- disable-tags-hide pdftags --- += Hidden + +#hide[ + - a + - b + - c +] + +--- disable-tags-partially-hidden-list pdftags --- +// FIXME(accessibility): In realization, tags inside of list groupings aren't +// handled. Thus if the head of the list is visible, all tags of list items +// will be emitted before (outside) the hide element. And if the head is not +// visible, all tags of list items will be emitted inside the hide element. += Tail hidden +- a +#hide[ +- b + - c +] + += Head hidden +#hide[ +- a +] +- b + - c + +--- disable-tags-broken-paragraph-hide pdftags --- +This is the #hide[ first paragraph. + +And this is the ] second paragraph. + +--- disable-tags-broken-paragraph-artifact pdftags --- +This is the #pdf.artifact[ first paragraph. + +And this is the ] second paragraph. + diff --git a/tests/suite/pdftags/figure.typ b/tests/suite/pdftags/figure.typ new file mode 100644 index 0000000000..595b736f03 --- /dev/null +++ b/tests/suite/pdftags/figure.typ @@ -0,0 +1,106 @@ +--- figure-tags-image-basic pdftags --- +// The image is automatically wrapped in a figure tag. +#image(alt: "A tiger", "/assets/images/tiger.jpg") + +--- figure-tags-image-figure-with-caption pdftags --- +#figure( + // The image doesn't create a duplicate figure tag + // and the alt description is used in the outer figure. + image(alt: "A tiger", "/assets/images/tiger.jpg"), + // The caption is stored outside of the figure tag + // grouped in a nonstruct. + caption: [Some caption] +) + +--- figure-tags-inline-equation-with-caption pdftags --- +#figure( + math.equation( + alt: "The Pythagorean theorem: a squared plus b squared is c squared", + $a^2 + b^2 = c^2$, + ), + caption: [Some caption] +) + +--- figure-tags-block-equation-with-caption pdftags --- +#figure( + // The alt description is used in the outer figure. + math.equation( + block: true, + alt: "The Pythagorean theorem: a squared plus b squared is c squared", + $ + a^2 + b^2 = c^2 + $, + ), + caption: [Some caption] +) + +--- figure-tags-with-alt-flatten-content-basic pdftags --- +// The inner tags are flattened +#figure(alt: "alt text")[ + $a^2 + b^2 = c^2$ + + $sum_(i=1)^n(i)$ +] + +--- figure-tags-with-alt-flatten-content-complex pdftags --- +#figure(alt: "alt text")[ + #table( + columns: 2, + // The link tag needs to be retained + link("https://github.com/typst/typst")[ + #image("/assets/images/tiger.jpg") + ], + image("/assets/images/tiger.jpg"), + [Some more text], + ) +] + +--- figure-tags-alt-with-different-lang pdftags --- +#set text(lang: "de") +Ein Paragraph. + +#set text(lang: "en", region: "uk") +#figure(image(alt: "A tiger", "/assets/images/tiger.jpg")) + +--- figure-tags-listing pdftags --- +#figure[ + ```rs + fn main() { + println!("Hello Typst!"); + } + ``` +] + +--- figure-tags-only-marked-content-missing-alt pdftags --- +// Error: 2-3:2 PDF/UA-1 error: missing alt text +// Hint: 2-3:2 make sure your images and equations have alt text +#figure[ + #rect(fill: red) +] + +--- figure-tags-only-marked-content pdftags nopdfua --- +#figure[ + #rect(fill: red) +] + +--- figure-tags-additional-caption-inside-body pdftags nopdfua --- +#figure(caption: [The real caption])[ + #image(alt: "A tiger", "/assets/images/tiger.jpg"), + #figure.caption[Additional caption] +] + +--- figure-tags-additional-caption-inside-table pdftags --- +// Error: 19-35 PDF/UA-1 error: invalid table (Table) structure +// Hint: 19-35 table (Table) may not contain multiple caption (Caption) tags +// Hint: 19-35 avoid manually calling `figure.caption` +#figure(caption: [The real caption])[ + #table( + columns: 2, + [A], [B], + [C], [D], + ) +// Error: 4-38 PDF/UA-1 error: invalid table (Table) structure +// Hint: 4-38 table (Table) may not contain multiple caption (Caption) tags +// Hint: 4-38 avoid manually calling `figure.caption` + #figure.caption[Additional caption] +] diff --git a/tests/suite/pdftags/footnote.typ b/tests/suite/pdftags/footnote.typ new file mode 100644 index 0000000000..f4a55147c5 --- /dev/null +++ b/tests/suite/pdftags/footnote.typ @@ -0,0 +1,12 @@ +--- footnote-tags-basic pdftags --- +Footnote #footnote[Hi] in text. + +--- footnote-tags-different-lang pdftags --- +Footnote #footnote[ + // The footnote number is still in english + #set text(lang: "de") + Hallo +] in text. + +--- footnote-tags-ref-to-other-footnote pdftags --- +This #footnote[content] and #footnote(). diff --git a/tests/suite/pdftags/grid.typ b/tests/suite/pdftags/grid.typ new file mode 100644 index 0000000000..8906ca901c --- /dev/null +++ b/tests/suite/pdftags/grid.typ @@ -0,0 +1,48 @@ +--- grid-tags-rowspan pdftags --- +#grid( + columns: 4, + stroke: 1pt, + rows: 3, + // the code cell should come first in the reading order + grid.cell(rowspan: 3)[`code`], [b], [c], [d], + // the underline cell should come second to last + [b], grid.cell(x: 2, y: 1, colspan: 2, rowspan: 2, underline[text]), + [b], +) + +--- grid-tags-cell-breaking pdftags --- +// The second paragraph contains marked content from page 1 and 2 +#set page(width: 5cm, height: 3cm) +#grid( + columns: 2, + row-gutter: 8pt, + [Lorem ipsum dolor sit amet. + + Aenean commodo ligula eget dolor. Aenean massa. Penatibus et magnis.], + [Text that is rather short], + [Fireflies], + [Critical], + [Decorum], + [Rampage], +) + +--- grid-tags-rowspan-split-3 pdftags --- +#set page(height: 5em) +#grid( + columns: 2, + fill: red, + inset: 0pt, + grid.cell(fill: orange, rowspan: 10, place(bottom)[*Z*] + [x\ ] * 10 + place(bottom)[*ZZ*]), + ..([y],) * 10, + [a], [b], +) + +--- grid-tags-internal-grid-layout-breaking-bibliography pdftags --- +#set page(height: 140pt) + +#cite(label("DBLP:books/lib/Knuth86a")) + +#bibliography( + "/assets/bib/works.bib", + style: "ieee", +) diff --git a/tests/suite/pdftags/heading.typ b/tests/suite/pdftags/heading.typ new file mode 100644 index 0000000000..6057916a58 --- /dev/null +++ b/tests/suite/pdftags/heading.typ @@ -0,0 +1,39 @@ +--- heading-tags-basic pdftags --- += Level 1 +== Level 2 +=== Level 3 + +--- heading-tags-first-is-not-level-1 pdftags --- +// Error: 1-11 PDF/UA-1 error: the first heading must be of level 1 +== Level 2 + +--- heading-tags-non-consecutive-levels pdftags --- +// Error: 2:1-2:12 PDF/UA-1 error: skipped from heading level 1 to 3 +// Hint: 2:1-2:12 heading levels must be consecutive += Level 1 +=== Level 3 + +--- heading-tags-complex pdftags --- += Level 1 +== Level 2 +=== Level 3 +=== Level 3 +== Level 2 +=== Level 3 +==== Level 4 +== Level 2 +=== Level 3 +=== Level 3 +=== Level 3 += Level 1 +== Level 2 + +--- heading-tags-empty pdftags --- +// Error: 1-2 PDF/UA-1 error: heading title is empty += + +--- heading-tags-context-body pdftags --- +// Error: 2-32 PDF/UA-1 error: heading title could not be determined +// Hint: 2-32 this seems to be caused by a context expression within the heading +// Hint: 2-32 consider wrapping the entire heading in a context expression instead +#heading(context [Hello there]) diff --git a/tests/suite/pdftags/lang.typ b/tests/suite/pdftags/lang.typ new file mode 100644 index 0000000000..6c49da2bbb --- /dev/null +++ b/tests/suite/pdftags/lang.typ @@ -0,0 +1,20 @@ +--- lang-tags-pars-basic pdftags --- +#set text(lang: "uk") +Par 1. + +#set text(lang: "sr") +Par 2. + +#set text(lang: "be") +Par 3. + +--- lang-tags-propagation pdftags --- +#set text(lang: "nl") +A paragraph. + +// The list bullets are in spanish :) +#set text(lang: "es", region: "co") +- #text(lang: "de", region: none, "a") + - #text(lang: "de", region: "at", "b") + - #text(lang: "de", region: none, "c") +- #text(lang: "de", region: none, "d") diff --git a/tests/suite/pdftags/layout.typ b/tests/suite/pdftags/layout.typ new file mode 100644 index 0000000000..4994398879 --- /dev/null +++ b/tests/suite/pdftags/layout.typ @@ -0,0 +1,24 @@ +--- layout-tags-placement-float pdftags --- +#set text(lang: "de") +#grid( + columns: 2, + [ + #set text(lang: "be") + text + #place(float: true, top + left)[ + `a` + ] + ], + [ + text + #place(float: true, top + left)[ + #set text(lang: "fr") + text in grid + ] + text + ], + [ + #set text(lang: "es") + b + ] +) diff --git a/tests/suite/pdftags/link.typ b/tests/suite/pdftags/link.typ new file mode 100644 index 0000000000..5c50903d65 --- /dev/null +++ b/tests/suite/pdftags/link.typ @@ -0,0 +1,57 @@ +--- link-tags-heading-without-numbering pdftags --- += Heading + +#link()[link to heading] + +--- link-tags-heading-with-numbering pdftags --- +#set heading(numbering: "1.") += Heading + +#link()[link to heading] + +--- link-tags-non-refable-location pdftags --- +A random location + +#link()[link to somewhere] + +--- link-tags-contact-prefix pdftags --- +#link("mailto:hello@typst.app") + +#link("tel:123") + +--- link-tags-position pdftags --- +#context link(here().position())[somewhere] + +--- link-tags-link-in-artifact pdftags --- +// Error: 2:4-2:42 PDF/UA-1 error: PDF artifacts may not contain links +// Hint: 2:4-2:42 references, citations, and footnotes are also considered links in PDF +#pdf.artifact[ + #link("https://github.com/typst/typst") +] + +--- link-tags-reference-in-artifact pdftags --- +// Error: 4:3-4:11 PDF/UA-1 error: PDF artifacts may not contain links +// Hint: 4:3-4:11 references, citations, and footnotes are also considered links in PDF +#set heading(numbering: "1.") += Heading +#pdf.artifact[ + @heading +] + +--- link-tags-citation-in-artifact pdftags --- +// Error: 2:3-2:10 PDF/UA-1 error: PDF artifacts may not contain links +// Hint: 2:3-2:10 references, citations, and footnotes are also considered links in PDF +#pdf.artifact[ + @netwok +] +#show bibliography: none +#bibliography("/assets/bib/works.bib") + +--- link-tags-with-parbreak-error pdftags --- +// Error: 7-69 PDF/UA-1 error: invalid document structure, this element's PDF tag would be split up +// Hint: 7-69 this is probably caused by paragraph grouping +// Hint: 7-69 maybe you've used a `parbreak`, `colbreak`, or `pagebreak` +Look #link("https://github.com/typst/typst")[this #parbreak() thing]. + +--- link-tags-with-parbreak pdftags nopdfua --- +Look #link("https://github.com/typst/typst")[this #parbreak() thing]. diff --git a/tests/suite/pdftags/list.typ b/tests/suite/pdftags/list.typ new file mode 100644 index 0000000000..9b10812fd8 --- /dev/null +++ b/tests/suite/pdftags/list.typ @@ -0,0 +1,86 @@ +--- list-tags-basic pdftags --- +- a + - 1 +- b + - c + - d + - e +- f + +--- list-tags-mixed-with-enum pdftags --- +- a + + 1 +- b + + c + - d + + e +- f + +--- list-tags-wide-with-nested-list pdftags --- +- a + + - 1 + +- b + + - c + + - d + + - e + +- f + +--- list-tags-complex-item-with-sub-list pdftags --- +- #[#quote(block: true)[hi] #footnote[1].] + - a + - b +- c +- d + +--- list-tags-complex-item-with-nested-list pdftags --- +- #[ + #quote(block: true)[hi] + #footnote[1]. + - a + - b + ] +- c +- d + +--- list-tags-terms-basic pdftags --- +/ A: 1 +/ B: 2 +/ C: 3 + +--- list-tags-terms-basic-wide pdftags --- +/ A: 1 + +/ B: 2 + +/ C: 3 + +--- list-tags-terms-indented pdftags --- +/ A: 1 +/ B: 2 + / B1: wow + / B2: amazing + +--- list-tags-terms-body-with-parbreak pdftags --- +/ A: 1 #parbreak() 232 +/ B: 2 + +--- list-tags-terms-label-with-parbreak-error pdftags --- +// Error: 1-21 PDF/UA-1 error: invalid document structure, this element's PDF tag would be split up +// Hint: 1-21 this is probably caused by paragraph grouping +// Hint: 1-21 maybe you've used a `parbreak`, `colbreak`, or `pagebreak` +// TODO: This should have the span of the term label, not the entire term item +/ A #parbreak() A: 1 +/ B: 2 + +--- list-tags-terms-label-with-parbreak pdftags nopdfua --- +// This currently produces an empty paragraph, because terms label is moved out +// of the broken paragraph when constructing the PDF list structure. This only +// happens when tags are broken up, so it's not *that* bad. +/ A #parbreak() A: 1 +/ B: 2 diff --git a/tests/suite/pdftags/logical-children.typ b/tests/suite/pdftags/logical-children.typ new file mode 100644 index 0000000000..cfb55c585f --- /dev/null +++ b/tests/suite/pdftags/logical-children.typ @@ -0,0 +1,73 @@ +--- logical-children-tags-place-within-artifact pdftags --- +// Error: 2:4-4:4 PDF/UA-1 error: PDF artifacts may not contain links +// Hint: 2:4-4:4 references, citations, and footnotes are also considered links in PDF +#pdf.artifact[ + #link("tel:123")[ + #place(float: true, top + left, rect(fill: red)) + ] +] + +--- logical-children-tags-link-within-place-within-artifact pdftags --- +// Error: 3:6-5:6 PDF/UA-1 error: PDF artifacts may not contain links +// Hint: 3:6-5:6 references, citations, and footnotes are also considered links in PDF +#pdf.artifact[ + #place(float: true, top + left)[ + #link("tel:123")[ + #rect(fill: red) + ] + ] +] + +--- logical-children-tags-footnote-in-tiling pdftags --- +// Error: PDF/UA-1 error: PDF artifacts may not contain links +// Hint: a link was used within a tiling +// Hint: references, citations, and footnotes are also considered links in PDF +#rect(width: 90pt, height: 90pt, fill: tiling(size: (30pt, 30pt))[ + #footnote[hi] +]) + +--- logical-children-tags-place-in-tiling pdftags --- +#rect(width: 90pt, height: 90pt, fill: tiling(size: (30pt, 30pt))[ + #place(float: true, top + right)[hi] +]) + +--- logical-children-tags-decorations-in-broken-grid-cell pdftags --- +#set page(height: 50pt) +#grid( + columns: 2, + underline[ + #lorem(10) + ], + overline[ + #lorem(10) + ], +) + +--- logical-children-tags-hide-around-footnote pdftags --- +#hide[ + Some text #footnote[explanation]. +] + +Some other text. + +--- logical-children-tags-hide-around-place pdftags --- +#hide[ + Some text #place(float: true, bottom + right)[explanation]. +] + +Some other text. + + +--- logical-children-tags-underline-around-footnote pdftags --- +#underline[ + Some text #footnote[explanation]. +] + +Some other text. + +--- logical-children-tags-underline-around-place render pdftags --- +#underline[ + Some text #place(float: true, bottom + right)[explanation]. +] + +Some other text. diff --git a/tests/suite/pdftags/query.typ b/tests/suite/pdftags/query.typ new file mode 100644 index 0000000000..d4ca292b02 --- /dev/null +++ b/tests/suite/pdftags/query.typ @@ -0,0 +1,25 @@ +--- query-tags-duplicate-heading pdftags --- +// This will display the heading with the same location a second time +#context query(heading).join() += Hi + +--- query-tags-duplicate-labelled-element pdftags --- +#figure(alt: "Text saying: hello there")[ + hello there +]
+ +#context query(
).at(0) + +--- query-tags-ambiguous-parent-place pdftags --- +// Error: 2-43 PDF/UA-1 error: ambiguous logical parent +// Hint: 2-43 please report this as a bug +#place(float: true, top + left)[something] + +#context query().join() + +--- query-tags-ambiguous-parent-footnote pdftags --- +// Error: 1:2-1:21 PDF/UA-1 error: ambiguous logical parent +// Hint: 1:2-1:21 please report this as a bug +#footnote[something] + +#context query().join() diff --git a/tests/suite/pdftags/raw.typ b/tests/suite/pdftags/raw.typ new file mode 100644 index 0000000000..1563234f4d --- /dev/null +++ b/tests/suite/pdftags/raw.typ @@ -0,0 +1,11 @@ +--- raw-tags-basic-block pdftags --- +```rs +const PDF_STANDARD: &str = "PDF/UA-1"; + +fn main() { + println!("hello {PDF_STANDARD}"); +} +``` + +--- raw-tags-basic-inline pdftags --- +Some `inline raw` text and the rust ```rs fn``` keyword. diff --git a/tests/suite/pdftags/table.typ b/tests/suite/pdftags/table.typ new file mode 100644 index 0000000000..3195f97aca --- /dev/null +++ b/tests/suite/pdftags/table.typ @@ -0,0 +1,132 @@ +--- table-tags-basic pdftags --- +#table( + columns: 3, + table.header([H1], [H2], [H3]), + [a1], [a2], [a3], + [b1], [b2], [b3], +) + +--- table-tags-column-and-row-header pdftags --- +#table( + columns: 3, + table.header([H1], [H2], [H3]), + pdf.header-cell(scope: "row")[10:00], [a2], [a3], + pdf.header-cell(scope: "row")[12:30], [b2], [b3], +) + +--- table-tags-missing-cells pdftags --- +#table( + columns: 3, + table.header(level: 1, [H1], [H1], [H1]), + table.header(level: 2, [H2], [H2], [H2]), + + // the middle cell is missing + table.cell(x: 0)[], + table.cell(x: 2)[], + + // the last cell is missing, its type should be inferred from the row + table.header(level: 2, [H2], [H2]), + + // last cell is missing + [], [], + + table.footer( + table.cell(x: 1)[F], + table.cell(x: 2)[F], + ), +) + +--- table-tags-explicit-lines pdftags --- +#table( + columns: 2, + [a], table.vline(stroke: green), [b], + table.hline(stroke: red), + [c], [d], + table.hline(stroke: blue), +) + +--- table-tags-unset-bottom-line pdftags --- +#table( + columns: 2, + [a], [b], + [c], [d], + table.hline(stroke: none), +) + +--- table-tags-different-default-border pdftags --- +#table( + columns: 2, + stroke: red + 2pt, + table.hline(stroke: black), + [a], [b], + [c], [d], + [e], [f], + table.hline(stroke: black), +) + +--- table-tags-show-rule-error pdftags --- +// Error: 2:2-2:30 PDF/UA-1 error: invalid table (Table) structure +// Hint: 2:2-2:30 table (Table) may not contain raw text (Code) +// Hint: 2:2-2:30 this is probably caused by a show rule +#set table(columns: (10pt, auto)) +#show table: it => it.columns +#table[A][B][C][D] + +--- table-tags-show-rule pdftags nopdfua --- +#set table(columns: (10pt, auto)) +#show table: it => it.columns +#table[A][B][C][D] + +--- table-tags-rowspan-split-1 pdftags --- +#set page(height: 6em) +#table( + rows: (4em, auto, 4em), + columns: 2, + table.cell(rowspan: 3, [a\ ] * 4), + [b], [c], [d], +) + +--- table-tags-rowspan-split-2 pdftags --- +#set page(height: 6em) +#table( + rows: (4em, auto, 4em), + columns: 3, + [a1], table.cell(rowspan: 3, [b\ ] * 5), [c1], + [a2], [c2], + [a3], [c3], +) + +--- table-tags-citation-in-repeated-header pdftags --- +// Error: 3:16-3:23 PDF/UA-1 error: PDF artifacts may not contain links +// Hint: 3:16-3:23 references, citations, and footnotes are also considered links in PDF +#set page(height: 60pt) +#table( + table.header[@netwok], + [A], + [A], +) + +#show bibliography: none +#bibliography("/assets/bib/works.bib") + +--- table-tags-private-table-summary pdftags --- +// Error: 2:3-2:18 unexpected argument: summary +#table( + summary: "nope", + [A], +) + +--- table-tags-private-cell-kind pdftags --- +// Error: 13-25 unexpected argument: kind +#table.cell(kind: "nope")[A] + +--- table-tags-unstable-functions pdftags --- +#pdf.table-summary( + summary: "The table summary", + table( + columns: 2, + // Exclude the top-left cell from being a header cell. + table.header(pdf.data-cell[], [Column header]), + pdf.header-cell(scope: "row")[Row header], [thing] + ) +) diff --git a/tests/suite/scripting/import.typ b/tests/suite/scripting/import.typ index 49b66ee565..deffbe2935 100644 --- a/tests/suite/scripting/import.typ +++ b/tests/suite/scripting/import.typ @@ -334,6 +334,10 @@ --- import-cyclic-in-other-file --- // Cyclic import in other file. +<<<<<<< HEAD +======= +// Error: "tests/suite/scripting/modules/cycle2.typ" 2:9-2:21 cyclic import +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 #import "./modules/cycle1.typ": * This is never reached. @@ -428,7 +432,11 @@ This is never reached. --- import-from-package-required-compiler-version --- // Test too high required compiler version. +<<<<<<< HEAD // Error: 9-29 package requires typst 1.0.0 or newer (current version is VERSION) +======= +// Error: 9-29 package requires Typst 1.0.0 or newer (current version is VERSION) +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 #import "@test/future:0.1.0": future --- import-from-package-namespace-invalid-1 --- diff --git a/tests/suite/scripting/ops.typ b/tests/suite/scripting/ops.typ index d17c0117f6..6b9b671d37 100644 --- a/tests/suite/scripting/ops.typ +++ b/tests/suite/scripting/ops.typ @@ -264,6 +264,11 @@ #test("Hey" not in "abheyCd", true) #test("a" not /* fun comment? */ in "abc", false) +<<<<<<< HEAD +======= +#test("sys" in std, true) +#test("system" in std, false) +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 --- ops-not-trailing --- // Error: 10 expected keyword `in` diff --git a/tests/suite/scripting/recursion.typ b/tests/suite/scripting/recursion.typ index 6be96c1ecf..d011098c35 100644 --- a/tests/suite/scripting/recursion.typ +++ b/tests/suite/scripting/recursion.typ @@ -44,18 +44,33 @@ --- recursion-via-include-in-layout --- // Test cyclic imports during layout. // Error: 2-38 maximum show rule depth exceeded +<<<<<<< HEAD // Hint: 2-38 check whether the show rule matches its own output +======= +// Hint: 2-38 maybe a show rule matches its own output +// Hint: 2-38 maybe there are too deeply nested elements +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 #layout(_ => include "recursion.typ") --- recursion-show-math --- // Test recursive show rules. // Error: 22-25 maximum show rule depth exceeded +<<<<<<< HEAD // Hint: 22-25 check whether the show rule matches its own output +======= +// Hint: 22-25 maybe a show rule matches its own output +// Hint: 22-25 maybe there are too deeply nested elements +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 #show math.equation: $x$ $ x $ --- recursion-show-math-realize --- // Error: 22-33 maximum show rule depth exceeded +<<<<<<< HEAD // Hint: 22-33 check whether the show rule matches its own output +======= +// Hint: 22-33 maybe a show rule matches its own output +// Hint: 22-33 maybe there are too deeply nested elements +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 #show heading: it => heading[it] $ #heading[hi] $ diff --git a/tests/suite/styling/show.typ b/tests/suite/styling/show.typ index e8ddf55348..02002ad181 100644 --- a/tests/suite/styling/show.typ +++ b/tests/suite/styling/show.typ @@ -258,3 +258,14 @@ I am *strong*, I am _emphasized_, and I am #[special]. = Hello *strong* +<<<<<<< HEAD +======= + +--- issue-5690-oom-par-box --- +// Error: 3:6-5:1 maximum grouping depth exceeded +#show par: box + +Hello + +World +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 diff --git a/tests/suite/symbols/symbol.typ b/tests/suite/symbols/symbol.typ index 5bc2cafae0..7ecb3c36cc 100644 --- a/tests/suite/symbols/symbol.typ +++ b/tests/suite/symbols/symbol.typ @@ -21,6 +21,13 @@ ("lightning", "🖄"), ("fly", "🖅"), ) +<<<<<<< HEAD +======= +#let one = symbol( + "1", + ("emoji", "1️") +) +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 #envelope #envelope.stamped @@ -28,6 +35,11 @@ #envelope.stamped.pen #envelope.lightning #envelope.fly +<<<<<<< HEAD +======= +#one +#one.emoji +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 --- symbol-constructor-empty --- // Error: 2-10 expected at least one variant @@ -82,6 +94,29 @@ ("variant.duplicate", "y"), ) +<<<<<<< HEAD +======= +--- symbol-constructor-empty-variant-value --- +// Error: 2:3-2:5 invalid variant value: "" +// Hint: 2:3-2:5 variant value must be exactly one grapheme cluster +// Error: 3:3-3:16 invalid variant value: "" +// Hint: 3:3-3:16 variant value must be exactly one grapheme cluster +#symbol( + "", + ("empty", "") +) + +--- symbol-constructor-multi-cluster-variant-value --- +// Error: 2:3-2:7 invalid variant value: "aa" +// Hint: 2:3-2:7 variant value must be exactly one grapheme cluster +// Error: 3:3-3:14 invalid variant value: "bb" +// Hint: 3:3-3:14 variant value must be exactly one grapheme cluster +#symbol( + "aa", + ("b", "bb") +) + +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 --- symbol-unknown-modifier --- // Error: 13-20 unknown symbol modifier #emoji.face.garbage @@ -104,9 +139,17 @@ ("long", "⟹"), ("long.bar", "⟾"), ("not", "⇏"), +<<<<<<< HEAD + ("l", "⇔"), + ("l.long", "⟺"), + ("l.not", "⇎"), +======= + ("struck", "⤃"), ("l", "⇔"), ("l.long", "⟺"), ("l.not", "⇎"), + ("l.struck", "⤄"), +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 ) ```.text, ) @@ -152,6 +195,28 @@ // Warning: 5-9 `sect` is deprecated, use `inter` instead $ A sect B = A inter B $ +<<<<<<< HEAD +--- issue-5930-symbol-label --- +#emoji.face +#context test(query().first().text, "😀") +======= +--- symbol-modifier-deprecated --- +// Warning: 7-12 `ast.small` is deprecated (CJK compatibility character), use ﹡ or `\u{fe61}` instead +$ ast.small $ + +// Warning: 14-20 `bracket.double` is deprecated, use `bracket.stroked` instead +#sym.bracket.double.r + --- issue-5930-symbol-label --- #emoji.face #context test(query().first().text, "😀") + +--- presentation-selectors --- +// Currently, presentation selectors do not cause font fallback when the main +// font supports at least one presentation, instead causing a fallback of the +// presentation form. This should probably be solved at some point, making the +// emojis below render with an emoji form. +// See: https://github.com/typst/typst/pull/6875. +#sym.copyright #emoji.copyright \ +#sym.suit.heart #emoji.suit.heart +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 diff --git a/tests/suite/syntax/numbers.typ b/tests/suite/syntax/numbers.typ index 1f15ac720c..ca30d5ec4f 100644 --- a/tests/suite/syntax/numbers.typ +++ b/tests/suite/syntax/numbers.typ @@ -2,6 +2,10 @@ --- numbers --- // Test numbers in text mode. +<<<<<<< HEAD +======= +#set text(font: ("Libertinus Serif", "Noto Sans Arabic")) +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 12 \ 12.0 \ 3.14 \ diff --git a/tests/suite/text/case.typ b/tests/suite/text/case.typ index 964ff28b62..cc46389fd1 100644 --- a/tests/suite/text/case.typ +++ b/tests/suite/text/case.typ @@ -14,6 +14,13 @@ // Check that cases are applied to symbols nested in content #lower($H I !$.body) +<<<<<<< HEAD +======= +--- cases-content-html html --- +#lower[MY #html.strong[Lower] #symbol("A")] \ +#upper[my #html.strong[Upper] #symbol("a")] \ + +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 --- upper-bad-type --- // Error: 8-9 expected string or content, found integer #upper(1) diff --git a/tests/suite/text/deco.typ b/tests/suite/text/deco.typ index 07fdb6c192..b671b78dca 100644 --- a/tests/suite/text/deco.typ +++ b/tests/suite/text/deco.typ @@ -83,3 +83,14 @@ We can also specify a customized value #highlight(stroke: 2pt + blue)[abc] #highlight(stroke: (top: blue, left: red, bottom: green, right: orange))[abc] #highlight(stroke: 1pt, radius: 3pt)[#lorem(5)] +<<<<<<< HEAD +======= + +--- html-deco html --- +#strike[Struck] +#highlight[Highlighted] +#underline[Underlined] +#overline[Overlined] + +#(strike, highlight, underline, overline).fold([Mixed], (it, f) => f(it)) +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 diff --git a/tests/suite/text/font.typ b/tests/suite/text/font.typ index 60a1cd94df..d5f1f0f0d3 100644 --- a/tests/suite/text/font.typ +++ b/tests/suite/text/font.typ @@ -135,6 +135,37 @@ I The number 123. +<<<<<<< HEAD +======= +--- text-font-covers-repeat --- +// Repeatedly use the same font. +#set text(font: ( + (name: "Libertinus Serif", covers: regex("[0-9]")), + "Libertinus Serif" +)) + +The number 123. + +--- text-font-covers-riffle --- +// Repeatedly use two fonts alternately. +#set text(font: ( + (name: "Noto Color Emoji", covers: regex("[🔗⛓‍💥]")), + (name: "Twitter Color Emoji", covers: regex("[^🖥️]")), + "Noto Color Emoji", +)) + +🔗⛓‍💥🖥️🔑 + +// The above should be the same as: +#{ + text(font: "Noto Color Emoji", "🔗⛓‍💥🖥️") + text(font: "Twitter Color Emoji", "🔑") +} + +// but not: +#text(font: "Twitter Color Emoji", "🔗⛓‍💥🖥️🔑") + +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 --- text-font-covers-bad-1 --- // Error: 17-59 coverage regex may only use dot, letters, and character classes // Hint: 17-59 the regex is applied to each letter individually @@ -149,3 +180,15 @@ The number 123. #set text(-1pt) a +<<<<<<< HEAD +======= + +--- issue-5940-text-negative-size-panic --- +#set align(center) +#set text(-10pt) +Hello + +--- empty-text-font-array --- +// Error: 17-19 font fallback list must not be empty +#set text(font: ()) +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 diff --git a/tests/suite/text/lang.typ b/tests/suite/text/lang.typ index b4f87310c5..a15134a53e 100644 --- a/tests/suite/text/lang.typ +++ b/tests/suite/text/lang.typ @@ -1,16 +1,28 @@ // Test setting the document language. +<<<<<<< HEAD --- text-lang --- +======= +--- text-lang render pdftags --- +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 // without any region #set text(font: "Noto Serif CJK TC", lang: "zh") #outline() +<<<<<<< HEAD --- text-lang-unknown-region --- +======= +--- text-lang-unknown-region render pdftags --- +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 // with unknown region configured #set text(font: "Noto Serif CJK TC", lang: "zh", region: "XX") #outline() +<<<<<<< HEAD --- text-lang-region --- +======= +--- text-lang-region render pdftags --- +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 // with region configured #set text(font: "Noto Serif CJK TC", lang: "zh", region: "TW") #outline() diff --git a/tests/suite/text/raw.typ b/tests/suite/text/raw.typ index a7f58a8d09..e49a5dec6d 100644 --- a/tests/suite/text/raw.typ +++ b/tests/suite/text/raw.typ @@ -91,6 +91,25 @@ Year Month Day (* x (factorial (- x 1))))) ``` +<<<<<<< HEAD +======= +--- raw-syntaxes-invalid-sublime-syntax --- +// Prevent test parser from failing on "^---" line. +#let sublime-syntax = ```yaml +%YAML 1.2 +```.text + "\n---\n" + ```yaml +name: lang +file_extensions: + - a +scope: source +contexts: + main: + - match: '\' +```.text + +// Error: 35-56 failed to parse syntax (Error while compiling regex '/': Parsing error at position 0: Backslash without following character) +#raw("text", lang: "a", syntaxes: bytes(sublime-syntax)) +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 --- raw-theme --- // Test code highlighting with custom theme. @@ -225,6 +244,18 @@ emph(hello.my().world()) #hello.world() #box[] ``` +<<<<<<< HEAD +======= + +--- raw-highlight-typm-extra --- +// Math highlighting for strings, alignments, shorthands, and named args. +#set page(width: auto) +```typm +"string" - + * ::= & \ +|=> & [|define(x: #y, x::= y)|] +``` + +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 --- raw-highlight-rust --- #set page(width: auto) @@ -487,6 +518,21 @@ test assert.eq(block, c.input.block, message: "in point " + c.name + ", expect " + repr(block) + ", got " + repr(c.input.block) + "") } +<<<<<<< HEAD +======= +--- raw-html html --- +This is ```typ *inline*```. +```typ +#[ + #set text(blue) + *Hello* _world_! +] +``` + +--- raw-html-inline-spaces html --- +This has `double spaces inside`, which should be kept. + +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 --- raw-line --- #set page(width: 200pt) @@ -631,6 +677,23 @@ if true { } ``` +<<<<<<< HEAD +======= +--- issue-6961-tab-crlf-raw-indent --- +#let snippet = ( + ``` + A + BC + D + ``` +) + +#raw( + snippet.text.replace(" ", "\t").replace("\n", "\r\n"), + block: true, +) + +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 --- issue-4662-math-mode-language-for-raw --- // Test lang: "typm" syntax highlighting without enclosing dollar signs #raw("pi^2", lang: "typm") @@ -687,6 +750,14 @@ a b c -------------------- #let hi = "你好world" ``` +<<<<<<< HEAD +======= +--- issue-6559-equality-between-raws --- + +#test(`foo`, `foo`) +#assert.ne(`foo`, `bar`) + +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 --- raw-theme-set-to-auto --- ```typ #let hi = "Hello World" @@ -708,6 +779,41 @@ a b c -------------------- #let foo = "bar" ``` +<<<<<<< HEAD +======= +--- raw-default-json-theme --- +```json +{ + "foo": "bar", + "test": [ + "test", + true, + 42, + 5.0, + null + ], + "hi": { + "this": "is a test!", + "What is this?": "This is incredible text!" + } +} +``` + +--- raw-default-yaml-theme --- +```yaml +foo: bar +test: +- test +- true +- 42 +- 5 +- +hi: + this: is a test! + What is this?: This is incredible text! +``` + +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 --- raw-unclosed --- // Test unterminated raw text. // diff --git a/tests/suite/text/shift.typ b/tests/suite/text/shift.typ index 3b8d2ccbdd..3d900c3128 100644 --- a/tests/suite/text/shift.typ +++ b/tests/suite/text/shift.typ @@ -1,6 +1,7 @@ // Test sub- and superscript shifts. --- sub-super --- +<<<<<<< HEAD #table( columns: 3, [Typo.], [Fallb.], [Synth], @@ -8,12 +9,99 @@ [x#sub[1]], [x#sub[5n]], [x#sub[2 #box(square(size: 6pt))]], ) +======= +#let sq = box(square(size: 4pt)) +#table( + columns: 3, + [Typo.], [Fallb.], [Synth.], + [x#super[1#sq]], [x#super[5: #sq]], [x#super(typographic: false)[2 #sq]], + [x#sub[1#sq]], [x#sub[5: #sq]], [x#sub(typographic: false)[2 #sq]], +) + +--- sub-super-typographic --- +#set text(size: 20pt) +// Libertinus Serif supports "subs" and "sups" for `typo` and `sq`, but not for +// `synth`. +#let synth = [1,2,3] +#let typo = [123] +#let sq = [1#box(square(size: 4pt))2] +x#super(synth) x#super(typo) x#super(sq) \ +x#sub(synth) x#sub(typo) x#sub(sq) + +--- sub-super-italic-compensation --- +#set text(size: 20pt, style: "italic") +// Libertinus Serif supports "subs" and "sups" for `typo`, but not for `synth`. +#let synth = [1,2,3] +#let typo = [123] +#let sq = [1#box(square(size: 4pt))2] +x#super(synth) x#super(typo) x#super(sq) \ +x#sub(synth) x#sub(typo) x#sub(sq) + +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 --- sub-super-non-typographic --- #set super(typographic: false, baseline: -0.25em, size: 0.7em) n#super[1], n#sub[2], ... n#super[N] --- super-underline --- #set underline(stroke: 0.5pt, offset: 0.15em) +<<<<<<< HEAD #underline[The claim#super[\[4\]]] has been disputed. \ The claim#super[#underline[\[4\]]] has been disputed. \ It really has been#super(box(text(baseline: 0pt, underline[\[4\]]))) \ +======= +#set super(typographic: false) +#underline[A#super[4]] B \ +A#super[#underline[4]] B \ +A #underline(super[4]) B \ +#set super(typographic: true) +#underline[A#super[4]] B \ +A#super[#underline[4]] B \ +A #underline(super[4]) B + +--- super-highlight --- +#set super(typographic: false) +#highlight[A#super[4]] B \ +A#super[#highlight[4]] B \ +A#super(highlight[4]) \ +#set super(typographic: true) +#highlight[A#super[4]] B \ +A#super[#highlight[4]] B \ +A#super(highlight[4]) + +--- super-1em --- +#set text(size: 10pt) +#super(context test(1em.to-absolute(), 10pt)) + +--- long-scripts --- +|longscript| \ +|#super(typographic: true)[longscript]| \ +|#super(typographic: false)[longscript]| \ +|#sub(typographic: true)[longscript]| \ +|#sub(typographic: false)[longscript]| + +--- script-metrics-bundled-fonts --- +// Tests whether the script metrics are used properly by synthesizing +// superscripts and subscripts for all bundled fonts. + +#set super(typographic: false) +#set sub(typographic: false) + +#let test(font, weights, styles) = { + for weight in weights { + for style in styles { + text(font: font, weight: weight, style: style)[Xx#super[Xx]#sub[Xx]] + linebreak() + } + } +} + +#test("DejaVu Sans Mono", ("regular", "bold"), ("normal", "oblique")) +#test("Libertinus Serif", ("regular", "semibold", "bold"), ("normal", "italic")) +#test("New Computer Modern", ("regular", "bold"), ("normal", "italic")) +#test("New Computer Modern Math", (400, 450, "bold"), ("normal",)) + +--- basic-sup-sub html --- +1#super[st], 2#super[nd], 3#super[rd]. + +log#sub[2], log#sub[3], log#sub[variable]. +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 diff --git a/tests/suite/text/smallcaps.typ b/tests/suite/text/smallcaps.typ index 981e41c4cb..868fc3a22d 100644 --- a/tests/suite/text/smallcaps.typ +++ b/tests/suite/text/smallcaps.typ @@ -11,6 +11,10 @@ #show smallcaps: set text(fill: red) #smallcaps[Smallcaps] +<<<<<<< HEAD --- smallcaps-all --- +======= +--- smallcaps-all render html --- +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 #smallcaps(all: false)[Test 012] \ #smallcaps(all: true)[Test 012] diff --git a/tests/suite/text/smartquote.typ b/tests/suite/text/smartquote.typ index 4940d11b21..27a7611467 100644 --- a/tests/suite/text/smartquote.typ +++ b/tests/suite/text/smartquote.typ @@ -46,6 +46,13 @@ #set text(lang: "ru") "Лошадь не ест салат из огурцов" - это была первая фраза, сказанная по 'телефону'. +<<<<<<< HEAD +======= +--- smartquote-uk --- +#set text(lang: "uk") +"Кінь не їсть огірковий салат" — перше речення, коли-небудь вимовлене по 'телефону'. + +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 --- smartquote-it --- #set text(lang: "it") "Il cavallo non mangia insalata di cetrioli" è stata la prima frase pronunciata al 'telefono'. @@ -99,7 +106,11 @@ He's told some books contain questionable "example text". --- smartquote-disabled-temporarily --- // Test changing properties within text. +<<<<<<< HEAD "She suddenly started speaking french: #text(lang: "fr")['Je suis une banane.']" Roman told me. +======= +"She suddenly started speaking french: #text(lang: "fr", region: "CH")['Je suis une banane.']" Roman told me. +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 Some people's thought on this would be #[#set smartquote(enabled: false); "strange."] @@ -109,6 +120,19 @@ Some people's thought on this would be #[#set smartquote(enabled: false); "stran "'test' statement" \ "statement 'test'" +<<<<<<< HEAD +======= +--- smartquote-nesting-twice render html --- +When you said _that "he_ surely meant that 'she intended to say "I'm sorry"'", I was quite confused. + +'#box[box]' + +--- smartquote-inline-block html --- +Applies across #html.span["inline-level] elements". + +Does not apply across #html.div["block-level] elements". + +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 --- smartquote-with-embedding-chars --- #set text(lang: "fr") "#"\u{202A}"bonjour#"\u{202C}"" \ diff --git a/tests/suite/visualize/curve.typ b/tests/suite/visualize/curve.typ index 14a1c0cc81..7e289b5a2a 100644 --- a/tests/suite/visualize/curve.typ +++ b/tests/suite/visualize/curve.typ @@ -130,6 +130,19 @@ down, up, down, up, down, ) +<<<<<<< HEAD +======= +--- curve-stroke-gradient-sharp --- +#set page(width: auto) +#let down = curve.line((40pt, 40pt), relative: true) +#let up = curve.line((40pt, -40pt), relative: true) + +#curve( + stroke: 4pt + gradient.linear(red, blue).sharp(3), + down, up, down, up, down, +) + +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 --- curve-fill-rule --- #stack( dir: ltr, diff --git a/tests/suite/visualize/gradient.typ b/tests/suite/visualize/gradient.typ index 811b8b6054..275d8ffbc7 100644 --- a/tests/suite/visualize/gradient.typ +++ b/tests/suite/visualize/gradient.typ @@ -666,3 +666,35 @@ $ A = mat( #let _ = gradient.linear(..my-gradient.stops()) #let my-gradient2 = gradient.linear(red, blue).repeat(5, mirror: true) #let _ = gradient.linear(..my-gradient2.stops()) +<<<<<<< HEAD +======= + +--- issue-6162-coincident-gradient-stops-export-png --- +// Ensure that multiple gradient stops with the same position +// don't cause a panic. +#rect( + fill: gradient.linear( + (red, 0%), + (green, 0%), + (blue, 100%), + ) +) +#rect( + fill: gradient.linear( + (red, 0%), + (green, 100%), + (blue, 100%), + ) +) +#rect( + fill: gradient.linear( + (white, 0%), + (red, 50%), + (green, 50%), + (blue, 100%), + ) +) + +--- issue-6680-gradient-linear-with-aspect-correction --- +#set page(width: 200pt, height: auto, margin: 10pt, fill: gradient.linear(red, blue, angle: 45deg).sharp(2)) +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 diff --git a/tests/suite/visualize/image.typ b/tests/suite/visualize/image.typ index 7ce0c8c0af..863a077f23 100644 --- a/tests/suite/visualize/image.typ +++ b/tests/suite/visualize/image.typ @@ -9,6 +9,20 @@ #set page(height: 60pt) #image("/assets/images/tiger.jpg") +<<<<<<< HEAD +======= +--- image-jpg-html-base64 html --- +#image("/assets/images/f2t.jpg", alt: "The letter F") + +--- image-sizing-html-css html --- +#image("/assets/images/f2t.jpg", width: 50%, alt: "width: 50%") +#image("/assets/images/f2t.jpg", width: 100pt, alt: "width: 100pt") +#image("/assets/images/f2t.jpg", width: 30% + 50pt, alt: "width: calc(30% + 50pt)") +#image("/assets/images/f2t.jpg", height: 75%, alt: "height: 75%") +#image("/assets/images/f2t.jpg", height: 80pt, alt: "height: 80pt") +#image("/assets/images/f2t.jpg", height: 20% + 40pt, alt: "height: calc(20% + 40pt)") + +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 --- image-sizing --- // Test configuring the size and fitting behaviour of images. @@ -76,6 +90,96 @@ A #box(image("/assets/images/tiger.jpg", height: 1cm, width: 80%)) B ```.text )) +<<<<<<< HEAD +======= +--- image-svg-linked-jpg1 --- +#set page(fill: gray) +#image(bytes( + ``` + + + + + ```.text +)) + +--- image-svg-linked-jpg2 --- +#set page(fill: gray) +#image(bytes( + ``` + + + + + ```.text +)) + +--- image-svg-linked-many-formats --- +#set page(width: auto, height: auto, margin: 1pt) +#set text(1pt) +#image("../../../assets/images/linked.svg", width: 39pt) + +--- image-svg-linked-file-not-found --- +// Error: 8-7:2 failed to load linked image do-not-add-image-with-this-name.png in SVG (file not found, searched at tests/suite/visualize/do-not-add-image-with-this-name.png) +#image(bytes( + ``` + + + + ```.text +)) + +--- image-svg-linked-url --- +// Error: 8-7:2 failed to load linked image https://somedomain.com/image.png in SVG (URLs are not allowed) +#image(bytes( + ``` + + + + ```.text +)) + +--- image-svg-linked-pdf --- +// Error: 8-7:2 failed to load linked image ../../../assets/images/diagrams.pdf in SVG (PDF documents are not supported) +#image(bytes( + ``` + + + + ```.text +)) + +--- image-svg-linked-csv --- +// Error: 8-7:2 failed to load linked image ../../../assets/data/bad.csv in SVG (unknown image format) +#image(bytes( + ``` + + + + ```.text +)) + +--- image-svg-linked-absolute1 --- +// Error: 8-7:2 failed to load linked image /home/user/foo.svg in SVG (absolute paths are not allowed) +#image(bytes( + ``` + + + + ```.text +)) + +--- image-svg-linked-absolute2 --- +// Error: 8-7:2 failed to load linked image file:///home/user/foo.svg in SVG (absolute paths are not allowed) +#image(bytes( + ``` + + + + ```.text +)) + +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 --- image-pixmap-rgb8 --- #image( bytes(( @@ -128,7 +232,11 @@ A #box(image("/assets/images/tiger.jpg", height: 1cm, width: 80%)) B width: 1cm, ) +<<<<<<< HEAD --- image-scaling-methods --- +======= +--- image-scaling-methods render html --- +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 #let img(scaling) = image( bytes(( 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, @@ -144,14 +252,35 @@ A #box(image("/assets/images/tiger.jpg", height: 1cm, width: 80%)) B scaling: scaling, ) +<<<<<<< HEAD #stack( dir: ltr, spacing: 4pt, +======= +#let images = ( +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 img(auto), img("smooth"), img("pixelated"), ) +<<<<<<< HEAD +======= +#context if target() == "html" { + // TODO: Remove this once `stack` is supported in HTML export. + html.div( + style: "display: flex; flex-direction: row; gap: 4pt", + images.join(), + ) +} else { + stack( + dir: ltr, + spacing: 4pt, + ..images, + ) +} + +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 --- image-natural-dpi-sizing --- // Test that images aren't upscaled. // Image is just 48x80 at 220dpi. It should not be scaled to fit the page @@ -167,32 +296,58 @@ A #box(image("/assets/images/tiger.jpg", height: 1cm, width: 80%)) B #image("/assets/plugins/hello.wasm") --- image-bad-svg --- +<<<<<<< HEAD // Error: 2-33 failed to parse SVG (found closing tag 'g' instead of 'style' in line 4) +======= +// Error: "/assets/images/bad.svg" 4:3 failed to parse SVG (found closing tag 'g' instead of 'style') +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 #image("/assets/images/bad.svg") --- image-decode-svg --- // Test parsing from svg data // Warning: 8-14 `image.decode` is deprecated, directly pass bytes to `image` instead +<<<<<<< HEAD #image.decode(``.text, format: "svg") --- image-decode-bad-svg --- // Error: 2-168 failed to parse SVG (missing root node) // Warning: 8-14 `image.decode` is deprecated, directly pass bytes to `image` instead +======= +// Hint: 8-14 it will be removed in Typst 0.15.0 +#image.decode(``.text, format: "svg") + +--- image-decode-bad-svg --- +// Error: 15-152 failed to parse SVG (missing root node at 1:1) +// Warning: 8-14 `image.decode` is deprecated, directly pass bytes to `image` instead +// Hint: 8-14 it will be removed in Typst 0.15.0 +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 #image.decode(``.text, format: "svg") --- image-decode-detect-format --- // Test format auto detect // Warning: 8-14 `image.decode` is deprecated, directly pass bytes to `image` instead +<<<<<<< HEAD +======= +// Hint: 8-14 it will be removed in Typst 0.15.0 +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 #image.decode(read("/assets/images/tiger.jpg", encoding: none), width: 80%) --- image-decode-specify-format --- // Test format manual // Warning: 8-14 `image.decode` is deprecated, directly pass bytes to `image` instead +<<<<<<< HEAD +======= +// Hint: 8-14 it will be removed in Typst 0.15.0 +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 #image.decode(read("/assets/images/tiger.jpg", encoding: none), format: "jpg", width: 80%) --- image-decode-specify-wrong-format --- // Error: 2-91 failed to decode image (Format error decoding Png: Invalid PNG signature.) // Warning: 8-14 `image.decode` is deprecated, directly pass bytes to `image` instead +<<<<<<< HEAD +======= +// Hint: 8-14 it will be removed in Typst 0.15.0 +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 #image.decode(read("/assets/images/tiger.jpg", encoding: none), format: "png", width: 80%) --- image-pixmap-empty --- @@ -243,6 +398,7 @@ A #box(image("/assets/images/tiger.jpg", height: 1cm, width: 80%)) B --- image-png-but-pixmap-format --- #image( read("/assets/images/tiger.jpg", encoding: none), +<<<<<<< HEAD // Error: 11-18 expected "png", "jpg", "gif", dictionary, "svg", or auto format: "rgba8", ) @@ -253,6 +409,12 @@ A #box(image("/assets/images/tiger.jpg", height: 1cm, width: 80%)) B // File is from https://magnushoff.com/articles/jpeg-orientation/ #image("/assets/images/f2t.jpg", width: 10pt) +======= + // Error: 11-18 expected "png", "jpg", "gif", "webp", dictionary, "svg", "pdf", or auto + format: "rgba8", +) + +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 --- issue-measure-image --- // Test that image measurement doesn't turn `inf / some-value` into 0pt. #context { @@ -267,3 +429,50 @@ A #box(image("/assets/images/tiger.jpg", height: 1cm, width: 80%)) B --- issue-3733-dpi-svg --- #set page(width: 200pt, height: 200pt, margin: 0pt) #image("/assets/images/relative.svg") +<<<<<<< HEAD +======= + +--- image-exif-rotation --- +#let rotations = range(1, 9) +#let with-rotation(path, offset, v) = { + let data = read(path, encoding: none) + let modified = data.slice(0, offset) + bytes((v,)) + data.slice(offset + 1) + image(modified, width: 10pt) +} + +#set page(width: auto) +#table( + columns: 1 + rotations.len(), + table.header( + [], ..rotations.map(v => raw(str(v), lang: "typc")), + ), + `PNG`, ..rotations.map(v => with-rotation("/assets/images/f2t.png", 0x85, v)), + // JPEG has special handing in PDF export (no recoding, so instead we use a + // transform to apply the orientation), so it's worth testing that separately. + `JPEG`, ..rotations.map(v => with-rotation("/assets/images/f2t.jpg", 0x31, v)), +) + +--- image-pdf-basic render html --- +#image("/assets/images/star.pdf") + +--- image-pdf-complex --- +#image("/assets/images/matplotlib.pdf") + +--- image-pdf-multiple-pages --- +#image("/assets/images/diagrams.pdf", page: 1) +#image("/assets/images/diagrams.pdf", page: 3) +#image("/assets/images/diagrams.pdf", page: 2) + +--- image-pdf-base14-fonts --- +// Test PDF base 14 fonts. +#image("/assets/images/base14-fonts.pdf") + +--- image-pdf-invalid-page --- +// Error: 2-49 page 2 does not exist +// Hint: 2-49 the document only has 1 page +#image("/assets/images/matplotlib.pdf", page: 2) + +--- issue-6869-image-zero-sized --- +// Primarily to ensure that it does not crash in PDF export. +#image("/assets/images/f2t.jpg", width: 0pt, height: 0pt) +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 diff --git a/tests/suite/visualize/line.typ b/tests/suite/visualize/line.typ index 6cbbbb493d..645c8de2cc 100644 --- a/tests/suite/visualize/line.typ +++ b/tests/suite/visualize/line.typ @@ -84,7 +84,12 @@ --- line-bad-point-array --- // Test errors. +<<<<<<< HEAD // Error: 12-19 point array must contain exactly two entries +======= +// Error: 12-19 array must contain exactly two items +// Hint: 12-19 the first item determines the value for the X axis and the second item the value for the Y axis +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 #line(end: (50pt,)) --- line-bad-point-component-type --- diff --git a/tests/suite/visualize/path.typ b/tests/suite/visualize/path.typ index e44b2270e7..ab772caa2e 100644 --- a/tests/suite/visualize/path.typ +++ b/tests/suite/visualize/path.typ @@ -76,7 +76,12 @@ #path(((0%, 0%), (0%, 0%), (0%, 0%), (0%, 0%))) --- path-bad-point-array --- +<<<<<<< HEAD // Error: 7-31 point array must contain exactly two entries +======= +// Error: 7-31 array must contain exactly two items +// Hint: 7-31 the first item determines the value for the X axis and the second item the value for the Y axis +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 // Warning: 2-6 the `path` function is deprecated, use `curve` instead #path(((0%, 0%), (0%, 0%, 0%))) diff --git a/tests/suite/visualize/polygon.typ b/tests/suite/visualize/polygon.typ index ec27194dfb..ed4a452900 100644 --- a/tests/suite/visualize/polygon.typ +++ b/tests/suite/visualize/polygon.typ @@ -49,7 +49,12 @@ ) --- polygon-bad-point-array --- +<<<<<<< HEAD // Error: 10-17 point array must contain exactly two entries +======= +// Error: 10-17 array must contain exactly two items +// Hint: 10-17 the first item determines the value for the X axis and the second item the value for the Y axis +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 #polygon((50pt,)) --- polygon-infinite-size --- diff --git a/tests/suite/visualize/rect.typ b/tests/suite/visualize/rect.typ index a659287e70..22fc4e654e 100644 --- a/tests/suite/visualize/rect.typ +++ b/tests/suite/visualize/rect.typ @@ -54,6 +54,25 @@ #v(3pt) #rect(width: 20pt, height: 20pt, stroke: (thickness: 5pt, join: "round")) +<<<<<<< HEAD +======= +--- rect-stroke-caps --- +// Separated segments +#rect(width: 20pt, height: 20pt, stroke: ( + left: (cap: "round", thickness: 5pt), + right: (cap: "square", thickness: 7pt), +)) +// Joined segment with different caps. +#rect(width: 20pt, height: 20pt, stroke: ( + left: (cap: "round", thickness: 5pt), + top: (cap: "square", thickness: 7pt), +)) +// No caps when there is a radius for that corner. +#rect(width: 20pt, height: 20pt, radius: (top: 3pt), stroke: ( + left: (cap: "round", thickness: 5pt), + top: (cap: "square", thickness: 7pt), +)) +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 --- red-stroke-bad-type --- // Error: 15-21 expected length, color, gradient, tiling, dictionary, stroke, none, or auto, found array #rect(stroke: (1, 2)) diff --git a/tests/suite/visualize/tiling.typ b/tests/suite/visualize/tiling.typ index 9041334114..2ef886da40 100644 --- a/tests/suite/visualize/tiling.typ +++ b/tests/suite/visualize/tiling.typ @@ -161,5 +161,9 @@ #set page(width: auto, height: auto, margin: 0pt) // Warning: 10-17 the name `pattern` is deprecated, use `tiling` instead +<<<<<<< HEAD +======= +// Hint: 10-17 it will be removed in Typst 0.15.0 +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 #let t = pattern(size: (10pt, 10pt), line(stroke: 4pt, start: (0%, 0%), end: (100%, 100%))) #rect(width: 50pt, height: 50pt, fill: t) diff --git a/tools/test-helper/package.json b/tools/test-helper/package.json index 08a60fa315..25b9e01325 100644 --- a/tools/test-helper/package.json +++ b/tools/test-helper/package.json @@ -94,9 +94,18 @@ "watch": "tsc -watch -p ./" }, "devDependencies": { +<<<<<<< HEAD "@types/node": "18.x", "@types/vscode": "^1.88.0", "typescript": "^5.3.3" +======= + "@types/node": "^24.0.4", + "@types/vscode": "^1.101.0", + "typescript": "^5.8.3" + }, + "dependencies": { + "shiki": "^3.7.0" +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 }, "engines": { "vscode": "^1.88.0" @@ -104,4 +113,8 @@ "__metadata": { "size": 35098973 } -} \ No newline at end of file +<<<<<<< HEAD +} +======= +} +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 diff --git a/tools/test-helper/src/extension.ts b/tools/test-helper/src/extension.ts index b98b4bad4c..6e5b7c60b8 100644 --- a/tools/test-helper/src/extension.ts +++ b/tools/test-helper/src/extension.ts @@ -1,6 +1,10 @@ import * as vscode from "vscode"; import * as cp from "child_process"; import { clearInterval } from "timers"; +<<<<<<< HEAD +======= +const shiki = import("shiki"); // Normal import causes TypeScript problems. +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 // Called when an activation event is triggered. Our activation event is the // presence of "tests/suite/playground.typ". @@ -17,6 +21,11 @@ class TestHelper { opened?: { // The tests's name. name: string; +<<<<<<< HEAD +======= + // The test's attributes. + attrs: string[]; +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 // The WebView panel that displays the test images and output. panel: vscode.WebviewPanel; }; @@ -44,6 +53,7 @@ class TestHelper { ); // Triggered when clicking "View" in the lens. +<<<<<<< HEAD this.registerCommand("typst-test-helper.viewFromLens", (name) => this.viewFromLens(name) ); @@ -56,6 +66,20 @@ class TestHelper { // Triggered when clicking "Save" in the lens. this.registerCommand("typst-test-helper.saveFromLens", (name) => this.saveFromLens(name) +======= + this.registerCommand("typst-test-helper.viewFromLens", (name, attrs) => + this.viewFromLens(name, attrs) + ); + + // Triggered when clicking "Run" in the lens. + this.registerCommand("typst-test-helper.runFromLens", (name, attrs) => + this.runFromLens(name, attrs) + ); + + // Triggered when clicking "Save" in the lens. + this.registerCommand("typst-test-helper.saveFromLens", (name, attrs) => + this.saveFromLens(name, attrs) +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 ); // Triggered when clicking "Terminal" in the lens. @@ -121,31 +145,51 @@ class TestHelper { const lenses = []; for (let nr = 0; nr < document.lineCount; nr++) { const line = document.lineAt(nr); +<<<<<<< HEAD const re = /^--- ([\d\w-]+)( [\d\w-]+)* ---$/; +======= + const re = /^--- ([\d\w-]+)(( [\d\w-]+)*) ---$/; +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 const m = line.text.match(re); if (!m) { continue; } const name = m[1]; +<<<<<<< HEAD +======= + const attrs = m[2].trim().split(" "); +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 lenses.push( new vscode.CodeLens(line.range, { title: "View", tooltip: "View the test output and reference in a new tab", command: "typst-test-helper.viewFromLens", +<<<<<<< HEAD arguments: [name], +======= + arguments: [name, attrs], +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 }), new vscode.CodeLens(line.range, { title: "Run", tooltip: "Run the test and view the results in a new tab", command: "typst-test-helper.runFromLens", +<<<<<<< HEAD arguments: [name], +======= + arguments: [name, attrs], +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 }), new vscode.CodeLens(line.range, { title: "Save", tooltip: "Run and view the test and save the reference output", command: "typst-test-helper.saveFromLens", +<<<<<<< HEAD arguments: [name], +======= + arguments: [name, attrs], +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 }), new vscode.CodeLens(line.range, { title: "Terminal", @@ -159,40 +203,76 @@ class TestHelper { } // Triggered when clicking "View" in the lens. +<<<<<<< HEAD private viewFromLens(name: string) { if (this.opened?.name == name) { +======= + private viewFromLens(name: string, attrs: string[]) { + if ( + this.opened?.name == name && + this.opened.attrs.join(" ") == attrs.join(" ") + ) { +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 this.opened.panel.reveal(); return; } if (this.opened) { this.opened.name = name; +<<<<<<< HEAD +======= + this.opened.attrs = attrs; +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 this.opened.panel.title = name; } else { const panel = vscode.window.createWebviewPanel( "typst-test-helper.preview", name, vscode.ViewColumn.Beside, +<<<<<<< HEAD { enableFindWidget: true } ); panel.onDidDispose(() => (this.opened = undefined)); this.opened = { name, panel }; +======= + { enableFindWidget: true, enableScripts: true } + ); + + panel.onDidDispose(() => (this.opened = undefined)); + panel.webview.onDidReceiveMessage((message) => { + if (message.command === "openFile") { + vscode.env.openExternal(vscode.Uri.parse(message.uri)); + } + }); + + this.opened = { name, attrs, panel }; +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 } this.refreshWebView(); } // Triggered when clicking "Run" in the lens. +<<<<<<< HEAD private runFromLens(name: string) { this.viewFromLens(name); +======= + private runFromLens(name: string, attrs: string[]) { + this.viewFromLens(name, attrs); +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 this.runFromPreview(); } // Triggered when clicking "Run" in the lens. +<<<<<<< HEAD private saveFromLens(name: string) { this.viewFromLens(name); +======= + private saveFromLens(name: string, attrs: string[]) { + this.viewFromLens(name, attrs); +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 this.saveFromPreview(); } @@ -288,6 +368,7 @@ class TestHelper { private copyImageFilePathFromPreviewContext(webviewSection: string) { if (!this.opened) return; const { name } = this.opened; +<<<<<<< HEAD const { png, ref } = getImageUris(name); switch (webviewSection) { case "png": @@ -299,12 +380,19 @@ class TestHelper { default: break; } +======= + const [bucket, format] = webviewSection.split("/"); + vscode.env.clipboard.writeText( + getUri(name, bucket as Bucket, format as Format).fsPath + ); +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 } // Reloads the web view. private refreshWebView(output?: { stdout: string; stderr: string }) { if (!this.opened) return; +<<<<<<< HEAD const { name, panel } = this.opened; const { png, ref } = getImageUris(name); @@ -323,6 +411,29 @@ class TestHelper { throw new Error("panel to refresh is falsy after waiting"); } panel.webview.html = getWebviewContent(webViewSrcs, output); +======= + const { name, attrs, panel } = this.opened; + + if (panel) { + console.log( + `Refreshing WebView for ${name}` + + (panel.visible ? " in background" : "") + ); + + panel.webview.html = ""; + + // Make refresh notable. + setTimeout(async () => { + if (!panel) { + throw new Error("panel to refresh is falsy after waiting"); + } + panel.webview.html = await getWebviewContent( + panel, + name, + attrs, + output + ); +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 }, 50); } } @@ -386,6 +497,7 @@ function getWorkspaceRoot() { return vscode.workspace.workspaceFolders![0].uri; } +<<<<<<< HEAD // Returns the URIs for a test's images. function getImageUris(name: string) { const root = getWorkspaceRoot(); @@ -397,10 +509,33 @@ function getImageUris(name: string) { // Produces the content of the WebView. function getWebviewContent( webViewSrcs: { png: vscode.Uri; ref: vscode.Uri }, +======= +const EXTENSION = { html: "html", render: "png" }; + +type Bucket = "store" | "ref"; +type Format = "html" | "render"; + +function getUri(name: string, bucket: Bucket, format: Format) { + let path; + if (bucket === "ref" && format === "render") { + path = `tests/ref/${name}.png`; + } else { + path = `tests/${bucket}/${format}/${name}.${EXTENSION[format]}`; + } + return vscode.Uri.joinPath(getWorkspaceRoot(), path); +} + +// Produces the content of the WebView. +async function getWebviewContent( + panel: vscode.WebviewPanel, + name: string, + attrs: string[], +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 output?: { stdout: string; stderr: string; } +<<<<<<< HEAD ): string { const escape = (text: string) => text.replace(//g, ">"); @@ -410,6 +545,21 @@ function getWebviewContent( : ""; const stderrHtml = output?.stderr ? `

Standard error

${escape(output.stderr)}
` +======= +): Promise { + const showHtml = attrs.includes("html"); + const showRender = !showHtml || attrs.includes("render"); + + const stdout = output?.stdout + ? `

Standard output

${escape(
+        output.stdout
+      )}
` + : ""; + const stderr = output?.stderr + ? `

Standard error

${escape(
+        output.stderr
+      )}
` +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 : ""; return ` @@ -449,17 +599,30 @@ function getWebviewContent( color: #bebebe; content: "Not present"; } +<<<<<<< HEAD pre { display: inline-block; font-family: var(--vscode-editor-font-family); text-align: left; width: 80%; +======= + h2 { + margin-bottom: 12px; + } + h2 a { + color: var(--vscode-editor-foreground); + text-decoration: underline; + } + h2 a:hover { + cursor: pointer; +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 } .flex { display: flex; flex-wrap: wrap; justify-content: center; } +<<<<<<< HEAD @@ -492,3 +655,156 @@ function getWebviewContent( `; } +======= + .vertical { + flex-direction: column; + } + .top-bottom { + display: flex; + flex-direction: column; + padding-inline: 32px; + width: calc(100vw - 64px); + } + pre { + font-family: var(--vscode-editor-font-family); + text-align: left; + white-space: pre-wrap; + } + pre.output { + display: inline-block; + width: 80%; + margin-block-start: 0; + } + pre.shiki { + background-color: transparent !important; + padding: 12px; + margin-block-start: 0; + } + pre.shiki code { + --vscode-textPreformat-background: transparent; + } + iframe, pre.shiki { + border: 1px solid rgb(189, 191, 204); + border-radius: 6px; + } + iframe { + background: white; + } + .vscode-dark iframe { + filter: invert(1) hue-rotate(180deg); + } + + + + + ${showRender ? renderSection(panel, name) : ""} + ${showHtml ? await htmlSection(name) : ""} + ${stdout} + ${stderr} + + `; +} + +function renderSection(panel: vscode.WebviewPanel, name: string) { + const outputUri = getUri(name, "store", "render"); + const refUri = getUri(name, "ref", "render"); + return `
+
+ ${linkedTitle("Output", outputUri)} + Placeholder +
+ +
+ ${linkedTitle("Reference", refUri)} + Placeholder +
+
`; +} + +async function htmlSection(name: string) { + const storeHtml = await htmlSnippet( + "HTML Output", + getUri(name, "store", "html") + ); + const refHtml = await htmlSnippet( + "HTML Reference", + getUri(name, "ref", "html") + ); + return `
+ ${storeHtml} + ${refHtml} +
`; +} + +async function htmlSnippet(title: string, uri: vscode.Uri): Promise { + try { + const data = await vscode.workspace.fs.readFile(uri); + const code = new TextDecoder("utf-8").decode(data); + return `
+ ${linkedTitle(title, uri)} +
+ ${await highlight(code)} + +
+
`; + } catch { + return `

${title}

Not present
`; + } +} + +function linkedTitle(title: string, uri: vscode.Uri) { + return `

${title}

`; +} + +async function highlight(code: string): Promise { + return (await shiki).codeToHtml(code, { + lang: "html", + theme: selectTheme(), + }); +} + +function selectTheme() { + switch (vscode.window.activeColorTheme.kind) { + case vscode.ColorThemeKind.Light: + case vscode.ColorThemeKind.HighContrastLight: + return "github-light"; + case vscode.ColorThemeKind.Dark: + case vscode.ColorThemeKind.HighContrast: + return "github-dark"; + } +} + +function escape(text: string) { + return text + .replace(/&/g, "&") + .replace(//g, ">") + .replace(/"/g, """) + .replace(/'/g, "'"); +} +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 diff --git a/tools/test-helper/tsconfig.json b/tools/test-helper/tsconfig.json index 45e374553e..893852e17c 100644 --- a/tools/test-helper/tsconfig.json +++ b/tools/test-helper/tsconfig.json @@ -1,9 +1,17 @@ { "compilerOptions": { +<<<<<<< HEAD "module": "Node16", "target": "ES2022", "outDir": "dist", "lib": ["ES2022"], +======= + "module": "nodenext", + "lib": ["ES2022", "DOM"], + "target": "ES2022", + "moduleResolution": "nodenext", + "outDir": "dist", +>>>>>>> dd1e6e94f73db6a257a5ac34a6320e00410a2534 "sourceMap": true, "rootDir": "src", "strict": true