diff --git a/.cirrus.yml b/.cirrus.yml index ab336409b..b85f5dd1a 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -43,7 +43,7 @@ task: - ./bootstrap.sh configure_script: | ./configure MAKE=gmake \ - --enable-developer LUAROCKS=false LUACHECK=false BUSTED=false PDFINFO=false NIX=false \ + --enable-developer LUAROCKS=false LUACHECK=false BUSTED=false DELTA=cat PDFINFO=false NIX=false \ --disable-font-variations \ --with-system-lua-sources \ --with-system-luarocks \ diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 4fdb0f968..888eb9cfd 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,5 +1,5 @@ # Default -* @alerque @simoncozens +* @alerque # Language expertise languages/fr* @sile-typesetter/lang-fr diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b1dff4f29..bd5d72f04 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,8 +13,9 @@ jobs: matrix: configuration: - [ 'dynamic', '' ] - - [ 'embeded', '--enable-embeded-resources' ] - [ 'system', '--with-system-lua-sources' ] + - [ 'embeded', '--enable-embeded-resources' ] + - [ 'static', '--enable-embeded-resources --disable-shared --enable-static' ] runs-on: ubuntu-22.04 name: Build Ubuntu ${{ matrix.configuration[0] }} steps: @@ -52,27 +53,39 @@ jobs: ${{ matrix.configuration[1] }} echo "VERSION=$(./build-aux/git-version-gen .tarball-version)" >> $GITHUB_ENV echo "MAKEFLAGS=-j$(nproc) -Otarget" >> $GITHUB_ENV + echo "CARCH=$(uname -m)" >> $GITHUB_ENV - name: Make run: | make - name: Package run: | make dist - - name: Upload artifacts - if: ${{ !contains(github.ref, 'refs/tags/v') }} - uses: actions/upload-artifact@v3 + - name: Upload source dist artifact + if: ${{ matrix.configuration[0] == 'dynamic' && !contains(github.ref, 'refs/tags/v') }} + uses: actions/upload-artifact@v4 with: name: sile-${{ env.VERSION }} path: sile-${{ env.VERSION }}.zip + - name: Append architecture to static binary + if: ${{ matrix.configuration[0] == 'static' }} + run: | + cp sile sile-${{ env.CARCH }} + - name: Upload static binary artifact + if: ${{ matrix.configuration[0] == 'static' && !contains(github.ref, 'refs/tags/v') }} + uses: actions/upload-artifact@v4 + with: + name: sile-${{ env.CARCH }} + path: sile-${{ env.CARCH }} - name: Release uses: softprops/action-gh-release@v1 - if: github.repository == 'sile-typesetter/sile' && startsWith(github.ref, 'refs/tags/v') + if: matrix.configuration[0] == 'static' && github.repository == 'sile-typesetter/sile' && startsWith(github.ref, 'refs/tags/v') with: body_path: sile-${{ env.VERSION }}.md files: | sile-${{ env.VERSION }}.pdf sile-${{ env.VERSION }}.zip sile-${{ env.VERSION }}.tar.xz + sile-${{ env.CARCH }} build-nix: runs-on: ubuntu-22.04 @@ -90,7 +103,7 @@ jobs: .sources key: fonts-${{ hashFiles('Makefile-fonts') }} - name: Install Nix - uses: DeterminateSystems/nix-installer-action@v6 + uses: DeterminateSystems/nix-installer-action@v9 - name: Cache Nix dependencies uses: DeterminateSystems/magic-nix-cache-action@v2 - name: Setup developer environment @@ -98,6 +111,6 @@ jobs: nix develop --command ./bootstrap.sh nix develop --configure nix develop --command make - - name: Run HB6+ only regressions + - name: Run regression tests for which Ubuntu can't provide deps run: | - nix develop --command make regressions TESTSRCS=tests/variations-axis.sil + nix develop --command make regressions TESTSRCS='tests/variations-axis.sil tests/feat-unicode-softhyphen.sil' diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 527cdff82..5af3ebd0d 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -60,7 +60,7 @@ jobs: run: | ./bootstrap.sh ./configure \ - --enable-developer LUACHECK=false NIX=false \ + --enable-developer LUACHECK=false NIX=false DELTA=cat \ --disable-font-variations \ --without-manual - name: Make diff --git a/.github/workflows/nix.yml b/.github/workflows/nix.yml index 20befbf78..247fe6033 100644 --- a/.github/workflows/nix.yml +++ b/.github/workflows/nix.yml @@ -16,7 +16,7 @@ jobs: with: fetch-depth: 0 - name: Install Nix - uses: DeterminateSystems/nix-installer-action@v6 + uses: DeterminateSystems/nix-installer-action@v9 - name: Cache Nix dependencies uses: DeterminateSystems/magic-nix-cache-action@v2 # Upstream package sometimes has flags set that disable flake checking diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6393d6469..a8fa553f2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,7 +18,7 @@ jobs: - [ '5.2', 'MYCFLAGS=-fPIC' ] - [ '5.1', 'CFLAGS="-O2 -Wall -DLUA_USE_LINUX -fPIC"' ] - [ 'luajit', 'XCFLAGS=-fPIC' ] - # - [ 'luajit-openresty', 'XCFLAGS=-fPIC' ] + - [ 'luajit-openresty', 'XCFLAGS=-fPIC' ] runs-on: ubuntu-22.04 name: Test on Lua ${{ matrix.luaVersion[0] }} steps: @@ -71,9 +71,10 @@ jobs: ./bootstrap.sh ./configure \ ${{ matrix.luaVersion[1] }} \ - --enable-developer LUACHECK=false NIX=false \ + --enable-developer LUACHECK=false NIX=false DELTA=cat \ --disable-font-variations \ --with${{ !startsWith(matrix.luaVersion[0], 'luajit') && 'out' || '' }}-luajit \ + --without-system-luarocks \ --without-manual - name: Make run: | @@ -95,7 +96,7 @@ jobs: run: | make cargo-test - name: Upload artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: test-${{ matrix.luaVersion[0] }}-actuals path: tests/*.actual diff --git a/.luacheckrc b/.luacheckrc index da4ce6a8d..2fa32aa67 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -1,4 +1,4 @@ -std = "max" +std = "min" include_files = { "**/*.lua", "sile.in", @@ -21,6 +21,7 @@ files["**/*_spec.lua"] = { std = "+busted" } globals = { + package = { fields = { "searchpath" } }, "SILE", "SU", "luautf8", diff --git a/CHANGELOG.md b/CHANGELOG.md index 2cde910bf..a4cd27450 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,23 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +### [0.14.14](https://github.com/sile-typesetter/sile/compare/v0.14.13...v0.14.14) (2023-12-23) + + +### Features + +* **cli:** Change module load error to suggestion for how to install 3rd party modules ([c280050](https://github.com/sile-typesetter/sile/commit/c2800505eda2ee1630eea931f88efb07f6892d00)) +* **languages:** U+00A0 non-breaking space must be stretchable by default ([b769a63](https://github.com/sile-typesetter/sile/commit/b769a633069db4f32746d920dc9696296c7ab7db)) +* **typesetters:** Support U+00AD soft hyphen as discretionary break ([285507e](https://github.com/sile-typesetter/sile/commit/285507e5fddf3b0c752bb2b5bf81e8bf7f19144a)) + + +### Bug Fixes + +* **backends:** Fix plain text backend to work in LuaJIT/Lua 5.1 ([b185d49](https://github.com/sile-typesetter/sile/commit/b185d4972a5f29e7441f7af34e1ac49f49e6747f)) +* **cli:** Stop outputting error messages twice on failure to process main file ([da5d609](https://github.com/sile-typesetter/sile/commit/da5d60902a4129deb79ae4658ba82757d7277b85)) +* **core:** Use nil-safe and Lua-version-robust table utils ([2405b23](https://github.com/sile-typesetter/sile/commit/2405b23f0f448b217a066ecb34cae54f3e63aa64)) +* **packages:** Adjust dropcap logic for letters with a depth ([fd6963d](https://github.com/sile-typesetter/sile/commit/fd6963d226cc6a3b325dd796414936d200ae1ed2)) + ### [0.14.13](https://github.com/sile-typesetter/sile/compare/v0.14.12...v0.14.13) (2023-10-30) diff --git a/Cargo.lock b/Cargo.lock index 9159408f5..fbd96faf3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -10,18 +10,18 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "aho-corasick" -version = "1.1.1" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea5d730647d4fadd988536d06fecce94b7b4f2a7efdae548f1cf4b63205518ab" +checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" dependencies = [ "memchr", ] [[package]] name = "anstream" -version = "0.6.4" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ab91ebe16eb252986481c5b62f6098f3b698a45e34b5b98200cf20dd2484a44" +checksum = "d664a92ecae85fd0a7392615844904654d1d5f5514837f471ddef4a057aba1b6" dependencies = [ "anstyle", "anstyle-parse", @@ -39,37 +39,37 @@ checksum = "7079075b41f533b8c61d2a4d073c4676e1f8b249ff94a393b0595db304e0dd87" [[package]] name = "anstyle-parse" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "317b9a89c1868f5ea6ff1d9539a69f45dffc21ce321ac1fd1160dfa48c8e2140" +checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.0.0" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" +checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" dependencies = [ - "windows-sys", + "windows-sys 0.52.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.1" +version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0699d10d2f4d628a98ee7b57b289abbc98ff3bad977cb3152709d4bf2330628" +checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" dependencies = [ "anstyle", - "windows-sys", + "windows-sys 0.52.0", ] [[package]] name = "anyhow" -version = "1.0.75" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" +checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" [[package]] name = "arc-swap" @@ -91,9 +91,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" +checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" [[package]] name = "block-buffer" @@ -106,9 +106,9 @@ dependencies = [ [[package]] name = "bstr" -version = "1.6.2" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c2f7349907b712260e64b0afe2f84692af14a454be26187d9df565c7f69266a" +checksum = "c48f0051a4b4c5e0b6d365cd04af53aeaa209e3cc15ec2cdb69e73cc87fbd0dc" dependencies = [ "memchr", "regex-automata", @@ -141,9 +141,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.4.6" +version = "4.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d04704f56c2cde07f43e8e2c154b43f216dc5c92fc98ada720177362f953b956" +checksum = "33e92c5c1a78c62968ec57dbc2440366a2d6e5a23faf829970ff1585dc6b18e2" dependencies = [ "clap_builder", "clap_derive", @@ -151,9 +151,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.4.6" +version = "4.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e231faeaca65ebd1ea3c737966bf858971cd38c3849107aa3ea7de90a804e45" +checksum = "f4323769dc8a61e2c39ad7dc26f6f2800524691a44d74fe3d1071a5c24db6370" dependencies = [ "anstream", "anstyle", @@ -164,36 +164,36 @@ dependencies = [ [[package]] name = "clap_complete" -version = "4.4.3" +version = "4.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3ae8ba90b9d8b007efe66e55e48fb936272f5ca00349b5b0e89877520d35ea7" +checksum = "97aeaa95557bd02f23fbb662f981670c3d20c5a26e69f7354b28f57092437fcd" dependencies = [ "clap", ] [[package]] name = "clap_derive" -version = "4.4.2" +version = "4.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0862016ff20d69b84ef8247369fabf5c008a7417002411897d40ee1f4532b873" +checksum = "cf9804afaaf59a91e75b022a30fb7229a7901f60c755489cc61c9b423b836442" dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.48", ] [[package]] name = "clap_lex" -version = "0.5.1" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd7cc57abe963c6d3b9d8be5b06ba7c8957a930305ca90304f24ef040aa6f961" +checksum = "702fc72eb24e5a1e48ce58027a675bc24edd52096d5397d4aea7c6dd9eca0bd1" [[package]] name = "clap_mangen" -version = "0.2.14" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b44f35c514163027542f7147797ff930523eea288e03642727348ef1a9666f6b" +checksum = "10b5db60b3310cdb376fbeb8826e875a38080d0c61bdec0a91a3da8338948736" dependencies = [ "clap", "roff", @@ -222,9 +222,9 @@ checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" [[package]] name = "core-foundation" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" dependencies = [ "core-foundation-sys", "libc", @@ -232,9 +232,9 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.4" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" +checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" [[package]] name = "core-graphics" @@ -251,9 +251,9 @@ dependencies = [ [[package]] name = "core-graphics-types" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bb142d41022986c1d8ff29103a1411c8a3dfad3552f87a4f8dc50d61d4f4e33" +checksum = "45390e6114f68f718cc7a830514a96f903cccd70d02a8f6d9f643ac4ba45afaf" dependencies = [ "bitflags 1.3.2", "core-foundation", @@ -274,9 +274,9 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.9" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a17b76ff3a4162b0b27f354a0c87015ddad39d35f9c0c36607a3bdd175dde1f1" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" dependencies = [ "libc", ] @@ -302,9 +302,12 @@ dependencies = [ [[package]] name = "deranged" -version = "0.3.8" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2696e8a945f658fd14dc3b87242e6b80cd0f36ff04ea560fa39082368847946" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +dependencies = [ + "powerfmt", +] [[package]] name = "digest" @@ -330,30 +333,19 @@ checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" [[package]] name = "errno" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "add4f07d43996f76ef320709726a556a9d4f965d9410d8d0271132d2f8293480" -dependencies = [ - "errno-dragonfly", - "libc", - "windows-sys", -] - -[[package]] -name = "errno-dragonfly" -version = "0.1.2" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" dependencies = [ - "cc", "libc", + "windows-sys 0.52.0", ] [[package]] name = "faster-hex" -version = "0.8.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "239f7bfb930f820ab16a9cd95afc26f88264cf6905c960b340a615384aa3338a" +checksum = "a2a2b11eda1d40935b26cf18f6833c526845ae8c41e58d09af6adeb6f0269183" dependencies = [ "serde", ] @@ -366,32 +358,26 @@ checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" [[package]] name = "filetime" -version = "0.2.22" +version = "0.2.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4029edd3e734da6fe05b6cd7bd2960760a616bd2ddd0d59a0124746d6272af0" +checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" dependencies = [ "cfg-if", "libc", "redox_syscall", - "windows-sys", + "windows-sys 0.52.0", ] [[package]] name = "flate2" -version = "1.0.27" +version = "1.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6c98ee8095e9d1dcbf2fcc6d95acccb90d1c81db1e44725c6a984b1dbdfb010" +checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" dependencies = [ "crc32fast", "miniz_oxide", ] -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - [[package]] name = "foreign-types" version = "0.3.2" @@ -409,9 +395,9 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "form_urlencoded" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" dependencies = [ "percent-encoding", ] @@ -449,9 +435,9 @@ dependencies = [ [[package]] name = "gix" -version = "0.53.1" +version = "0.55.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06a8c9f9452078f474fecd2880de84819b8c77224ab62273275b646bf785f906" +checksum = "002667cd1ebb789313d0d0afe3d23b2821cf3b0e91605095f0e6d8751f0ceeea" dependencies = [ "gix-actor", "gix-commitgraph", @@ -492,9 +478,9 @@ dependencies = [ [[package]] name = "gix-actor" -version = "0.26.0" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e8c6778cc03bca978b2575a03e04e5ba6f430a9dd9b0f1259f0a8a9a5e5cc66" +checksum = "2eadca029ef716b4378f7afb19f7ee101fde9e58ba1f1445971315ac866db417" dependencies = [ "bstr", "btoi", @@ -506,41 +492,41 @@ dependencies = [ [[package]] name = "gix-bitmap" -version = "0.2.7" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ccab4bc576844ddb51b78d81b4a42d73e6229660fa614dfc3d3999c874d1959" +checksum = "78b6cd0f246180034ddafac9b00a112f19178135b21eb031b3f79355891f7325" dependencies = [ "thiserror", ] [[package]] name = "gix-chunk" -version = "0.4.4" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b42ea64420f7994000130328f3c7a2038f639120518870436d31b8bde704493" +checksum = "003ec6deacf68076a0c157271a127e0bb2c031c1a41f7168cbe5d248d9b85c78" dependencies = [ "thiserror", ] [[package]] name = "gix-commitgraph" -version = "0.20.0" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4676ede3a7d37e7028e2889830349a6aca22efc1d2f2dd9fa3351c1a8ddb0c6a" +checksum = "85a7007ba021f059803afaf6f8a48872422abc20550ac12ede6ddea2936cec36" dependencies = [ "bstr", "gix-chunk", "gix-features", "gix-hash", - "memmap2", + "memmap2 0.9.3", "thiserror", ] [[package]] name = "gix-config" -version = "0.29.0" +version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1108c4ac88248dd25cc8ab0d0dae796e619fb72d92f88e30e00b29d61bb93cc4" +checksum = "5cae98c6b4c66c09379bc35274b172587d6b0ac369a416c39128ad8c6454f9bb" dependencies = [ "bstr", "gix-config-value", @@ -559,11 +545,11 @@ dependencies = [ [[package]] name = "gix-config-value" -version = "0.14.0" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea7505b97f4d8e7933e29735a568ba2f86d8de466669d9f0e8321384f9972f47" +checksum = "52e0be46f4cf1f8f9e88d0e3eb7b29718aff23889563249f379119bd1ab6910e" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.4.1", "bstr", "gix-path", "libc", @@ -572,9 +558,9 @@ dependencies = [ [[package]] name = "gix-date" -version = "0.8.0" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc7df669639582dc7c02737642f76890b03b5544e141caba68a7d6b4eb551e0d" +checksum = "fb7f3dfb72bebe3449b5e642be64e3c6ccbe9821c8b8f19f487cf5bfbbf4067e" dependencies = [ "bstr", "itoa", @@ -584,9 +570,9 @@ dependencies = [ [[package]] name = "gix-diff" -version = "0.35.0" +version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45e342d148373bd9070d557e6fb1280aeae29a3e05e32506682d027278501eb" +checksum = "931394f69fb8c9ed6afc0aae3487bd869e936339bcc13ed8884472af072e0554" dependencies = [ "gix-hash", "gix-object", @@ -595,9 +581,9 @@ dependencies = [ [[package]] name = "gix-discover" -version = "0.24.0" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da4cacda5ee9dd1b38b0e2506834e40e66c08cf050ef55c344334c76745f277b" +checksum = "a45d5cf0321178883e38705ab2b098f625d609a7d4c391b33ac952eff2c490f2" dependencies = [ "bstr", "dunce", @@ -610,9 +596,9 @@ dependencies = [ [[package]] name = "gix-features" -version = "0.34.0" +version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f414c99e1a7abc69b21f3225a6539d203b0513f1d1d448607c4ea81cdcf9ee59" +checksum = "4d46a4a5c6bb5bebec9c0d18b65ada20e6517dbd7cf855b87dd4bbdce3a771b2" dependencies = [ "crc32fast", "flate2", @@ -628,20 +614,20 @@ dependencies = [ [[package]] name = "gix-fs" -version = "0.6.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "404795da3d4c660c9ab6c3b2ad76d459636d1e1e4b37b0c7ff68eee898c298d4" +checksum = "20e86eb040f5776a5ade092282e51cdcad398adb77d948b88d17583c2ae4e107" dependencies = [ "gix-features", ] [[package]] name = "gix-glob" -version = "0.12.0" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3ac79c444193b0660fe0c0925d338bd338bd643e32138784dccfb12c628b892" +checksum = "5db19298c5eeea2961e5b3bf190767a2d1f09b8802aeb5f258e42276350aff19" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.4.1", "bstr", "gix-features", "gix-path", @@ -649,9 +635,9 @@ dependencies = [ [[package]] name = "gix-hash" -version = "0.13.0" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ccf425543779cddaa4a7c62aba3fa9d90ea135b160be0a72dd93c063121ad4a" +checksum = "1f8cf8c2266f63e582b7eb206799b63aa5fa68ee510ad349f637dfe2d0653de0" dependencies = [ "faster-hex", "thiserror", @@ -659,9 +645,9 @@ dependencies = [ [[package]] name = "gix-hashtable" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "409268480841ad008e81c17ca5a293393fbf9f2b6c2f85b8ab9de1f0c5176a16" +checksum = "feb61880816d7ec4f0b20606b498147d480860ddd9133ba542628df2f548d3ca" dependencies = [ "gix-hash", "hashbrown", @@ -670,11 +656,11 @@ dependencies = [ [[package]] name = "gix-index" -version = "0.24.0" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e9599fc30b3d6aad231687a403f85dfa36ae37ccf1b68ee1f621ad5b7fc7a0d" +checksum = "c83a4fcc121b2f2e109088f677f89f85e7a8ebf39e8e6659c0ae54d4283b1650" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.4.1", "bstr", "btoi", "filetime", @@ -686,16 +672,16 @@ dependencies = [ "gix-object", "gix-traverse", "itoa", - "memmap2", + "memmap2 0.7.1", "smallvec", "thiserror", ] [[package]] name = "gix-lock" -version = "9.0.0" +version = "11.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1568c3d90594c60d52670f325f5db88c2d572e85c8dd45fabc23d91cadb0fd52" +checksum = "7e5c65e6a29830a435664891ced3f3c1af010f14900226019590ee0971a22f37" dependencies = [ "gix-tempfile", "gix-utils", @@ -704,20 +690,20 @@ dependencies = [ [[package]] name = "gix-macros" -version = "0.1.0" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d8acb5ee668d55f0f2d19a320a3f9ef67a6999ad483e11135abcc2464ed18b6" +checksum = "d75e7ab728059f595f6ddc1ad8771b8d6a231971ae493d9d5948ecad366ee8bb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.48", ] [[package]] name = "gix-object" -version = "0.36.0" +version = "0.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e5528d5b2c984044d547e696e44a8c45fa122e83cd8c2ac1da69bd474336be8" +checksum = "740f2a44267f58770a1cb3a3d01d14e67b089c7136c48d4bddbb3cfd2bf86a51" dependencies = [ "bstr", "btoi", @@ -734,9 +720,9 @@ dependencies = [ [[package]] name = "gix-odb" -version = "0.52.0" +version = "0.54.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0446eca295459deb3d6dd6ed7d44a631479f1b7381d8087166605c7a9f717c6" +checksum = "8630b56cb80d8fa684d383dad006a66401ee8314e12fbf0e566ddad8c115143b" dependencies = [ "arc-swap", "gix-date", @@ -753,9 +739,9 @@ dependencies = [ [[package]] name = "gix-pack" -version = "0.42.0" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be19ee650300d7cbac5829b637685ec44a8d921a7c2eaff8a245d8f2f008870c" +checksum = "1431ba2e30deff1405920693d54ab231c88d7c240dd6ccc936ee223d8f8697c3" dependencies = [ "clru", "gix-chunk", @@ -765,7 +751,7 @@ dependencies = [ "gix-object", "gix-path", "gix-tempfile", - "memmap2", + "memmap2 0.7.1", "parking_lot", "smallvec", "thiserror", @@ -773,9 +759,9 @@ dependencies = [ [[package]] name = "gix-path" -version = "0.10.0" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a1d370115171e3ae03c5c6d4f7d096f2981a40ddccb98dfd704c773530ba73b" +checksum = "b8dd0998ab245f33d40ca2267e58d542fe54185ebd1dc41923346cf28d179fb6" dependencies = [ "bstr", "gix-trace", @@ -786,9 +772,9 @@ dependencies = [ [[package]] name = "gix-quote" -version = "0.4.7" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "475c86a97dd0127ba4465fbb239abac9ea10e68301470c9791a6dd5351cdc905" +checksum = "9f7dc10303d73a960d10fb82f81188b036ac3e6b11b5795b20b1a60b51d1321f" dependencies = [ "bstr", "btoi", @@ -797,9 +783,9 @@ dependencies = [ [[package]] name = "gix-ref" -version = "0.36.0" +version = "0.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3cccbfa8d5cd9b86465f27a521e0c017de54b92d9fd37c143e49c658a2f04f3a" +checksum = "0ec2f6d07ac88d2fb8007ee3fa3e801856fb9d82e7366ec0ca332eb2c9d74a52" dependencies = [ "gix-actor", "gix-date", @@ -811,16 +797,16 @@ dependencies = [ "gix-path", "gix-tempfile", "gix-validate", - "memmap2", + "memmap2 0.7.1", "thiserror", "winnow", ] [[package]] name = "gix-refspec" -version = "0.17.0" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "678ba30d95baa5462df9875628ed40655d5f5b8aba7028de86ed57f36e762c6c" +checksum = "ccb0974cc41dbdb43a180c7f67aa481e1c1e160fcfa8f4a55291fd1126c1a6e7" dependencies = [ "bstr", "gix-hash", @@ -832,9 +818,9 @@ dependencies = [ [[package]] name = "gix-revision" -version = "0.21.0" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3e80a5992ae446fe1745dd26523b86084e3f1b6b3e35377fe09b4f35ac8f151" +checksum = "2ca97ac73459a7f3766aa4a5638a6e37d56d4c7962bc1986fbaf4883d0772588" dependencies = [ "bstr", "gix-date", @@ -848,9 +834,9 @@ dependencies = [ [[package]] name = "gix-revwalk" -version = "0.7.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b806349bc1f668e09035800e07ac8045da4e39a8925a245d93142c4802224ec1" +checksum = "a16d8c892e4cd676d86f0265bf9d40cefd73d8d94f86b213b8b77d50e77efae0" dependencies = [ "gix-commitgraph", "gix-date", @@ -863,11 +849,11 @@ dependencies = [ [[package]] name = "gix-sec" -version = "0.10.0" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92b9542ac025a8c02ed5d17b3fc031a111a384e859d0be3532ec4d58c40a0f28" +checksum = "78f6dce0c6683e2219e8169aac4b1c29e89540a8262fef7056b31d80d969408c" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.4.1", "gix-path", "libc", "windows", @@ -875,9 +861,9 @@ dependencies = [ [[package]] name = "gix-tempfile" -version = "9.0.0" +version = "11.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2762b91ff95e27ff3ea95758c0d4efacd7435a1be3629622928b8276de0f72a8" +checksum = "388dd29114a86ec69b28d1e26d6d63a662300ecf61ab3f4cc578f7d7dc9e7e23" dependencies = [ "gix-fs", "libc", @@ -890,15 +876,15 @@ dependencies = [ [[package]] name = "gix-trace" -version = "0.1.3" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96b6d623a1152c3facb79067d6e2ecdae48130030cf27d6eb21109f13bd7b836" +checksum = "e8e1127ede0475b58f4fe9c0aaa0d9bb0bad2af90bbd93ccd307c8632b863d89" [[package]] name = "gix-traverse" -version = "0.32.0" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ec6358f8373fb018af8fc96c9d2ec6a5b66999e2377dc40b7801351fec409ed" +checksum = "14d050ec7d4e1bb76abf0636cf4104fb915b70e54e3ced9a4427c999100ff38a" dependencies = [ "gix-commitgraph", "gix-date", @@ -912,9 +898,9 @@ dependencies = [ [[package]] name = "gix-url" -version = "0.23.0" +version = "0.25.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c79d595b99a6c7ab274f3c991735a0c0f5a816a3da460f513c48edf1c7bf2cc" +checksum = "0c427a1a11ccfa53a4a2da47d9442c2241deee63a154bc15cc14b8312fbc4005" dependencies = [ "bstr", "gix-features", @@ -926,18 +912,18 @@ dependencies = [ [[package]] name = "gix-utils" -version = "0.1.5" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b85d89dc728613e26e0ed952a19583744e7f5240fcd4aa30d6c824ffd8b52f0f" +checksum = "de6225e2de30b6e9bca2d9f1cc4731640fcef0fb3cabddceee366e7e85d3e94f" dependencies = [ "fastrand", ] [[package]] name = "gix-validate" -version = "0.8.0" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e05cab2b03a45b866156e052aa38619f4ece4adcb2f79978bfc249bc3b21b8c5" +checksum = "ac7cc36f496bd5d96cdca0f9289bb684480725d40db60f48194aa7723b883854" dependencies = [ "bstr", "thiserror", @@ -945,15 +931,15 @@ dependencies = [ [[package]] name = "globset" -version = "0.4.13" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "759c97c1e17c55525b57192c06a267cda0ac5210b222d6b82189a2338fa1c13d" +checksum = "57da3b9b5b85bd66f31093f8c408b90a74431672542466497dcbdfdc02034be1" dependencies = [ "aho-corasick", "bstr", - "fnv", "log", - "regex", + "regex-automata", + "regex-syntax", ] [[package]] @@ -972,9 +958,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.14.1" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dfda62a12f55daeae5015f81b0baea145391cb4520f86c248fc615d72640d12" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" [[package]] name = "heck" @@ -984,18 +970,18 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "home" -version = "0.5.5" +version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5444c27eef6923071f7ebcc33e3444508466a76f7a2b93da00ed6e19f30c1ddb" +checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" dependencies = [ - "windows-sys", + "windows-sys 0.52.0", ] [[package]] name = "idna" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" dependencies = [ "unicode-bidi", "unicode-normalization", @@ -1012,27 +998,27 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.9" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" +checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" [[package]] name = "libc" -version = "0.2.148" +version = "0.2.152" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cdc71e17332e86d2e1d38c1f99edcb6288ee11b815fb1a4b049eaa2114d369b" +checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" [[package]] name = "linux-raw-sys" -version = "0.4.8" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3852614a3bd9ca9804678ba6be5e3b8ce76dfc902cae004e3e0c44051b6e88db" +checksum = "c4cd1a83af159aa67994778be9070f0ae1bd732942279cabb14f86f986a21456" [[package]] name = "lock_api" -version = "0.4.10" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" +checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" dependencies = [ "autocfg", "scopeguard", @@ -1046,18 +1032,18 @@ checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "lua-src" -version = "546.0.1" +version = "546.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c26d4af78361e025a3d03a2b964cd1592aff7495f4d4f7947218c084c6fdca8" +checksum = "2da0daa7eee611a4c30c8f5ee31af55266e26e573971ba9336d2993e2da129b2" dependencies = [ "cc", ] [[package]] name = "luajit-src" -version = "210.4.8+resty107baaf" +version = "210.5.4+c525bcb" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e05167e8b2a2185758d83ed23541e5bd8bce37072e4204e0ef2c9b322bc87c4e" +checksum = "2a10ab4ed12d22cb50ef43ece4f6c5ca594b2d2480019e87facfd422225a9908" dependencies = [ "cc", "which", @@ -1065,9 +1051,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.6.4" +version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" +checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" [[package]] name = "memmap2" @@ -1078,6 +1064,15 @@ dependencies = [ "libc", ] +[[package]] +name = "memmap2" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45fd3a57831bf88bc63f8cebc0cf956116276e97fef3966103e96416209f7c92" +dependencies = [ + "libc", +] + [[package]] name = "miniz_oxide" version = "0.7.1" @@ -1089,9 +1084,9 @@ dependencies = [ [[package]] name = "mlua" -version = "0.9.1" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c3a7a7ff4481ec91b951a733390211a8ace1caba57266ccb5f4d4966704e560" +checksum = "1aba10897af47c8e85283db95529b0c6a2d8f3c7b9733c0d2f206d9ee8fc51a3" dependencies = [ "bstr", "mlua-sys", @@ -1103,9 +1098,9 @@ dependencies = [ [[package]] name = "mlua-sys" -version = "0.3.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ec8b54eddb76093069cce9eeffb4c7b3a1a0fe66962d7bd44c4867928149ca3" +checksum = "4655631a02e3739d014951291ecfa08db49c4da3f7f8c6f3931ed236af5dd78e" dependencies = [ "cc", "cfg-if", @@ -1126,14 +1121,14 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn 2.0.38", + "syn 2.0.48", ] [[package]] name = "num-traits" -version = "0.2.16" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" dependencies = [ "autocfg", ] @@ -1149,9 +1144,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.18.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "parking_lot" @@ -1165,28 +1160,34 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.8" +version = "0.9.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" +checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" dependencies = [ "cfg-if", "libc", "redox_syscall", "smallvec", - "windows-targets", + "windows-targets 0.48.5", ] [[package]] name = "percent-encoding" -version = "2.3.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pkg-config" -version = "0.3.27" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" +checksum = "69d3587f8a9e599cc7ec2c00e331f71c4e69a5f9a4b8a6efd5b07466b9736f9a" + +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" [[package]] name = "proc-macro-error" @@ -1214,9 +1215,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.67" +version = "1.0.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328" +checksum = "95fc56cda0b5c3325f5fbbd7ff9fda9e02bb00bb3dac51252d2f1bfa1cb8cc8c" dependencies = [ "unicode-ident", ] @@ -1229,27 +1230,27 @@ checksum = "794b5bf8e2d19b53dcdcec3e4bba628e20f5b6062503ba89281fa7037dd7bbcf" [[package]] name = "quote" -version = "1.0.33" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" dependencies = [ "proc-macro2", ] [[package]] name = "redox_syscall" -version = "0.3.5" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" dependencies = [ "bitflags 1.3.2", ] [[package]] name = "regex" -version = "1.9.6" +version = "1.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebee201405406dbf528b8b672104ae6d6d63e6d118cb10e4d51abbc7b58044ff" +checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" dependencies = [ "aho-corasick", "memchr", @@ -1259,9 +1260,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.3.9" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59b23e92ee4318893fa3fe3e6fb365258efbfe6ac6ab30f090cdcbb7aa37efa9" +checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" dependencies = [ "aho-corasick", "memchr", @@ -1270,9 +1271,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.7.5" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "roff" @@ -1282,9 +1283,9 @@ checksum = "b833d8d034ea094b1ea68aa6d5c740e0d04bad9d16568d08ba6f76823a114316" [[package]] name = "rust-embed" -version = "8.0.0" +version = "8.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1e7d90385b59f0a6bf3d3b757f3ca4ece2048265d70db20a2016043d4509a40" +checksum = "a82c0bbc10308ed323529fd3c1dce8badda635aa319a5ff0e6466f33b8101e3f" dependencies = [ "rust-embed-impl", "rust-embed-utils", @@ -1293,22 +1294,22 @@ dependencies = [ [[package]] name = "rust-embed-impl" -version = "8.0.0" +version = "8.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c3d8c6fd84090ae348e63a84336b112b5c3918b3bf0493a581f7bd8ee623c29" +checksum = "6227c01b1783cdfee1bcf844eb44594cd16ec71c35305bf1c9fb5aade2735e16" dependencies = [ "proc-macro2", "quote", "rust-embed-utils", - "syn 2.0.38", + "syn 2.0.48", "walkdir", ] [[package]] name = "rust-embed-utils" -version = "8.0.0" +version = "8.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "873feff8cb7bf86fdf0a71bb21c95159f4e4a37dd7a4bd1855a940909b583ada" +checksum = "8cb0a25bfbb2d4b4402179c2cf030387d9990857ce08a32592c6238db9fa8665" dependencies = [ "globset", "sha2", @@ -1323,15 +1324,15 @@ checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] name = "rustix" -version = "0.38.17" +version = "0.38.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f25469e9ae0f3d0047ca8b93fc56843f38e6774f0914a107ff8b41be8be8e0b7" +checksum = "72e572a5e8ca657d7366229cdde4bd14c4eb5499a9573d4d366fe1b599daa316" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.4.1", "errno", "libc", "linux-raw-sys", - "windows-sys", + "windows-sys 0.52.0", ] [[package]] @@ -1357,22 +1358,22 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "serde" -version = "1.0.188" +version = "1.0.195" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" +checksum = "63261df402c67811e9ac6def069e4786148c4563f4b50fd4bf30aa370d626b02" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.188" +version = "1.0.195" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" +checksum = "46fe8f8603d81ba86327b23a2e9cdf49e1255fb94a4c5f297f6ee0547178ea2c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.48", ] [[package]] @@ -1413,7 +1414,7 @@ dependencies = [ [[package]] name = "sile" -version = "0.14.8" +version = "0.14.14" dependencies = [ "anyhow", "clap", @@ -1427,9 +1428,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.11.1" +version = "1.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "942b4a808e05215192e39f4ab80813e599068285906cc91aa64f923db842bd5a" +checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" [[package]] name = "strsim" @@ -1449,9 +1450,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.38" +version = "2.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e96b79aaa137db8f61e26363a0c9b47d8b4ec75da28b7d1d614c2303e232408b" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" dependencies = [ "proc-macro2", "quote", @@ -1460,15 +1461,15 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.8.0" +version = "3.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb94d2f3cc536af71caac6b6fcebf65860b347e7ce0cc9ebe8f70d3e521054ef" +checksum = "01ce4141aa927a6d1bd34a041795abd0db1cccba5d5f24b009f694bdf3a1f3fa" dependencies = [ "cfg-if", "fastrand", "redox_syscall", "rustix", - "windows-sys", + "windows-sys 0.52.0", ] [[package]] @@ -1478,39 +1479,40 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "21bebf2b7c9e0a515f6e0f8c51dc0f8e4696391e6f1ff30379559f8365fb0df7" dependencies = [ "rustix", - "windows-sys", + "windows-sys 0.48.0", ] [[package]] name = "thiserror" -version = "1.0.49" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1177e8c6d7ede7afde3585fd2513e611227efd6481bd78d2e82ba1ce16557ed4" +checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.49" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10712f02019e9288794769fba95cd6847df9874d49d871d062172f9dd41bc4cc" +checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.48", ] [[package]] name = "time" -version = "0.3.29" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "426f806f4089c493dcac0d24c29c01e2c38baf8e30f1b716ee37e83d200b18fe" +checksum = "f657ba42c3f86e7680e53c8cd3af8abbe56b5491790b46e22e19c0d57463583e" dependencies = [ "deranged", "itoa", "libc", "num_threads", + "powerfmt", "serde", "time-core", "time-macros", @@ -1524,9 +1526,9 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ad70d68dba9e1f8aceda7aa6711965dfec1cac869f311a51bd08b3a2ccbce20" +checksum = "26197e33420244aeb70c3e8c78376ca46571bc4e701e4791c2cd9f57dcb3a43f" dependencies = [ "time-core", ] @@ -1554,15 +1556,15 @@ checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "unicode-bidi" -version = "0.3.13" +version = "0.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" +checksum = "6f2528f27a9eb2b21e69c95319b30bd0efd85d09c379741b0f78ea1d86be2416" [[package]] name = "unicode-bom" -version = "2.0.2" +version = "2.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98e90c70c9f0d4d1ee6d0a7d04aa06cb9bbd53d8cfbdd62a0269a7c2eb640552" +checksum = "7eec5d1121208364f6793f7d2e222bf75a915c19557537745b195b253dd64217" [[package]] name = "unicode-ident" @@ -1581,9 +1583,9 @@ dependencies = [ [[package]] name = "url" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" +checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" dependencies = [ "form_urlencoded", "idna", @@ -1598,9 +1600,9 @@ checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" [[package]] name = "vergen" -version = "8.2.5" +version = "8.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85e7dc29b3c54a2ea67ef4f953d5ec0c4085035c0ae2d325be1c0d2144bd9f16" +checksum = "1290fd64cc4e7d3c9b07d7f333ce0ce0007253e32870e632624835cc80b83939" dependencies = [ "anyhow", "gix", @@ -1626,14 +1628,15 @@ dependencies = [ [[package]] name = "which" -version = "4.4.2" +version = "5.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" +checksum = "9bf3ea8596f3a0dd5980b46430f2058dfe2c36a27ccfbb1845d6fbfcd9ba6e14" dependencies = [ "either", "home", "once_cell", "rustix", + "windows-sys 0.48.0", ] [[package]] @@ -1669,11 +1672,21 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows" -version = "0.48.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" +checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" dependencies = [ - "windows-targets", + "windows-core", + "windows-targets 0.52.0", +] + +[[package]] +name = "windows-core" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +dependencies = [ + "windows-targets 0.52.0", ] [[package]] @@ -1682,7 +1695,16 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows-targets", + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.0", ] [[package]] @@ -1691,13 +1713,28 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +dependencies = [ + "windows_aarch64_gnullvm 0.52.0", + "windows_aarch64_msvc 0.52.0", + "windows_i686_gnu 0.52.0", + "windows_i686_msvc 0.52.0", + "windows_x86_64_gnu 0.52.0", + "windows_x86_64_gnullvm 0.52.0", + "windows_x86_64_msvc 0.52.0", ] [[package]] @@ -1706,47 +1743,89 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" + [[package]] name = "windows_aarch64_msvc" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" + [[package]] name = "windows_i686_gnu" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" +[[package]] +name = "windows_i686_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" + [[package]] name = "windows_i686_msvc" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" +[[package]] +name = "windows_i686_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" + [[package]] name = "windows_x86_64_gnu" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" + [[package]] name = "windows_x86_64_gnullvm" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" + [[package]] name = "windows_x86_64_msvc" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" + [[package]] name = "winnow" -version = "0.5.15" +version = "0.5.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c2e3184b9c4e92ad5167ca73039d0c42476302ab603e2fec4487511f38ccefc" +checksum = "b7520bbdec7211caa7c4e682eb1fbe07abe20cee6756b6e00f537c82c11816aa" dependencies = [ "memchr", ] diff --git a/Cargo.toml b/Cargo.toml index fa0e6157d..2bb64ac56 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sile" -version = "0.14.8" +version = "0.14.14" edition = "2021" rust-version = "1.71.0" description = "Simon’s Improved Layout Engine" diff --git a/Dockerfile b/Dockerfile index 335d543d3..c17bad642 100644 --- a/Dockerfile +++ b/Dockerfile @@ -28,7 +28,6 @@ RUN build-aux/docker-bootstrap.sh RUN ./bootstrap.sh RUN ./configure --with-system-lua-sources --without-manual RUN make -RUN make check RUN make install DESTDIR=/pkgdir # Work around BuiltKit / buildx bug, they can’t copy to symlinks only dirs diff --git a/Makefile.am b/Makefile.am index 23a68cdac..e8f99c459 100644 --- a/Makefile.am +++ b/Makefile.am @@ -79,7 +79,7 @@ EXTRA_DIST += src/embed.rs.in BUILT_SOURCES = $(BUILT_LUA_SOURCES) Makefile-distfiles -CLEANFILES = $(DEPFILES) $(ACTUALS) $(TESTPDFS) $(MANUAL) $(_BUILT_SUBDIRS) +CLEANFILES = $(MANUAL) include $(top_srcdir)/build-aux/rust_boilerplate.mk @@ -139,6 +139,7 @@ DEPDIR := .deps LOCALFONTS := FONTCONFIG_FILE=$(PWD)/fontconfig.conf LOCALPATHS := SILE_PATH="$(PWD);libtexpdf/.libs;justenough/.libs" SILEFLAGS ?= -m $(DEPDIR)/$(basename $@).d -d versions -f fontconfig +DRAFT ?= false dist-hook: $(MANUAL) dist-hook-distfiles @@ -171,7 +172,10 @@ selfcheck: | $(bin_PROGRAMS) $(_BUILT_SUBDIRS) $(PDFINFO) $$output | $(GREP) "SILE v$(VERSION)" .PHONY: docs -docs: $(MANUAL) +docs: $(_MANUAL) + +.PHONY: docs-figures +docs-figures: $(FIGURES) # This is a monkey patch to figure out how many passes we have to to to # garantee the TOC is up to date, simplify when #230 is fixed. @@ -185,7 +189,7 @@ define runsile = mkdir -p $(DEPDIR)/$$(dirname $@) $(silepass) export -n SILE_COVERAGE - if $(hastoc); then + if $$($(hastoc)) && ! $(DRAFT); then $${hadtoc} || $(silepass) [ "$${pg}" = "$${pg0}" ] || $(silepass) fi @@ -198,16 +202,33 @@ _DOCS_DEPS = $(and $$(filter documentation/%,$@),$(addprefix .fonts/,$(DOCSFONTF # TODO: remove _BUILT_SUBDIRS hack and replace it with something sensible when # these subdirs don't do crazy things like copying files outside of their own trees! _BUILT_SUBDIRS = .built-subdirs -_SUBDIR_TELLS = justenough/.libs/fontmetrics.so \ - justenough/.libs/justenoughfontconfig.so \ - justenough/.libs/justenoughharfbuzz.so \ - justenough/.libs/justenoughicu.so \ - justenough/.libs/justenoughlibtexpdf.so \ - justenough/.libs/svg.so \ - libtexpdf/.libs/libtexpdf.so.0.0.0 +_SUBDIR_TELLS = + +if SHARED +_SUBDIR_TELLS += justenough/.libs/fontmetrics.$(SHARED_LIB_EXT) \ + justenough/.libs/justenoughfontconfig.$(SHARED_LIB_EXT) \ + justenough/.libs/justenoughharfbuzz.$(SHARED_LIB_EXT) \ + justenough/.libs/justenoughicu.$(SHARED_LIB_EXT) \ + justenough/.libs/justenoughlibtexpdf.$(SHARED_LIB_EXT) \ + justenough/.libs/svg.$(SHARED_LIB_EXT) \ + libtexpdf/.libs/libtexpdf.$(SHARED_LIB_EXT).0.0.0 +endif + +if STATIC +_SUBDIR_TELLS += justenough/.libs/fontmetrics.a \ + justenough/.libs/justenoughfontconfig.a \ + justenough/.libs/justenoughharfbuzz.a \ + justenough/.libs/justenoughicu.a \ + justenough/.libs/justenoughlibtexpdf.a \ + justenough/.libs/svg.a \ + libtexpdf/.libs/libtexpdf.a +endif + $(_BUILT_SUBDIRS): $(_SUBDIR_TELLS) touch $@ +CLEANFILES += $(_BUILT_SUBDIRS) + $(_SUBDIR_TELLS): $(MAKE) $(AM_MAKEFLAGS) all-recursive @@ -262,6 +283,7 @@ update_libtexpdf: TESTPDFS = $(addsuffix .pdf,$(basename $(TESTSRCS))) EXPECTEDS ?= $(filter $(addsuffix .expected,$(basename $(TESTSRCS))),$(TESTEXPECTS)) ACTUALS = $(addsuffix .actual,$(basename $(EXPECTEDS))) +CLEANFILES += $(TESTPDFS) $(ACTUALS) REGRESSIONSCRIPT := ./tests/regressions.pl BUSTEDFLAGS ?= @@ -340,6 +362,7 @@ tests/%.actual: tests/%.nil $$(patterndeps) DEPFILES = $(addsuffix .d,$(addprefix $(DEPDIR)/,$(basename $(TESTSRCS) $(MANUAL)))) DEPDIRS = $(sort $(dir $(DEPFILES))) +CLEANFILES += $(DEPFILES) $(DEPDIRS): | Makefile-distfiles mkdir -p $@ @@ -361,19 +384,21 @@ docker: Dockerfile hooks/build .version docker-dep-check: .docker_deps .aur_deps diff -u $^ -CLEANFILES += .docker_deps .docker_deps: hooks/build $(SHELL) -c 'source <($(SED) -nE "/^(RUN|'"'"')/{s/.*=/echo /;p}" $<)' | \ tr ' ' '\n' | \ sort > $@ -CLEANFILES += .aur_deps +CLEANFILES += .docker_deps + .aur_deps: curl -Ls 'https://aur.archlinux.org/cgit/aur.git/plain/.SRCINFO?h=sile-git' | \ $(SED) -nE '/\bdepends =/{s/.*= //;p}' | \ $(GREP) -vxE '(lua-.*|.*\.so|git|glibc)' | \ sort > $@ +CLEANFILES += .aur_deps + define docker_push = test -z "$(DOCKER_PAT)" || \ docker login https://$(DOCKER_REGISTRY) -u $(DOCKER_USERNAME) -p $(DOCKER_PAT) diff --git a/README.md b/README.md index 17db398e9..40abe9b95 100644 --- a/README.md +++ b/README.md @@ -70,8 +70,7 @@ If you install LuaRocks for use with SILE via `pacman`, use the `lua51-*` varian #### Fedora -A [COPR][copr] repository is available for Fedora users with packages of SILE -and all the necessary dependencies. +A [COPR][copr] repository is available for Fedora users with packages of SILE and all the necessary dependencies. Fedora 38 and later are supported. There is work in progress to get the packages added to the official Fedora repository. @@ -90,7 +89,8 @@ $ zypper install sile #### NixOS -A [Nix `sile` package][nix] is available in both the stable and unstable channels; the unstable channel having the latest stable SILE releases and the stable channel being frozen on NixOS releases. +A [Nix `sile` package][nix] is available in both the stable and unstable channels; + the unstable channel having the latest stable SILE releases and the stable channel being frozen on NixOS releases. You can use all the usual Nix tricks including adding SILE into a `nix shell` environment or executing it directly with `nix run`. See additional usage notes in the [Nix section](#nix). @@ -132,9 +132,15 @@ Prebuilt Windows binaries are supposed to be generated by the Azure [build pipel #### Docker Docker images are available as [siletypesetter/sile](https://hub.docker.com/repository/docker/siletypesetter/sile). -Released versions are tagged to match (e.g. `v0.10.0`), the latest release will be tagged `latest`, and a `master` tag is also available with the freshest development build. -In order to be useful you need to tell the Docker run command a way to reach your source documents (and hence also to give it a place to write the output) as well as tell it who you are on the host machine so the output generated inside the container can be created with the expected ownership properties. -You may find it easiest to run with an alias like this: +Released versions are available as tagged containers matching the release (e.g. `v0.10.0`). +Additionally the latest release will be tagged `latest`, and a `master` tag is also available with the freshest development build. + +In order to be useful you need to tell the Docker run command a way to reach your source documents. +This is done by mounting your project directory inside the container. +This also gives SILE a place to write the output. +For ownership and permissions of output generated inside the container to match the host, the expected user ids need to be passed as well. + +You may find it easiest to do all this with an alias like this: ```console $ alias sile='docker run -it --volume "$(pwd):/data" --user "$(id -u):$(id -g)" siletypesetter/sile:latest' @@ -153,33 +159,47 @@ $ docker run -it --volume "/usr/share/fonts:/fonts" --volume "$(pwd):/data" --us #### Nix -The `nix` package manager is available as a standalone package manager on many platforms other than NixOS including most Linux and BSD distributions, macOS, and even for Windows via WSL; and thus presents a viable alternative way to run SILE on most systems. +The `nix` package manager is available as a standalone package manager on many platforms other than NixOS including most Linux and BSD distributions, macOS, and even for Windows via WSL; + and thus presents a viable alternative way to run SILE on most systems. [Nix packages][nix] are available in both the stable and unstable channels. -Because all packages are first made available in the unstable channel and then eventually make their way into the stable channel, to get the latest stable SILE releases we recommend hitting up the unstable channel first. +We recommend the unstable channel because all fresh packages (including stable SILE releases) land there first and eventually trickle down to the stable channel. You can use all the usual Nix tricks including launching a new shell with the `sile` command available or running it directly from any shell: ```console +# Launch a new shell with SILE available $ nix shell nixpkgs/nixpkgs-unstable#sile $ sile +# Run SILE directly as a single command $ nix run nixpkgs/nixpkgs-unstable#sile -- ``` -The SILE source repository is also a valid Nix [Flake][nix-flakes] which means you can run any specific version or the latest unreleased development code directly: +The SILE source repository is also a [Nix Flake][nix-flakes]. +This means you can run any arbitrary tagged version, branch, or commit with a single command. +This is an easy way to run SILE on other platforms, but also to test other versions or run the latest development version of SILE. ```console -$ nix run github:sile-typesetter/sile/v0.14.3 -- +# Explicitly run a tagged version +$ nix run github:sile-typesetter/sile/v0.14.13 -- + +# Use the master branch HEAD that will become the next minor release $ nix run github:sile-typesetter/sile -- + +# Run the develop branch HEAD that will become the next major release +$ nix run github:sile-typesetter/sile/develop -- ``` ### From Source SILE source code can be downloaded from [its website][sile] or directly from [the GitHub releases page][releases]. -SILE is written in the Lua programming language, so you will need a working Lua installation on your system (Lua 5.1, 5.2, 5.3, 5.4, and LuaJIT (2.0, 2.1, or OpenResty) are fully supported). +SILE is written in the Lua programming language, so you will need a working Lua installation on your system. +Lua 5.1, 5.2, 5.3, 5.4, and LuaJIT (2.0, 2.1, or OpenResty) are all fully supported. + It also relies on external libraries to access fonts and write PDF files. -Its preferred combination of libraries is [Harfbuzz][harfbuzz] and [libtexpdf][], a PDF creation library extracted from TeX. Harfbuzz (minimum version 1.1.3) should be available from your operating system's package manager. +Its preferred combination of libraries is [Harfbuzz][harfbuzz] and [libtexpdf][], a PDF creation library extracted from TeX. +Harfbuzz (minimum version 1.1.3) should be available from your operating system’s package manager. For Harfbuzz to work you will also need fontconfig installed. SILE also requires the [ICU][icu] libraries for Unicode handling. @@ -195,9 +215,10 @@ If you try to `brew link` and you get a series of messages including something l For pkg-config to find icu4c you may need to set: export PKG_CONFIG_PATH="/usr/local/opt/icu4c/lib/pkgconfig" -Optionally you may install the Lua libraries listed in the [rockspec][] to your system (using either your system's package manager or [luarocks][] (`luarocks install --only-deps sile-dev-1.rockspec`). +Optionally you may install the Lua libraries listed in the [rockspec][] to your system (using either your system’s package manager or [luarocks][] (`luarocks install --only-deps sile-dev-1.rockspec`). By default all the required Lua libraries will be downloaded and bundled alongside the SILE the installation. -If you downloaded a source tarball these dependencies are included, if you are using a git clone of the source repository the build system will require `luarocks` to fetch them during build. +If you downloaded a source tarball these dependencies are included. +If you are using a Git clone of the source repository the build system will require `luarocks` to fetch them during build. Note that OpenSSL development headers will be required for one of the Lua modules to compile¹. If your system has all the required packages already you may add `--with-system-luarocks` to the `./configure` command to avoid bundling them. @@ -212,38 +233,43 @@ $ ./bootstrap.sh ``` If you just plan on installing and using SILE, the default configure options (plus any Lua related options discussed above) should be fine. -If you plan on developing SILE itself (whether just to hack on it for your own use or contribute upstream) there are two particularly useful configuration options. -First you can add `--datarootdir=$(cd ..;pwd)` which will enable the compiled binary to run directly from the source directory without being installed at all. -Second you can add `--enable-developer` to also check for tooling we expect SILE developers to have such as tools used for testing. -Using this options also enables a number of targets that wouldn't normally be needed by end users such as `make regressions`. +If you plan on developing SILE itself (whether to just tinker with it for your own use or contribute upstream) there is one particularly useful configuration option. +You can add `--enable-developer` will set the 'installed data' directory to the source location which will enable the compiled binary to run directly from the source directory without being installed at all. +Additionally it will enable checks for tooling we expect SILE contributors to have such as tools used for testing. +Using this options also enables a number of targets that wouldn’t normally be needed by end users such as `make regressions`. -Once your dependencies are installed and you know what options you want, it is time to configure the sources, then build, then install: +Once your dependencies are installed and you know what options you want, it is time to configure the sources, then build them. ```console $ ./configure $ make -$ make install ``` -This will place the SILE libraries and executable in a sensible location. +If you just want to mess with SILE locally you can stop here (especially if you used `--enable-developer`). +However to actually install, you will need to run the installation command with system permissions. -On some systems you may also need to run: +```console +$ sudo make install +``` + +On some systems you may also need to make the system aware of the newly installed libraries before first use: ```console $ ldconfig ``` -… before trying to execute `sile` to make the system aware of the newly installed libraries. - ### Default Font Since SILE v0.9.5, the default font has been Gentium Plus which is freely available from [SIL’s site][gentium]. -It is not absolutely required that you install it, but if this font is not installed on your system, you won't be able to use the examples without modification. -(Previously we used Gentium Basic, but that's getting harder to get hold of.) +(Previously we used Gentium Basic, but that’s getting harder to get hold of.) +The math package uses [Libertinus Math][libertinus] by default to render formulas. +Additionally, monospace text by default is set in [Hack][hack]. +It is not absolutely required that you install default fonts, but if this font is not installed on your system you won’t be able to use the examples without modification. ### Testing the installation -If all goes well, after installation you should be able to render a sample document. Try creating a file `test.sil` with this content: +If all goes well, after installation you should be able to render a sample document. +Try creating a file `test.sil` with this content: ```sil \begin{document} @@ -305,7 +331,7 @@ First you make add `--tree ./` to install them in the current directory. In this case (and assuming this is the same directory as your document) SILE will automatically find such plugins. Additionally you make install them to your user profile by adding `--local` when installing. In this case you will also need to modify your user environment to check for plugins in that path since Lua does not do so by default. -This can be done by running `eval $(luarocks path)` before running SILE (or from your shell's initialization script). +This can be done by running `eval $(luarocks path)` before running SILE (or from your shell’s initialization script). ### Finding Lua version in use for running SILE @@ -322,7 +348,7 @@ $ luarocks install --lua-version $LUA_VERSION ... Please read the [full SILE manual][doc] for more information about what SILE is and how it can help you. There are example documents (source and PDF) [on the SILE website][examples]. -There's also an [FAQ][faq] available. +There’s also an [FAQ][faq] available. ## Contact @@ -333,32 +359,34 @@ For questions and discussion, please join the [mailing list][list-en]. SILE is distributed under the [MIT licence][license]. - [sile]: http://www.sile-typesetter.org/ - [releases]: https://github.com/sile-typesetter/sile/releases + [alerque-arch]: https://wiki.archlinux.org/index.php/Unofficial_user_repositories#alerque + [arch-sile]: https://archlinux.org/packages/extra/x86_64/sile/ + [aur]: https://wiki.archlinux.org/index.php/Arch_User_Repository [azure]: https://dev.azure.com/sile-typesetter/sile/_build?view=runs - [rockspec]: https://github.com/sile-typesetter/sile/blob/master/sile-dev-1.rockspec + [brew]: http://brew.sh + [brewfonts]: https://github.com/Homebrew/homebrew-cask-fonts + [copr]: https://copr.fedorainfracloud.org/coprs/jonny/SILE/ [doc]: http://sile-typesetter.org/manual/sile-latest.pdf + [examples]: http://www.sile-typesetter.org/examples/ + [faq]: https://github.com/sile-typesetter/sile/wiki/faq [gentium]: http://software.sil.org/gentium/download/ [github]: https://github.com/sile-typesetter/sile - [license]: http://choosealicense.com/licenses/mit/ - [faq]: https://github.com/sile-typesetter/sile/wiki/faq - [examples]: http://www.sile-typesetter.org/examples/ - [linuxbrew]: https://docs.brew.sh/Homebrew-on-Linux - [luarocks]: http://luarocks.org/en/Download + [hack]: https://sourcefoundry.org/hack/ [harfbuzz]: http://www.freedesktop.org/wiki/Software/HarfBuzz/ [icu]: http://icu-project.org - [libtexpdf]: https://github.com/sile-typesetter/libtexpdf - [arch-sile]: https://archlinux.org/packages/community/x86_64/sile/ - [aur]: https://wiki.archlinux.org/index.php/Arch_User_Repository - [typesetting]: https://en.wikipedia.org/wiki/Typesetting - [tex]: https://en.wikipedia.org/wiki/TeX [indesign]: https://en.wikipedia.org/wiki/Adobe_InDesign - [brew]: http://brew.sh - [brewfonts]: https://github.com/Homebrew/homebrew-cask-fonts + [libertinus]: https://github.com/alerque/libertinus + [libtexpdf]: https://github.com/sile-typesetter/libtexpdf + [license]: http://choosealicense.com/licenses/mit/ + [linuxbrew]: https://docs.brew.sh/Homebrew-on-Linux [list-en]: https://groups.google.com/d/forum/sile-users - [nix]: https://nixos.org/nix + [luarocks]: http://luarocks.org/en/Download [nix-flakes]: https://nixos.wiki/wiki/Flakes#Installing_flakes + [nix]: https://nixos.org/nix [ports]: http://ports.su/print/sile [ppa]: https://launchpad.net/~sile-typesetter/+archive/ubuntu/sile - [copr]: https://copr.fedorainfracloud.org/coprs/jonny/SILE/ - [alerque-arch]: https://wiki.archlinux.org/index.php/Unofficial_user_repositories#alerque + [releases]: https://github.com/sile-typesetter/sile/releases + [rockspec]: https://github.com/sile-typesetter/sile/blob/master/sile-dev-1.rockspec + [sile]: http://www.sile-typesetter.org/ + [tex]: https://en.wikipedia.org/wiki/TeX + [typesetting]: https://en.wikipedia.org/wiki/Typesetting diff --git a/action.yml b/action.yml index 6b80884ca..f2f0e8fea 100644 --- a/action.yml +++ b/action.yml @@ -7,7 +7,7 @@ inputs: default: "" runs: using: docker - image: docker://ghcr.io/sile-typesetter/sile:v0.14.13 + image: docker://ghcr.io/sile-typesetter/sile:v0.14.14 entrypoint: sh args: - -c diff --git a/build-aux/build.rs b/build-aux/build.rs index fdb215eb8..2f90b107f 100644 --- a/build-aux/build.rs +++ b/build-aux/build.rs @@ -1,17 +1,16 @@ -#[cfg(feature = "completions")] -use clap::CommandFactory; -#[cfg(feature = "completions")] -use clap_complete::generator::generate_to; -#[cfg(feature = "completions")] -use clap_complete::shells::{Bash, Elvish, Fish, PowerShell, Zsh}; #[cfg(feature = "manpage")] use clap_mangen::Man; -#[cfg(feature = "completions")] -use std::fs; #[cfg(any(feature = "static", feature = "completions"))] use std::path::Path; use std::{collections, env}; use vergen::EmitBuilder; +#[cfg(feature = "completions")] +use { + clap::CommandFactory, + clap_complete::generator::generate_to, + clap_complete::shells::{Bash, Elvish, Fish, PowerShell, Zsh}, + std::fs, +}; #[cfg(feature = "completions")] include!("../src/cli.rs"); diff --git a/build-aux/pkg.nix b/build-aux/pkg.nix index 2b53be20d..0be09f536 100644 --- a/build-aux/pkg.nix +++ b/build-aux/pkg.nix @@ -118,8 +118,6 @@ in stdenv.mkDerivation (finalAttrs: { postPatch = '' patchShebangs build-aux/*.sh build-aux/git-version-gen - '' + lib.optionalString stdenv.isDarwin '' - sed -i -e 's|@import AppKit;|#import |' src/macfonts.m ''; NIX_LDFLAGS = lib.optionalString stdenv.isDarwin "-framework AppKit"; @@ -140,15 +138,6 @@ in stdenv.mkDerivation (finalAttrs: { touch source/build-aux/rust_boilerplate.mk ''; - # remove forbidden references to $TMPDIR - preFixup = lib.optionalString stdenv.isLinux '' - for f in "$out"/bin/*; do - if isELF "$f"; then - patchelf --shrink-rpath --allowed-rpath-prefixes "$NIX_STORE" "$f" - fi - done - ''; - passthru = { # So it will be easier to inspect this environment, in comparison to others inherit luaEnv; diff --git a/build-aux/rust_boilerplate.mk.in b/build-aux/rust_boilerplate.mk.in index fc61df56d..fd139b466 100644 --- a/build-aux/rust_boilerplate.mk.in +++ b/build-aux/rust_boilerplate.mk.in @@ -57,7 +57,7 @@ $(_RUST_OUT) $(CARGO_BIN): $(@PACKAGE_VAR@_SOURCES) $(EXTRA_@PACKAGE_VAR@_SOURCE set -e export AUTOTOOLS_DEPENDENCIES="$^" $(CARGO_ENV) $(CARGO) build $(CARGO_VERBOSE) $(CARGO_FEATURE_ARGS) $(CARGO_RELEASE_ARGS) - $(CARGO_ENV) $(CARGO) build --quiet --message-format=json $(CARGO_FEATURE_ARGS) $(CARGO_RELEASE_ARGS) | + $(CARGO_ENV) $(CARGO) build --quiet --message-format=json $(CARGO_FEATURE_ARGS) $(CARGO_RELEASE_ARGS) | \ $(JQ) -sr 'map(select(.reason == "build-script-executed")) | last | .out_dir' > $(_RUST_OUT) RUST_DEVELOPER_TARGETS = cargo-test clippy rustfmt diff --git a/classes/base.lua b/classes/base.lua index 2356bb9ac..405ab3a52 100644 --- a/classes/base.lua +++ b/classes/base.lua @@ -80,11 +80,15 @@ end function class:setOptions (options) options = options or {} -- Classes that add options with dependencies should explicitly handle them, then exempt them from furthur processing. - -- The landscape option is handled explicitly before papersize, then the "rest" of options that are not interdependent. + -- The landscape and crop related options are handled explicitly before papersize, then the "rest" of options that are not interdependent. self.options.landscape = SU.boolean(options.landscape, false) options.landscape = nil self.options.papersize = options.papersize or "a4" options.papersize = nil + self.options.bleed = options.bleed or "0" + options.bleed = nil + self.options.sheetsize = options.sheetsize or nil + options.sheetsize = nil for option, value in pairs(options) do self.options[option] = value end @@ -127,6 +131,33 @@ function class:declareOptions () end return self.papersize end) + self:declareOption("sheetsize", function (_, size) + if size then + self.sheetsize = size + SILE.documentState.sheetSize = SILE.papersize(size, self.options.landscape) + if SILE.documentState.sheetSize[1] < SILE.documentState.paperSize[1] + or SILE.documentState.sheetSize[2] < SILE.documentState.paperSize[2] then + SU.error("Sheet size shall not be smaller than the paper size") + end + if SILE.documentState.sheetSize[1] < SILE.documentState.paperSize[1] + SILE.documentState.bleed then + SU.debug("frames", "Sheet size width augmented to take page bleed into account") + SILE.documentState.sheetSize[1] = SILE.documentState.paperSize[1] + SILE.documentState.bleed + end + if SILE.documentState.sheetSize[2] < SILE.documentState.paperSize[2] + SILE.documentState.bleed then + SU.debug("frames", "Sheet size height augmented to take page bleed into account") + SILE.documentState.sheetSize[2] = SILE.documentState.paperSize[2] + SILE.documentState.bleed + end + else + return self.sheetsize + end + end) + self:declareOption("bleed", function (_, dimen) + if dimen then + self.bleed = dimen + SILE.documentState.bleed = SU.cast("measurement", dimen):tonumber() + end + return self.bleed + end) end function class.declareSettings (_) @@ -353,10 +384,9 @@ function class:registerCommands () %s ]]):format(original, suggested)) end - if SU.hasContent(content) then - local result = SILE.processString(content[1], options.format or "lua", nil, packopts) + if SU.ast.hasContent(content) then _deprecated("\\script{...}", "\\lua{...}") - return result + return SILE.processString(content[1], options.format or "lua", nil, packopts) elseif options.src then local module = options.src:gsub("%/", ".") local original = (("\\script[src=%s]"):format(options.src)) @@ -372,8 +402,8 @@ function class:registerCommands () self:registerCommand("include", function (options, content) local packopts = packOptions(options) - if SU.hasContent(content) then - local doc = SU.contentToString(content) + if SU.ast.hasContent(content) then + local doc = SU.ast.contentToString(content) return SILE.processString(doc, options.format, nil, packopts) elseif options.src then return SILE.processFile(options.src, options.format, packopts) @@ -384,8 +414,8 @@ function class:registerCommands () self:registerCommand("lua", function (options, content) local packopts = packOptions(options) - if SU.hasContent(content) then - local doc = SU.contentToString(content) + if SU.ast.hasContent(content) then + local doc = SU.ast.contentToString(content) return SILE.processString(doc, "lua", nil, packopts) elseif options.src then return SILE.processFile(options.src, "lua", packopts) @@ -399,8 +429,8 @@ function class:registerCommands () self:registerCommand("sil", function (options, content) local packopts = packOptions(options) - if SU.hasContent(content) then - local doc = SU.contentToString(content) + if SU.ast.hasContent(content) then + local doc = SU.ast.contentToString(content) return SILE.processString(doc, "sil") elseif options.src then return SILE.processFile(options.src, "sil", packopts) @@ -411,8 +441,8 @@ function class:registerCommands () self:registerCommand("xml", function (options, content) local packopts = packOptions(options) - if SU.hasContent(content) then - local doc = SU.contentToString(content) + if SU.ast.hasContent(content) then + local doc = SU.ast.contentToString(content) return SILE.processString(doc, "xml", nil, packopts) elseif options.src then return SILE.processFile(options.src, "xml", packopts) @@ -424,7 +454,7 @@ function class:registerCommands () self:registerCommand("use", function (options, content) local packopts = packOptions(options) if content[1] and string.len(content[1]) > 0 then - local doc = SU.contentToString(content) + local doc = SU.ast.contentToString(content) SILE.processString(doc, "lua", nil, packopts) else if options.src then diff --git a/classes/book.lua b/classes/book.lua index 20a0290d2..44fe28710 100644 --- a/classes/book.lua +++ b/classes/book.lua @@ -105,7 +105,7 @@ function class:registerCommands () number = self.packages.counters:formatMultilevelCounter(self:getMultilevelCounter("sectioning")) end if SU.boolean(options.toc, true) then - SILE.call("tocentry", { level = level, number = number }, SU.subContent(content)) + SILE.call("tocentry", { level = level, number = number }, SU.ast.subContent(content)) end if SU.boolean(options.numbering, true) then if options.msg then diff --git a/configure.ac b/configure.ac index 51446e1d8..f8678bb48 100644 --- a/configure.ac +++ b/configure.ac @@ -36,6 +36,9 @@ AC_ARG_ENABLE([developer], [Check for and enable tooling required only for developers])) AM_CONDITIONAL([DEVELOPER], [test "x$enable_developer" = "xyes"]) +AM_CONDITIONAL([SHARED], [test "x$enable_shared" = "xyes"]) +AM_CONDITIONAL([STATIC], [test "x$enable_static" = "xyes"]) + AC_ARG_ENABLE([embeded], AS_HELP_STRING([--enable-embeded-resources], [Compile resources such as Lua module files directly into the Rust CLI binary])) @@ -214,6 +217,7 @@ AM_COND_IF([DEPENDENCY_CHECKS], [ AX_PROGVAR([luarocks]) AX_PROGVAR([nix]) AX_PROGVAR([perl]) + AX_PROGVAR([delta]) ]) ]) diff --git a/core/cli.lua b/core/cli.lua index 2226f9896..a6298164d 100644 --- a/core/cli.lua +++ b/core/cli.lua @@ -119,13 +119,13 @@ cli.parseArguments = function () for _, path in ipairs(opts.postamble) do table.insert(SILE.input.postambles, path) end - if opts.include then + if #opts.include > 0 then SU.deprecated("-I/--include", "-u/--use or -p/--preamble", "0.14.0", "0.15.0") end -- http://lua-users.org/wiki/VarargTheSecondClassCitizen local summary = function (...) local contentloc = SILE.traceStack:locationHead() - local codeloc = table.unpack({...}, 1, select('#', ...)) + local codeloc = pl.utils.unpack({...}, 1, select('#', ...)) return ("Processing at: %s\n\tUsing code at: %s"):format(contentloc, codeloc) end local unexpected = function () diff --git a/core/deprecations.lua b/core/deprecations.lua index 204baa9cc..8540753d8 100644 --- a/core/deprecations.lua +++ b/core/deprecations.lua @@ -30,7 +30,7 @@ SILE.fluent = setmetatable({}, { __call = function (_, ...) fluentglobal() SILE.fluent = fluent - return fluent(table.unpack({...}, 1, select("#", ...))) + return fluent(pl.utils.unpack({...}, 1, select("#", ...))) end, __index = function (_, key) fluentglobal() diff --git a/core/font.lua b/core/font.lua index eb822817a..10a059e41 100644 --- a/core/font.lua +++ b/core/font.lua @@ -3,7 +3,7 @@ local icu = require("justenoughicu") local lastshaper SILE.registerCommand("font", function (options, content) - if SU.hasContent(content) then SILE.settings:pushState() end + if SU.ast.hasContent(content) then SILE.settings:pushState() end if options.filename then SILE.settings:set("font.filename", options.filename) end if options.family then SILE.settings:set("font.family", options.family) @@ -49,7 +49,7 @@ SILE.registerCommand("font", function (options, content) -- that the post-load hook might want to do. SILE.font.cache(SILE.font.loadDefaults({}), SILE.shaper.getFace) - if SU.hasContent(content) then + if SU.ast.hasContent(content) then SILE.process(content) SILE.settings:popState() if SILE.shaper._name == "harfbuzzWithColor" and lastshaper then diff --git a/core/languages.lua b/core/languages.lua index fd084fdd1..180ff7104 100644 --- a/core/languages.lua +++ b/core/languages.lua @@ -81,7 +81,7 @@ SILE.registerCommand("ftl", function (options, content) fluent:set_locale(locale) if options.src then fluent:load_file(options.src, locale) - elseif SU.hasContent(content) then + elseif SU.ast.hasContent(content) then local input = content[1] fluent:add_messages(input, locale) end diff --git a/core/sile.lua b/core/sile.lua index 99e320727..211c53e78 100644 --- a/core/sile.lua +++ b/core/sile.lua @@ -6,6 +6,7 @@ SILE.features = require("core.features") -- Initialize Lua environment and global utilities SILE.lua_version = _VERSION:sub(-3) +-- luacheck: ignore jit SILE.lua_isjit = type(jit) == "table" SILE.full_version = string.format("SILE %s (%s)", SILE.version, SILE.lua_isjit and jit.version or _VERSION) @@ -144,10 +145,43 @@ SILE.init = function () runEvals(SILE.input.evaluates, "evaluate") end +local function suggest_luarocks (module) + local guessed_module_name = module:gsub(".*%.", "") .. ".sile" + return ([[ + + If the expected module is a 3rd party extension you may need to install it + using LuaRocks. The details of how to do this are highly dependent on + your system and preferred installation method, but as an example installing + a 3rd party SILE module to a project-local tree where might look like this: + + luarocks --lua-version %s --tree lua_modules install %s + + This will install the LuaRocks to your project, then you need to tell your + shell to pass along that info about available LuaRocks paths to SILE. This + only needs to be done once in each shell. + + eval $(luarocks --lua-version %s --tree lua_modules path) + + Thereafter running SILE again should work as expected: + + sile %s + + ]]):format( + SILE.lua_version, + guessed_module_name, + SILE.lua_version, + pl.stringx.join(" ", _G.arg) + ) +end + SILE.use = function (module, options) - local pack + local status, pack if type(module) == "string" then - pack = require(module) + status, pack = pcall(require, module) + if not status then + SU.error(("Unable to use '%s':\n%s%s") + :format(module, SILE.traceback and (" Lua ".. pack) or "", suggest_luarocks(module))) + end elseif type(module) == "table" then pack = module end diff --git a/core/utilities/ast.lua b/core/utilities/ast.lua new file mode 100644 index 000000000..b1c4e6d25 --- /dev/null +++ b/core/utilities/ast.lua @@ -0,0 +1,213 @@ +--- SILE AST utilities +-- +local ast = {} + +--- Find a command node in a SILE AST tree, +--- looking only at the first level. +--- (We're not reimplementing XPath here.) +---@param tree table AST tree +---@param command string command name +---@return table|nil AST command node +function ast.findInTree (tree, command) + for i=1, #tree do + if type(tree[i]) == "table" and tree[i].command == command then + return tree[i] + end + end +end + +--- Find and extract (remove) a command node in a SILE AST tree, +--- looking only at the first level. +---@param tree table AST tree +---@param command string command name +---@return table|nil AST command node +function ast.removeFromTree (tree, command) + for i=1, #tree do + if type(tree[i]) == "table" and tree[i].command == command then + return table.remove(tree, i) + end + end +end + +--- Create a command from a simple content tree. +--- It encapsulates the content in a command node. +---@param command string command name +---@param options table command options +---@param content table child AST tree +---@param position table position in source (or parent AST command node) +---@return table AST command node +function ast.createCommand (command, options, content, position) + local result = { content } + result.options = options or {} + result.command = command + result.id = "command" + if position then + result.col = position.col or 0 + result.lno = position.lno or 0 + result.pos = position.pos or 0 + else + result.col = 0 + result.lno = 0 + result.pos = 0 + end + return result +end + +--- Create a command from a structured content tree. +--- The content is normally a table of an already prepared content list. +---@param command string command name +---@param options table command options +---@param content table child AST tree +---@param position table position in source (or parent AST command node) +---@return table AST command node +function ast.createStructuredCommand (command, options, content, position) + local result = type(content) == "table" and content or { content } + result.options = options or {} + result.command = command + result.id = "command" + if position then + result.col = position.col or 0 + result.lno = position.lno or 0 + result.pos = position.pos or 0 + else + result.col = 0 + result.lno = 0 + result.pos = 0 + end + return result +end + +--- Extract the sub-content tree from a (command) node, +--- that is the child nodes of the (command) node. +---@param content table AST tree +---@return table AST tree +function ast.subContent (content) + local out = {} + for _, val in ipairs(content) do + out[#out+1] = val + end + return out +end + +-- String trimming +local function trimLeft (str) + return str:gsub("^%s*", "") +end +local function trimRight (str) + return str:gsub("%s*$", "") +end + +--- Content tree trimming: remove leading and trailing spaces, but from +--- a content tree i.e. possibly containing several elements. +---@param content table AST tree +---@return table AST tree +function ast.trimSubContent (content) + if #content == 0 then + return + end + if type(content[1]) == "string" then + content[1] = trimLeft(content[1]) + if content[1] == "" then + table.remove(content, 1) + end + end + if type(content[#content]) == "string" then + content[#content] = trimRight(content[#content]) + if content[#content] == "" then + table.remove(content, #content) + end + end + return content +end + +--- Process the AST walking through content nodes as a "structure": +--- Text nodes are ignored (e.g. usually just spaces due to indentation) +--- Command options are enriched with their "true" node position, so we can later +--- refer to it (as with an XPath pos()). +---@param content table AST tree +function ast.processAsStructure (content) + local iElem = 0 + local nElem = 0 + for i = 1, #content do + if type(content[i]) == "table" then + nElem = nElem + 1 + end + end + for i = 1, #content do + if type(content[i]) == "table" then + iElem = iElem + 1 + content[i].options._pos_ = iElem + content[i].options._last_ = iElem == nElem + SILE.process({ content[i] }) + end + -- All text nodes in ignored in structure tags. + end +end + +--- Call `action` on each content AST node, recursively, including `content` itself. +--- Not called on leaves, i.e. strings. +---@param content table AST tree +---@param action function function to call on each node +function ast.walkContent (content, action) + if type(content) ~= "table" then + return + end + action(content) + for i = 1, #content do + ast.walkContent(content[i], action) + end +end + +--- Strip position, line and column recursively from a content tree. +--- This can be used to remove position details where we do not want them, +--- e.g. in table of contents entries (referring to the original content, +--- regardless where it was exactly, for the purpose of checking whether +--- the table of contents changed.) +---@param content table AST tree +---@return table AST tree +function ast.stripContentPos (content) + if type(content) ~= "table" then + return content + end + local stripped = {} + for k, v in pairs(content) do + if type(v) == "table" then + v = ast.stripContentPos(v) + end + stripped[k] = v + end + if content.id or content.command then + stripped.pos, stripped.col, stripped.lno = nil, nil, nil + end + return stripped +end + +--- Flatten content trees into just the string components (allows passing +--- objects with complex structures to functions that need plain strings) +--- @param content table AST tree +--- @return string string representation of content +function ast.contentToString (content) + local string = "" + for i = 1, #content do + if type(content[i]) == "table" and type(content[i][1]) == "string" then + string = string .. content[i][1] + elseif type(content[i]) == "string" then + -- Work around PEG parser returning env tags as content + -- TODO: refactor capture groups in PEG parser + if content.command == content[i] and content[i] == content[i+1] then + break + end + string = string .. content[i] + end + end + return string +end + +--- Check whether a content AST tree is empty. +---@param content table AST tree +---@return boolean true if content is not empty +function ast.hasContent (content) + return type(content) == "function" or type(content) == "table" and #content > 0 +end + +return ast diff --git a/core/utilities.lua b/core/utilities/init.lua similarity index 88% rename from core/utilities.lua rename to core/utilities/init.lua index d6fa645e9..a8112a971 100644 --- a/core/utilities.lua +++ b/core/utilities/init.lua @@ -39,7 +39,7 @@ utilities.error = function (message, isbug) io.stderr:flush() SILE.outputter:finish() -- Only really useful from the REPL but no harm in trying SILE.scratch.caughterror = true - error(message, 2) + error("", 2) end utilities.warn = function (message, isbug) @@ -115,7 +115,7 @@ end utilities.debug = function (category, ...) if SILE.quiet then return end if utilities.debugging(category) then - local inputs = table.pack(...) + local inputs = pl.utils.pack(...) for i, input in ipairs(inputs) do if type(input) == "function" then local status, output = pcall(input) @@ -261,7 +261,7 @@ end utilities.compress = function (items) local rv = {} - local max = math.max(table.unpack(pl.tablex.keys(items))) + local max = math.max(pl.utils.unpack(pl.tablex.keys(items))) for i = 1, max do if items[i] then rv[#rv+1] = items[i] end end return rv end @@ -343,76 +343,6 @@ utilities.cast = function (wantedType, value) end end -utilities.hasContent = function(content) - return type(content) == "function" or type(content) == "table" and #content > 0 -end - --- Flatten content trees into just the string components (allows passing --- objects with complex structures to functions that need plain strings) -utilities.contentToString = function (content) - local string = "" - for i = 1, #content do - if type(content[i]) == "table" and type(content[i][1]) == "string" then - string = string .. content[i][1] - elseif type(content[i]) == "string" then - -- Work around PEG parser returning env tags as content - -- TODO: refactor capture groups in PEG parser - if content.command == content[i] and content[i] == content[i+1] then - break - end - string = string .. content[i] - end - end - return string -end - --- Strip the top level command off a content object and keep only the child --- items — assuming that the current command is taking care of itself -utilities.subContent = function (content) - local out = { id="stuff" } - for key, val in utilities.sortedpairs(content) do - if type(key) == "number" then - out[#out+1] = val - end - end - return out -end - --- Call `action` on each content AST node, recursively, including `content` itself. --- Not called on leaves, i.e. strings. -utilities.walkContent = function (content, action) - if type(content) ~= "table" then - return - end - action(content) - for i = 1, #content do - utilities.walkContent(content[i], action) - end -end - ---- Strip position, line and column recursively from a content tree. --- This can be used to remove position details where we do not want them, --- e.g. in table of contents entries (referring to the original content, --- regardless where it was exactly, for the purpose of checking whether --- the table of contents changed.) --- -utilities.stripContentPos = function (content) - if type(content) ~= "table" then - return content - end - local stripped = {} - for k, v in pairs(content) do - if type(v) == "table" then - v = SU.stripContentPos(v) - end - stripped[k] = v - end - if content.id or content.command then - stripped.pos, stripped.col, stripped.lno = nil, nil, nil - end - return stripped -end - utilities.rateBadness = function(inf_bad, shortfall, spring) if spring == 0 then return inf_bad end local bad = math.floor(100 * math.abs(shortfall / spring) ^ 3) @@ -626,8 +556,36 @@ utilities.breadcrumbs = function () return breadcrumbs end -utilities.formatNumber = require("core.utilities-numbers") +utilities.formatNumber = require("core.utilities.numbers") + +utilities.collatedSort = require("core.utilities.sorting") -utilities.collatedSort = require("core.utilities-sorting") +utilities.ast = require("core.utilities.ast") + +utilities.subContent = function (content) + SU.deprecated("SU.subContent", "SU.ast.subContent", "0.15.0", "0.17.0", [[ + Note that the new implementation no longer introduces an id="stuff" key.]]) + return utilities.ast.subContent(content) +end + +utilities.hasContent = function(content) + SU.deprecated("SU.hasContent", "SU.ast.hasContent", "0.15.0", "0.17.0") + return SU.ast.hasContent(content) +end + +utilities.contentToString = function (content) + SU.deprecated("SU.contentToString", "SU.ast.contentToString", "0.15.0", "0.17.0") + return SU.ast.contentToString(content) +end + +utilities.walkContent = function (content, action) + SU.deprecated("SU.walkContent", "SU.ast.walkContent", "0.15.0", "0.17.0") + SU.ast.walkContent(content, action) +end + +utilities.stripContentPos = function (content) + SU.deprecated("SU.stripContentPos", "SU.ast.stripContentPos", "0.15.0", "0.17.0") + return SU.ast.stripContentPos(content) +end return utilities diff --git a/core/utilities-numbers.lua b/core/utilities/numbers.lua similarity index 100% rename from core/utilities-numbers.lua rename to core/utilities/numbers.lua diff --git a/core/utilities-sorting.lua b/core/utilities/sorting.lua similarity index 100% rename from core/utilities-sorting.lua rename to core/utilities/sorting.lua diff --git a/documentation/c03-input.sil b/documentation/c03-input.sil index 3151e7f94..a8a42f390 100644 --- a/documentation/c03-input.sil +++ b/documentation/c03-input.sil @@ -69,6 +69,27 @@ The orientation of the page is defined as "portrait" by default, but if you want \begin[landscape=true]{document} \end{raw} +\subsection{Full bleed printing} + +When preparing a book for press printing, you may be asked by the professional printer to output the document on a larger sheet than your target paper, and to reserve a trim area around it. +This trick is often called “full bleed printing”. +Your document will be printed on an oversized sheet that will then be mechanically cut down to the target size. +You can specify the expected “trim” (or “bleed”) dimension, to be distributed evenly on all sides +of the document: + +\code{papersize=\em{}, bleed=\em{}}. + +For instance, a US trade book with an extra 0.125 inch bleed area can be specified by \code{papersize=6in x 9in, bleed=0.25in}. +The output paper size is then 6.25 per 9.25 inches, with the actual 6 per 9 inches inner content centered. + +Some packages, such as \autodoc:package{background} and \autodoc:package{cropmarks}, ensure their content extends over the trim area and thus indeed “bleeds” off the sides of the page, so that artifacts such as blank lines are avoided when the sheets are cut, would they be trimmed slightly differently for some assembling or technical reasons. + +Finally, there is also the case when the actual paper sheets available to you are larger than your target paper size, and yet you would want the output document to show properly centered: + +\code{papersize=\em{}, sheetsize=\em{}}. + +For instance, \code{papersize=6in x 9in, sheetsize=a4} produces an A4-dimensioned document, but with you content formatted as a 6 per 9 inches US trade book. You may, obviously, combine these options and also specify a bleed area. + \section{Ordinary text} On the whole, ordinary text isn’t particularly interesting—it’s just typeset. diff --git a/documentation/c05-packages.sil b/documentation/c05-packages.sil index b3f6089a4..df4c4037c 100644 --- a/documentation/c05-packages.sil +++ b/documentation/c05-packages.sil @@ -274,6 +274,10 @@ This section introduces packages that could not fit in another category. \status:low \package-documentation{ifattop} +\subsection{retrograde} +\status:high +\package-documentation{retrograde} + \section{Frames and page layouts} As we mentioned in the first chapter, SILE uses frames as an indication of where to put text onto diff --git a/documentation/c07-settings.sil b/documentation/c07-settings.sil index 78775ad64..9e19b6432 100644 --- a/documentation/c07-settings.sil +++ b/documentation/c07-settings.sil @@ -185,6 +185,10 @@ true value) and also \em{unset} the setting \autodoc:setting{document.spaceskip} unset it, just call \autodoc:command{\set} with no \autodoc:parameter{value} parameter: \autodoc:command{\set[parameter=document.spaceskip]}. +Note that non-breaking spaces (U+00A0), following the guidelines of Unicode Annex 14 (UAX 14), are treated by default as stretchable or shrinkable akin to regular inter-word spaces, contributing to text justification and alignment for consistent layout. + +If you want to disable this behavior, the \autodoc:setting{languages.fixedNbsp} setting may be set to \code{true} to enforce fixed-width non-breaking spaces. + \subsection{Letter spacing settings} You can also put spaces in between \em{letters} with the \autodoc:setting{document.letterspaceglue} setting. diff --git a/documentation/c08-language.sil b/documentation/c08-language.sil index bf42557d0..0b40c6b3b 100644 --- a/documentation/c08-language.sil +++ b/documentation/c08-language.sil @@ -93,6 +93,18 @@ The command \autodoc:command{\nohyphenation{…}} is provided as a shortcut for The hyphenator uses the same algorithm as TeX and can use TeX hyphenation pattern files if they are converted to Lua format. To implement hyphenation for a new language, first check to see if TeX hyphenation dictionaries are available; if not, work through the resources at \url{http://tug.org/docs/liang/}. +\em{Note on Unicode soft hyphens} — By default, soft hyphens (U+00AD) are interpreted as discretionary breaks, allowing line-breaking at that point (using the current font’s hyphen character). + +However, issues may arise when soft hyphens are used in ligatures, causing breaks between constituent characters and disrupting the ligature’s integrity. +Rather than relying on soft hyphens, for instances requiring hyphenation in unknown words, consider adding an exception to the hyphenation rules instead, with \autodoc:command{\hyphenator:add-exceptions{}} (where the text is a lowercase representation of the word, with dashes where hyphenation is allowed). + +Moreover, typists sometimes manually insert soft hyphens to rectify line-breaking issues in other typesetting systems. +In SILE, leveraging language-specific hyphenation rules tends to be more reliable. +Setting \autodoc:setting{typesetter.softHyphen} to \code{false} ignores soft hyphens entirely in the text, alleviating potential issues arising from their manual insertion. + +Soft hyphens can be inadvertently inserted by text editors or software, remaining invisible in the source text and causing unexpected output. +Setting \autodoc:setting{typesetter.softHyphenWarning} to \code{true} triggers warnings upon encountering soft hyphens, aiding users in identifying and rectifying such instances, regardless of the previous setting. + \section{Localization} A small handful of strings may be programmatically added to documents depending on language, context, and options. diff --git a/documentation/c10-classdesign.sil b/documentation/c10-classdesign.sil index 2a45581c0..e76514128 100644 --- a/documentation/c10-classdesign.sil +++ b/documentation/c10-classdesign.sil @@ -458,7 +458,7 @@ self:registerCommand("tocentry", function (options, content) SILE.call("info", { category = "toc", value = { - label = SU.stripContentPos(content), level = (options.level or 1) + label = SU.ast.stripContentPos(content), level = (options.level or 1) } }) end) diff --git a/documentation/c12-xmlproc.sil b/documentation/c12-xmlproc.sil index 4fc557dc3..409d58bea 100644 --- a/documentation/c12-xmlproc.sil +++ b/documentation/c12-xmlproc.sil @@ -69,10 +69,10 @@ self:registerCommand("example", function(options,content) \code{\\docbook-titling} is a command similarly defined in \code{docbook.sil} which sets the default font for titling and headers. Once again, if someone wants to customize the look of the output we make it easier for them by giving them simple, compartmentalized commands to override. So far so good, but how do we extract the \code{} tag from the \code{content} abstract syntax tree? -SILE does not provide XPath or CSS-style selectors to locate content form within the DOM tree;\footnote{Patches, as they say, are welcome.} instead there is a simple one-level function called \code{SILE.inputter:findInTree()} which looks for a particular tag or command name within the immediate children of the current tree: +SILE does not provide XPath or CSS-style selectors to locate content form within the DOM tree;\footnote{Patches, as they say, are welcome.} instead there is a simple one-level function called \code{SU.ast.findInTree()} which looks for a particular tag or command name within the immediate children of the current tree: \begin[type=autodoc:codeblock]{raw} - local t = SILE.inputter:findInTree(content, "title") + local t = SU.ast.findInTree(content, "title") if t then SILE.typesetter:typeset(": ") SILE.process(t) @@ -149,7 +149,7 @@ We also increment the count at the current level, while at the same time wiping Now we find the title, and prefix it by the concatenation of all the \code{seccount}s: \begin[type=autodoc:codeblock]{raw} - local title = SILE.inputter:findInTree(content, "title") + local title = SU.ast.findInTree(content, "title") local number = table.concat(SILE.scratch.docbook.seccount, '.') if title then SILE.call("docbook-section-"..SILE.scratch.docbook.seclevel.."-title",{},function() diff --git a/flake.nix b/flake.nix index 756e3dbc4..fe1ceaf0c 100644 --- a/flake.nix +++ b/flake.nix @@ -80,6 +80,8 @@ configureFlags = sile.configureFlags ++ [ "--enable-developer" ]; nativeBuildInputs = sile.nativeBuildInputs ++ [ pkgs.luarocks + # For regression test diff highlighting + pkgs.delta # For commitlint git hook pkgs.yarn # For npx diff --git a/hooks/build b/hooks/build index 609df1bc8..065a6024b 100755 --- a/hooks/build +++ b/hooks/build @@ -7,7 +7,7 @@ REVISION=$(git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g') RUNTIME_DEPS='fontconfig freetype2 gentium-plus-font glibc harfbuzz icu libpng luajit zlib'\ ' libertinus-font luarocks noto-fonts-cjk ttf-hack' -BUILD_DEPS='cargo git jq poppler' +BUILD_DEPS='cargo git jq lua51 poppler' : "${DOCKER_BUILDKIT:=1}" export DOCKER_BUILDKIT diff --git a/inputters/base.lua b/inputters/base.lua index d19c9f206..a72d86c38 100644 --- a/inputters/base.lua +++ b/inputters/base.lua @@ -49,13 +49,9 @@ function inputter:process (doc) return SILE.process(tree) end --- Just a simple one-level find. We're not reimplementing XPath here. function inputter.findInTree (_, tree, command) - for i=1, #tree do - if type(tree[i]) == "table" and tree[i].command == command then - return tree[i] - end - end + SU.deprecated("SILE.inputter:findInTree", "SU.ast.findInTree", "0.15.0", "0.17.0") + return SU.ast.findInTree(tree, command) end local function process_ambles (ambles) diff --git a/inputters/xml.lua b/inputters/xml.lua index 3c019b934..b448bf7da 100644 --- a/inputters/xml.lua +++ b/inputters/xml.lua @@ -8,8 +8,10 @@ inputter.order = 2 local function startcommand (parser, command, options) local stack = parser:getcallbacks().stack - local lno, col, _ = parser:pos() - local element = { command = command, options = options, lno = lno, col = col } + local lno, col, pos = parser:pos() + local position = { lno = lno, col = col, pos = pos } + -- create an empty command which content will be filled on closing tag + local element = SU.ast.createCommand(command, options, nil, position) table.insert(stack, element) end @@ -33,12 +35,13 @@ local function text (parser, msg) end local function parse (doc) - local content = { StartElement = startcommand, - EndElement = endcommand, - CharacterData = text, - _nonstrict = true, - stack = {{}} - } + local content = { + StartElement = startcommand, + EndElement = endcommand, + CharacterData = text, + _nonstrict = true, + stack = {{}} + } local parser = lxp.new(content) local status, err if type(doc) == "string" then @@ -80,7 +83,7 @@ function inputter.parse (_, doc) -- it doesn't look like a native SILE one already. local rootelement = tree.command if rootelement ~= "sile" and rootelement ~= "document" then - tree = { tree, command = "document" } + tree = SU.ast.createCommand("document", {}, tree) end return { tree } end diff --git a/justenough/macfonts.m b/justenough/macfonts.m index d63850d47..0596a144f 100644 --- a/justenough/macfonts.m +++ b/justenough/macfonts.m @@ -1,4 +1,5 @@ -@import AppKit; +#import <AppKit/AppKit.h> + #include <stdio.h> #include <lua.h> #include <lauxlib.h> diff --git a/languages/fr.lua b/languages/fr.lua index b707a1bce..9603916fa 100644 --- a/languages/fr.lua +++ b/languages/fr.lua @@ -175,7 +175,7 @@ function SILE.nodeMakers.fr:mustRemove (i, items) -- Clear "manual" spaces we do not want, so that later we only have to -- insert the relevant kerns. local curr = items[i].text - if self:isSpace(curr) then + if self:isSpace(curr) or self:isNonBreakingSpace(curr) then if i < #items then local next = items[i+1].text if self:isSpace(next) diff --git a/languages/unicode.lua b/languages/unicode.lua index bf3ee26d3..8df26f646 100644 --- a/languages/unicode.lua +++ b/languages/unicode.lua @@ -2,6 +2,13 @@ local icu = require("justenoughicu") local chardata = require("char-def") +SILE.settings:declare({ + parameter = "languages.fixedNbsp", + type = "boolean", + default = false, + help = "Whether to treat U+00A0 (NO-BREAK SPACE) as a fixed-width space" +}) + SILE.nodeMakers.base = pl.class({ _init = function (self, options) @@ -43,6 +50,14 @@ SILE.nodeMakers.base = pl.class({ self.lastnode = "penalty" end, + makeNonBreakingSpace = function (self) + -- Unicode Line Breaking Algorithm (UAX 14) specifies that U+00A0 + -- (NO-BREAK SPACE) is expanded or compressed like a normal space. + coroutine.yield(SILE.nodefactory.kern(SILE.shaper:measureSpace(self.options))) + self.lastnode = "glue" + self.lasttype = "sp" + end, + iterator = function (_, _) SU.error("Abstract function nodemaker:iterator called", true) end, @@ -61,6 +76,15 @@ SILE.nodeMakers.base = pl.class({ return self.isSpaceType[self:charData(char).linebreak] end, + isNonBreakingSpace = function (self, char) + local c = self:charData(char) + return c.contextname and c.contextname == "nobreakspace" + end, + + isActiveNonBreakingSpace = function (self, char) + return self:isNonBreakingSpace(char) and not SILE.settings:get("languages.fixedNbsp") + end, + isBreaking = function (self, char) return self.isBreakingType[self:charData(char).linebreak] end, @@ -85,6 +109,9 @@ function SILE.nodeMakers.unicode:dealWith (item) if self:isSpace(item.text) then self:makeToken() self:makeGlue(item) + elseif self:isActiveNonBreakingSpace(item.text) then + self:makeToken() + self:makeNonBreakingSpace() elseif self:isBreaking(item.text) then self:addToken(char, item) self:makeToken() @@ -152,7 +179,11 @@ function SILE.nodeMakers.unicode:handleWordBreak (item) if self:isSpace(item.text) then -- Spacing word break self:makeGlue(item) - else -- a word break which isn't a space + elseif self:isActiveNonBreakingSpace(item.text) then + -- Non-breaking space word break + self:makeNonBreakingSpace() + else + -- a word break which isn't a space self:addToken(item.text, item) end end @@ -161,7 +192,7 @@ function SILE.nodeMakers.unicode:handleLineBreak (item, subtype) -- Because we are in charge of paragraphing, we -- will override space-type line breaks, and treat -- them just as ordinary word spaces. - if self:isSpace(item.text) then + if self:isSpace(item.text) or self:isActiveNonBreakingSpace(item.text) then self:handleWordBreak(item) return end diff --git a/outputters/base.lua b/outputters/base.lua index a5ce0aacd..4888a0605 100644 --- a/outputters/base.lua +++ b/outputters/base.lua @@ -34,6 +34,16 @@ function outputter.debugFrame (_, _, _) end function outputter.debugHbox (_, _, _) end +function outputter.linkAnchor (_, _, _) end -- Unstable API + +function outputter.enterLinkTarget (_, _, _) end -- Unstable API + +function outputter.leaveLinkTarget (_, _, _, _, _, _, _) end -- Unstable API + +function outputter.setMetadata (_, _, _) end + +function outputter.setBookmark (_, _, _) end + function outputter:getOutputFilename () local fname if SILE.outputFilename then diff --git a/outputters/debug.lua b/outputters/debug.lua index 9cfe3e3bd..472de5ecc 100644 --- a/outputters/debug.lua +++ b/outputters/debug.lua @@ -44,7 +44,7 @@ end function outputter:_writeline (...) self:_ensureInit() - local args = table.pack(...) + local args = pl.utils.pack(...) for i = 1, #args do outfile:write(args[i]) if i < #args then outfile:write("\t") end diff --git a/outputters/libtexpdf.lua b/outputters/libtexpdf.lua index 9e6ab8e03..7750c135a 100644 --- a/outputters/libtexpdf.lua +++ b/outputters/libtexpdf.lua @@ -22,14 +22,36 @@ local outputter = pl.class(base) outputter._name = "libtexpdf" outputter.extension = "pdf" +-- N.B. Sometimes setCoord is called before the outputter has ensured initialization. +-- This ok for coordinates manipulation, at these points we know the page size. +local deltaX +local deltaY +local function trueXCoord (x) + if not deltaX then + local sheetSize = SILE.documentState.sheetSize or SILE.documentState.paperSize + deltaX = (sheetSize[1] - SILE.documentState.paperSize[1]) / 2 + end + return x + deltaX +end +local function trueYCoord (y) + if not deltaY then + local sheetSize = SILE.documentState.sheetSize or SILE.documentState.paperSize + deltaY = (sheetSize[2] - SILE.documentState.paperSize[2]) / 2 + end + return y + deltaY +end + -- The outputter init can't actually initialize output (as logical as it might -- have seemed) because that requires a page size which we don't know yet. -- function outputter:_init () end function outputter:_ensureInit () if not started then - local w, h = SILE.documentState.paperSize[1], SILE.documentState.paperSize[2] + local sheetSize = SILE.documentState.sheetSize or SILE.documentState.paperSize + local w, h = sheetSize[1], sheetSize[2] local fname = self:getOutputFilename() + -- Ideally we could want to set the PDF CropBox, BleedBox, TrimBox... + -- Our wrapper only manages the MediaBox at this point. pdf.init(fname == "-" and "/dev/stdout" or fname, w, h, SILE.full_version) pdf.beginpage() started = true @@ -90,7 +112,7 @@ function outputter:_drawString (str, width, x_offset, y_offset) local x, y = self:getCursor() pdf.colorpush_rgb(0,0,0) pdf.colorpop() - pdf.setstring(x+x_offset, y+y_offset, str, string.len(str), _font, width) + pdf.setstring(trueXCoord(x+x_offset), trueYCoord(y+y_offset), str, string.len(str), _font, width) end function outputter:drawHbox (value, width) @@ -157,7 +179,7 @@ function outputter:drawImage (src, x, y, width, height, pageno) width = SU.cast("number", width) height = SU.cast("number", height) self:_ensureInit() - pdf.drawimage(src, x, y, width, height, pageno or 1) + pdf.drawimage(src, trueXCoord(x), trueYCoord(y), width, height, pageno or 1) end function outputter:getImageSize (src, pageno) @@ -174,8 +196,9 @@ function outputter:drawSVG (figure, x, y, _, height, scalefactor) pdf.add_content("q") self:setCursor(x, y) x, y = self:getCursor() - local newy = y - SILE.documentState.paperSize[2] + height - pdf.add_content(table.concat({ scalefactor, 0, 0, -scalefactor, x, newy, "cm" }, " ")) + local sheetSize = SILE.documentState.sheetSize or SILE.documentState.paperSize + local newy = y - SILE.documentState.paperSize[2] / 2 + height - sheetSize[2] / 2 + pdf.add_content(table.concat({ scalefactor, 0, 0, -scalefactor, trueXCoord(x), newy, "cm" }, " ")) pdf.add_content(figure) pdf.add_content("Q") end @@ -187,7 +210,7 @@ function outputter:drawRule (x, y, width, height) height = SU.cast("number", height) self:_ensureInit() local paperY = SILE.documentState.paperSize[2] - pdf.setrule(x, paperY - y - height, width, height) + pdf.setrule(trueXCoord(x), trueYCoord(paperY - y - height), width, height) end function outputter:debugFrame (frame) @@ -228,4 +251,139 @@ function outputter:debugHbox (hbox, scaledWidth) self:popColor() end +-- The methods below are only implemented on outputters supporting these features. +-- In PDF, it relies on transformation matrices, but other backends may call +-- for a different strategy. +-- ! The API is unstable and subject to change. ! + +function outputter:scaleFn (xorigin, yorigin, xratio, yratio, callback) + xorigin = SU.cast("number", xorigin) + yorigin = SU.cast("number", yorigin) + local x0 = trueXCoord(xorigin) + local y0 = -trueYCoord(yorigin) + self:_ensureInit() + pdf:gsave() + pdf.setmatrix(1, 0, 0, 1, x0, y0) + pdf.setmatrix(xratio, 0, 0, yratio, 0, 0) + pdf.setmatrix(1, 0, 0, 1, -x0, -y0) + callback() + pdf:grestore() +end + +function outputter:rotateFn (xorigin, yorigin, theta, callback) + xorigin = SU.cast("number", xorigin) + yorigin = SU.cast("number", yorigin) + local x0 = trueXCoord(xorigin) + local y0 = -trueYCoord(yorigin) + self:_ensureInit() + pdf:gsave() + pdf.setmatrix(1, 0, 0, 1, x0, y0) + pdf.setmatrix(math.cos(theta), math.sin(theta), -math.sin(theta), math.cos(theta), 0, 0) + pdf.setmatrix(1, 0, 0, 1, -x0, -y0) + callback() + pdf:grestore() +end + +-- Other rotation unstable APIs + +function outputter:enterFrameRotate (xa, xb, y, theta) -- Unstable API see rotate package + xa = SU.cast("number", xa) + xb = SU.cast("number", xb) + y = SU.cast("number", y) + -- Keep center point the same? + local cx0 = trueXCoord(xa) + local cx1 = trueXCoord(xb) + local cy = -trueYCoord(y) + self:_ensureInit() + pdf:gsave() + pdf.setmatrix(1, 0, 0, 1, cx1, cy) + pdf.setmatrix(math.cos(theta), math.sin(theta), -math.sin(theta), math.cos(theta), 0, 0) + pdf.setmatrix(1, 0, 0, 1, -cx0, -cy) +end + +function outputter.leaveFrameRotate (_) + pdf:grestore() +end + +-- Unstable link APIs + +function outputter:linkAnchor (x, y, name) + x = SU.cast("number", x) + y = SU.cast("number", y) + self:_ensureInit() + pdf.destination(name, trueXCoord(x), trueYCoord(y)) +end + +local function borderColor (color) + if color then + if color.r then return "/C [" .. color.r .. " " .. color.g .. " " .. color.b .. "]" end + if color.c then return "/C [" .. color.c .. " " .. color.m .. " " .. color.y .. " " .. color.k .. "]" end + if color.l then return "/C [" .. color.l .. "]" end + end + return "" +end +local function borderStyle (style, width) + if style == "underline" then return "/BS<</Type/Border/S/U/W " .. width .. ">>" end + if style == "dashed" then return "/BS<</Type/Border/S/D/D[3 2]/W " .. width .. ">>" end + return "/Border[0 0 " .. width .. "]" +end + +function outputter:enterLinkTarget (_, _) -- destination, options as argument + -- HACK: + -- Looking at the code, pdf.begin_annotation does nothing, and Simon wrote a comment + -- about tracking boxes. Unsure what he implied with this obscure statement. + -- Sure thing is that some backends may need the destination here, e.g. an HTML backend + -- would generate a <a href="#destination">, as well as the options possibly for styling + -- on the link opening? + self:_ensureInit() + pdf.begin_annotation() +end +function outputter.leaveLinkTarget (_, x0, y0, x1, y1, dest, opts) + local bordercolor = borderColor(opts.bordercolor) + local borderwidth = SU.cast("integer", opts.borderwidth) + local borderstyle = borderStyle(opts.borderstyle, borderwidth) + local target = opts.external and "/Type/Action/S/URI/URI" or "/S/GoTo/D" + local d = "<</Type/Annot/Subtype/Link" .. borderstyle .. bordercolor .. "/A<<" .. target .. "(" .. dest .. ")>>>>" + pdf.end_annotation(d, + trueXCoord(x0) , trueYCoord(y0 - opts.borderoffset), + trueXCoord(x1), trueYCoord(y1 + opts.borderoffset)) +end + +-- Bookmarks and metadata + +local function validate_date (date) + return string.match(date, [[^D:%d+%s*-%s*%d%d%s*'%s*%d%d%s*'?$]]) ~= nil +end + +function outputter:setMetadata (key, value) + if key == "Trapped" then + SU.warn("Skipping special metadata key \\Trapped") + return + end + + if key == "ModDate" or key == "CreationDate" then + if not validate_date(value) then + SU.warn("Invalid date: " .. value) + return + end + else + -- see comment in on bookmark + value = SU.utf8_to_utf16be(value) + end + self:_ensureInit() + pdf.metadata(key, value) +end + +function outputter:setBookmark (dest, title, level) + -- Added UTF8 to UTF16-BE conversion + -- For annotations and bookmarks, text strings must be encoded using + -- either PDFDocEncoding or UTF16-BE with a leading byte-order marker. + -- As PDFDocEncoding supports only limited character repertoire for + -- European languages, we use UTF-16BE for internationalization. + local ustr = SU.utf8_to_utf16be_hexencoded(title) + local d = "<</Title<" .. ustr .. ">/A<</S/GoTo/D(" .. dest .. ")>>>>" + self:_ensureInit() + pdf.bookmark(d, level) +end + return outputter diff --git a/outputters/text.lua b/outputters/text.lua index 661635c0e..38fff3ed0 100644 --- a/outputters/text.lua +++ b/outputters/text.lua @@ -23,7 +23,7 @@ end function outputter:_writeline (...) self:_ensureInit() - local args = table.pack(...) + local args = pl.utils.pack(...) for i=1, #args do outfile:write(args[i]) end diff --git a/package.json b/package.json index 043deba9a..0904e5c60 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sile", - "version": "0.14.13", + "version": "0.14.14", "description": "The SILE Typesetter", "main": "sile", "scripts": { @@ -19,9 +19,9 @@ }, "homepage": "https://sile-typesetter.org", "devDependencies": { - "@commitlint/cli": "^17.7", - "@commitlint/config-conventional": "^17.7", - "@commitlint/prompt": "^17.7", + "@commitlint/cli": "^18.4", + "@commitlint/config-conventional": "^18.1", + "@commitlint/prompt": "^17.6", "commitizen": "^4.3", "conventional-changelog-cli": "^4.1", "husky": "^8.0", diff --git a/packages/autodoc/init.lua b/packages/autodoc/init.lua index 167bba5f2..d93115953 100644 --- a/packages/autodoc/init.lua +++ b/packages/autodoc/init.lua @@ -126,7 +126,7 @@ end function package:registerRawHandlers () self:registerRawHandler("autodoc:codeblock", function(options, content) - SILE.call("autodoc:codeblock", options, { content[1] }) -- Still issues with SU.contentToString() witb raw content + SILE.call("autodoc:codeblock", options, { content[1] }) -- Still issues with SU.ast.contentToString() witb raw content end) end diff --git a/packages/background/init.lua b/packages/background/init.lua index 02e2fbd6a..10e7a7117 100644 --- a/packages/background/init.lua +++ b/packages/background/init.lua @@ -3,48 +3,77 @@ local base = require("packages.base") local package = pl.class(base) package._name = "background" -local outputBackground = function (color) - local page = SILE.getFrame("page") - local backgroundColor = SILE.color(color) - SILE.outputter:pushColor(backgroundColor) - SILE.outputter:drawRule(page:left(), page:top(), page:right(), page:bottom()) - SILE.outputter:popColor() +local background = {} + +local outputBackground = function () + local pagea = SILE.getFrame("page") + local offset = SILE.documentState.bleed / 2 + if type(background.bg) == "string" then + SILE.outputter:drawImage(background.bg, + pagea:left() - offset, pagea:top() - offset, + pagea:width() + 2 * offset, pagea:height() + 2 * offset) + elseif background.bg then + SILE.outputter:pushColor(background.bg) + SILE.outputter:drawRule( + pagea:left() - offset, pagea:top() - offset, + pagea:width() + 2 * offset, pagea:height() + 2 * offset) + SILE.outputter:popColor() + end + if not background.allpages then + background.bg = nil + end end function package:_init () base._init(self) - self:loadPackage("color") + self.class:registerHook("newpage", outputBackground) end function package:registerCommands () self:registerCommand("background", function (options, _) - options.color = options.color or "white" - options.allpages = options.allpages or true - outputBackground(options.color) - if options.allpages and options.allpages ~= "false" then - local oldNewPage = SILE.documentState.documentClass.newPage - SILE.documentState.documentClass.newPage = function (self_) - local page = oldNewPage(self_) - outputBackground(options.color) - return page - end + if SU.boolean(options.disable, false) then + -- This option is certainly better than enforcing a white color. + background.bg = nil + return + end + + local allpages = SU.boolean(options.allpages, true) + background.allpages = allpages + local color = options.color and SILE.color(options.color) + local src = options.src + if src then + background.bg = src and SILE.resolveFile(src) or SU.error("Couldn't find file "..src) + elseif color then + background.bg = color + else + SU.error("background requires a color or an image src parameter") end - end, "Draws a solid background color <color> on pages after initialization.") + outputBackground(SILE.scratch.background) + end, "Output a solid background color <color> or an image <src> on pages after initialization.") end package.documentation = [[ \begin{document} \use[module=packages.background] -The \autodoc:package{background} package allows you to set the color of the canvas background (by drawing a solid color block the full size of the page on page initialization). -The package provides a \autodoc:command{\background} command which requires at least one parameter, \autodoc:parameter{color=<color specification>}, and sets the background of the current and all following pages to that color. -If you want to set only the current page background different from the default, use the parameter \autodoc:parameter{allpages=false}. -The color specification in the same as specified in the \autodoc:package{color} package. +As its name implies, the \autodoc:package{background} package allows you to set the color of the page canvas background or to use a background image extending to the full page width and height. + +The package provides a \autodoc:command{\background} command which requires one of the following parameters: +\begin{itemize} +\item{\autodoc:parameter{color=<color specification>} sets the background of the current and all following pages to that color. The color specification has the same syntax as specified in the \autodoc:package{color} package.} +\item{\autodoc:parameter{src=<file>} sets the backgound of the current and all following pages to the specified image. The latter will be scaled to the target dimension.} +\end{itemize} + +The background extends to the page trim area (“page bleed”) if the latter is defined. +This is to ensure that it indeed “bleeds” off the sides of the page, so as to avoid thin white lignes on an otherwise full color page when the paper sheet is cut to dimension but some pages are trimmed slightly more than others. +If setting only the current page background different from the default is desired, an extra parameter \autodoc:parameter{allpages=false} can be passed. \background[color=#e9d8ba,allpages=false] So, for example, \autodoc:command{\background[color=#e9d8ba,allpages=false]} will set a sepia tone background on the current page. +The \autodoc:parameter{disable=true} parameter allows disabling the background on the following pages. +It may be useful when \autodoc:parameter{allpages} is active from a previous invocation. \end{document} ]] diff --git a/packages/balanced-frames/init.lua b/packages/balanced-frames/init.lua index 644c1a175..1c3d10492 100644 --- a/packages/balanced-frames/init.lua +++ b/packages/balanced-frames/init.lua @@ -72,8 +72,8 @@ local function buildPage (typesetter, independent) return true end -function package:_init (class) - base._init(self, class) +function package:_init (options) + base._init(self, options) self.class:registerPostinit(function(_) if not unbalanced_buildPage then unbalanced_buildPage = SILE.typesetter.buildPage diff --git a/packages/base.lua b/packages/base.lua index ae1534b92..4b86d30cf 100644 --- a/packages/base.lua +++ b/packages/base.lua @@ -102,7 +102,7 @@ function package:deprecatedExport (name, func, noclass, notable) SU.deprecated(("class.%s"):format(name), ("class.packages.%s:%s"):format(self._name, name), "0.14.0", "0.16.0", _deprecate_class_funcs) - return func(table.unpack(inputs, 1, select("#", ...) + 1)) + return func(pl.utils.unpack(inputs, 1, select("#", ...) + 1)) end end @@ -115,7 +115,7 @@ function package:deprecatedExport (name, func, noclass, notable) SU.deprecated(("require('packages.%s').exports.%s"):format(self._name, name), ("class.packages.%s:%s"):format(self._name, name), "0.14.0", "0.16.0", _deprecate_exports_table) - return func(table.unpack(inputs, 1, select("#", ...) + 1)) + return func(pl.utils.unpack(inputs, 1, select("#", ...) + 1)) end end diff --git a/packages/bibtex/bibliography.lua b/packages/bibtex/bibliography.lua index 2c4b5340d..b55104d63 100644 --- a/packages/bibtex/bibliography.lua +++ b/packages/bibtex/bibliography.lua @@ -1,4 +1,5 @@ -- luacheck: globals setfenv getfenv +-- luacheck: ignore _ENV -- The following functions borrowed from Norman Ramsey's nbibtex, -- with permission. diff --git a/packages/bibtex/init.lua b/packages/bibtex/init.lua index d4b77a6b5..33829d330 100644 --- a/packages/bibtex/init.lua +++ b/packages/bibtex/init.lua @@ -84,7 +84,7 @@ function package:registerCommands () end) self:registerCommand("cite", function (options, content) - if not options.key then options.key = SU.contentToString(content) end + if not options.key then options.key = SU.ast.contentToString(content) end local style = SILE.settings:get("bibtex.style") local bibstyle = require("packages.bibtex.styles." .. style) local cite = Bibliography.produceCitation(options, SILE.scratch.bibtex.bib, bibstyle) @@ -96,7 +96,7 @@ function package:registerCommands () end) self:registerCommand("reference", function (options, content) - if not options.key then options.key = SU.contentToString(content) end + if not options.key then options.key = SU.ast.contentToString(content) end local style = SILE.settings:get("bibtex.style") local bibstyle = require("packages.bibtex.styles." .. style) local cite, err = Bibliography.produceReference(options, SILE.scratch.bibtex.bib, bibstyle) diff --git a/packages/boustrophedon/init.lua b/packages/boustrophedon/init.lua index ce81f8fd1..c77dfbfbd 100644 --- a/packages/boustrophedon/init.lua +++ b/packages/boustrophedon/init.lua @@ -3,8 +3,8 @@ local base = require("packages.base") local package = pl.class(base) package._name = "boustrophedon" -function package:_init (class) - base._init(self, class) +function package:_init (options) + base._init(self, options) SILE.hyphenator.languages.grc = { patterns={} } SILE.nodeMakers.grc = pl.class(SILE.nodeMakers.unicode) function SILE.nodeMakers.grc.iterator (node, items) diff --git a/packages/cropmarks/init.lua b/packages/cropmarks/init.lua index a3c5af14f..2fd529f56 100644 --- a/packages/cropmarks/init.lua +++ b/packages/cropmarks/init.lua @@ -7,51 +7,45 @@ local outcounter = 1 local function outputMarks () local page = SILE.getFrame("page") - SILE.outputter:drawRule(page:left() - 10, page:top(), -10, 0.5) - SILE.outputter:drawRule(page:left(), page:top() - 10, 0.5, -10) - SILE.outputter:drawRule(page:right() + 10, page:top(), 10, 0.5) - SILE.outputter:drawRule(page:right(), page:top() - 10, 0.5, -10) - SILE.outputter:drawRule(page:left() - 10, page:bottom(), -10, 0.5) - SILE.outputter:drawRule(page:left(), page:bottom() + 10, 0.5, 10) - SILE.outputter:drawRule(page:right() + 10, page:bottom(), 10, 0.5) - SILE.outputter:drawRule(page:right(), page:bottom() + 10, 0.5, 10) + -- Length of crop mark bars + local cropsz = 20 + -- Ensure the crop marks stay outside the bleed area + local offset = math.max(10, SILE.documentState.bleed / 2) + + SILE.outputter:drawRule(page:left() - offset, page:top(), -cropsz, 0.5) + SILE.outputter:drawRule(page:left(), page:top() - offset, 0.5, -cropsz) + SILE.outputter:drawRule(page:right() + offset, page:top(), cropsz, 0.5) + SILE.outputter:drawRule(page:right(), page:top() - offset, 0.5, -cropsz) + SILE.outputter:drawRule(page:left() - offset, page:bottom(), -cropsz, 0.5) + SILE.outputter:drawRule(page:left() , page:bottom() + offset, 0.5, cropsz) + SILE.outputter:drawRule(page:right() + offset, page:bottom(), cropsz, 0.5) + SILE.outputter:drawRule(page:right(), page:bottom() + offset, 0.5, cropsz) local hbox, hlist = SILE.typesetter:makeHbox(function () SILE.settings:temporarily(function () SILE.call("noindent") SILE.call("font", { size="6pt" }) - SILE.call("crop:header") + if SILE.Commands["crop:header"] then + -- Deprecation shim: + -- If user redefined this command, still use it with a warning... + SU.deprecated("crop:header", "cropmarks:header", "0.15.0", "0.16.0") + SILE.call("crop:header") + else + SILE.call("cropmarks:header") + end end) end) if #hlist > 0 then - SU.error("Forbidden migrating content in crop header") + SU.error("Migrating content is forbidden in crop header") end - SILE.typesetter.frame.state.cursorX = page:left() + 10 - SILE.typesetter.frame.state.cursorY = page:top() - 13 + SILE.typesetter.frame.state.cursorX = page:left() + offset + SILE.typesetter.frame.state.cursorY = page:top() - offset - 4 outcounter = outcounter + 1 if hbox then - for i = 1, #(hbox.value) do hbox.value[i]:outputYourself(SILE.typesetter, { ratio = 1 }) end - end -end - -local function reconstrainFrameset (fs) - for n, f in pairs(fs) do - if n ~= "page" then - if f:isAbsoluteConstraint("right") then - f.constraints.right = "left(page) + (" .. f.constraints.right .. ")" - end - if f:isAbsoluteConstraint("left") then - f.constraints.left = "left(page) + (" .. f.constraints.left .. ")" - end - if f:isAbsoluteConstraint("top") then - f.constraints.top = "top(page) + (" .. f.constraints.top .. ")" - end - if f:isAbsoluteConstraint("bottom") then - f.constraints.bottom = "top(page) + (" .. f.constraints.bottom .. ")" - end - f:invalidate() + for i = 1, #(hbox.value) do + hbox.value[i]:outputYourself(SILE.typesetter, { ratio = 1 }) end end end @@ -63,53 +57,36 @@ end function package:registerCommands () - self:registerCommand("crop:header", function (_, _) - local info = SILE.input.filenames[1] .. " - " .. self.class:date("%x %X") .. " - " .. outcounter + self:registerCommand("cropmarks:header", function (_, _) + local info = SILE.input.filenames[1] + .. " - " + .. self.class.packages.date:date({ format = "%x %X" }) + .. " - " .. outcounter SILE.typesetter:typeset(info) end) - self:registerCommand("crop:setup", function (options, _) - local papersize = SU.required(options, "papersize", "setting up crop marks") - local landscape = SU.boolean(options.landscape, self.class.options.landscape) - local size = SILE.papersize(papersize, landscape) - local oldsize = SILE.documentState.paperSize - SILE.documentState.paperSize = size - local offsetx = ( SILE.documentState.paperSize[1] - oldsize[1] ) /2 - local offsety = ( SILE.documentState.paperSize[2] - oldsize[2] ) /2 - local page = SILE.getFrame("page") - page:constrain("right", page:right() + offsetx) - page:constrain("left", offsetx) - page:constrain("bottom", page:bottom() + offsety) - page:constrain("top", offsety) - if SILE.scratch.masters then - for _, v in pairs(SILE.scratch.masters) do - reconstrainFrameset(v.frames) - end - else - reconstrainFrameset(SILE.documentState.documentClass.pageTemplate.frames) - end - if SILE.typesetter.frame then SILE.typesetter.frame:init() end - local oldEndPage = SILE.documentState.documentClass.endPage - SILE.documentState.documentClass.endPage = function (self_) - oldEndPage(self_) - outputMarks() - end + self:registerCommand("cropmarks:setup", function (_, _) + self.class:registerHook("endpage", outputMarks) end) + self:registerCommand("crop:setup", function (_, _) + SU.deprecated("crop:setup", "cropmarks:setup", "0.15.10", "0.17.0") + SILE.call("cropmarks:setup") + end) end package.documentation = [[ \begin{document} -When preparing a document for printing, you may be asked by the printer to add crop marks. -This means that you need to output the document on a slightly larger page size than your target paper and add printer’s crop marks to show where the paper should be trimmed down to the correct size. -(This is to ensure that pages where the content “bleeds” off the side of the page are correctly cut.) +When preparing a document for printing, you may be asked by the printer add crop marks. +This means that you need to output the document on a slightly larger page size than your target paper and add crop marks to show where the paper sheet should be trimmed down to the correct size. -This package provides the \autodoc:command{\crop:setup} command which should be run early in your document file. -It takes one argument, \autodoc:parameter{papersize}, which is the true target paper size. -It place cropmarks around the true page content. +Actual paper size, true page content area and bleed/trim area can all be set via class options. +This package provides the \autodoc:command{\cropmarks:setup} command which should be run early in your document file. +It places crop marks around the true page content. +The crop marks are guaranteed to stay outside the bleed/trim area, when defined. It also adds a header at the top of the page with the filename, date and output sheet number. -You can customize this header by redefining \autodoc:command{\crop:header}. +You can customize this header by redefining \autodoc:command{\cropmarks:header}. \end{document} ]] diff --git a/packages/dropcaps/init.lua b/packages/dropcaps/init.lua index 764de53df..ac7b6bccd 100644 --- a/packages/dropcaps/init.lua +++ b/packages/dropcaps/init.lua @@ -9,16 +9,58 @@ function package:_init () self:loadPackage("raiselower") end -local shapeHbox = function (options, content) - -- Clear irrelevant values before passing to font - options.lines, options.join, options.raise, options.shift, options.color, options.scale = nil, nil, nil, nil, nil, nil - SILE.call("noindent") +function package.declareSettings (_) + SILE.settings:declare({ + parameter = "dropcaps.bsratio", + type = "number or nil", + default = nil, -- nil means "use computed value based on font metrics" + help = "When set, fixed default ratio of the descender with respect to the baseline (around 0.3 in usual fonts)." + }) +end + +local function shapeHbox (options, content) local hbox = SILE.typesetter:makeHbox(function () SILE.call("font", options, content) end) return hbox end +local metrics = require("fontmetrics") +local bsratiocache = {} + +local computeBaselineRatio = function () + local fontoptions = SILE.font.loadDefaults({}) + local bsratio = bsratiocache[SILE.font._key(fontoptions)] + if not bsratio then + local face = SILE.font.cache(fontoptions, SILE.shaper.getFace) + local m = metrics.get_typographic_extents(face) + bsratio = m.descender / (m.ascender + m.descender) + bsratiocache[SILE.font._key(fontoptions)] = bsratio + end + return bsratio +end + +local function getToleranceDepth () + -- In non-strict mode, we allow using more lines to fit the dropcap. + -- However we cannot just check if the "extra depth" of the dropcap is above 0. + -- First, our depth adjustment is but a best attempt. + -- Moreover, some characters may have a small depth of their own (ex. "O" in Gentium Plus) + -- We must just ensure they stay within "reasonable bounds" with respect to the baseline, + -- so as not to flow over the next lines. + -- We compute a tolerance ratio based on the font metrics, expecting the font to be well-designed. + -- The user can override the computation and set the dropcaps.bsratio setting manually. + -- (LaTeX would likely approximate it using a \strut = with a depth ratio of 0.3bs) + local bsratio + if SILE.settings:get("dropcaps.bsratio") then + bsratio = SILE.settings:get("dropcaps.bsratio") + SU.debug("dropcaps", "Using user-defined descender baseline ratio", bsratio) + else + bsratio = computeBaselineRatio() + SU.debug("dropcaps", "Using computed descender baseline ratio", bsratio) + end + return bsratio * SILE.measurement("1bs"):tonumber() +end + function package:registerCommands () -- This implementation relies on the hangafter and hangindent features of Knuth's line-breaking algorithm. @@ -31,41 +73,83 @@ function package:registerCommands () local shift = SU.cast("measurement", options.shift or 0) local size = SU.cast("measurement or nil", options.size or nil) local scale = SU.cast("number", options.scale or 1.0) + local strict = SU.boolean(options.strict, true) + if strict and options.depthadjust then + SU.warn("The depthadjust option is ignored in strict mode.") + end local color = options.color - options.size = nil -- we need to measure the "would have been" size before using this + -- We need to measure the "would have been" size before using this. + options.size = nil + -- Clear irrelevant option values before passing to font and measuring content. + options.lines, options.join, options.raise, options.shift, options.color, options.scale = nil, nil, nil, nil, nil, nil if color then self:loadPackage("color") end + -- Some initial capital fonts have all their glyphs hanging below the baseline (e.g. EB Garamond Initials) + -- We cannot manage all pathological cases. + -- Quite empirically, we can shape character(s) which shouldn't usually have a depth normally. + -- If it has, then likely all glyphs do also and we need to compensate for that everywhere. + local depthadjust = options.depthadjust or "I" + local depthAdjustment = not strict and shapeHbox(options, { depthadjust }).depth:tonumber() or 0 + SU.debug("dropcaps", "Depth adjustment", depthAdjustment) + -- We want the drop cap to span over N lines, that is N - 1 baselineskip + the height of the first line. -- Note this only works for the default linespace mechanism. -- We determine the height of the first line by measuring the size the initial content *would have* been. - -- This gives the font some control over its relative size, sometimes desired sometimes undesired. local tmpHbox = shapeHbox(options, content) local extraHeight = SILE.measurement((lines - 1).."bs"):tonumber() - local targetHeight = tmpHbox.height:tonumber() * scale + extraHeight + local curHeight = tmpHbox.height:tonumber() + depthAdjustment + local targetHeight = (curHeight - depthAdjustment) * scale + extraHeight + if strict then + -- Take into account the compensated depth of the initial + curHeight = curHeight + tmpHbox.depth:tonumber() + end SU.debug("dropcaps", "Target height", targetHeight) -- Now we need to figure out how to scale the dropcap font to get an initial of targetHeight. -- From that we can also figure out the width it will be at that height. local curSize = SILE.measurement(SILE.settings:get("font.size")):tonumber() - local curHeight, curWidth = tmpHbox.height:tonumber(), tmpHbox.width:tonumber() + local curWidth = tmpHbox.width:tonumber() options.size = size and size:tonumber() or (targetHeight / curHeight * curSize) local targetWidth = curWidth / curSize * options.size SU.debug("dropcaps", "Target font size", options.size) SU.debug("dropcaps", "Target width", targetWidth) - -- Typeset the dropcap with its final shape, but don't output it yet + -- Typeset the dropcap with its final shape, but don't output it yet. local hbox = shapeHbox(options, content) + if not strict then + -- Compensation for regular extra depth. + local compensationHeight = depthAdjustment * options.size / curSize + SU.debug("dropcaps", "Compensation height", compensationHeight) + + -- Some fonts have descenders on letters such as Q, J, etc. + -- In that case we may need extra lines to the dropcap. + local extraDepth = hbox.depth:tonumber() - compensationHeight + local toleranceDepth = getToleranceDepth() + if extraDepth > toleranceDepth then + SU.debug("dropcaps", "Extra depth", extraDepth, "> tolerance", toleranceDepth) + local extraLines = math.ceil((extraDepth - toleranceDepth) / SILE.measurement("1bs"):tonumber()) + lines = lines + extraLines + SU.debug("dropcaps", "Extra lines needed to fit", extraLines) + else + SU.debug("dropcaps", "Extra depth", extraDepth, "< tolerance", toleranceDepth) + end + raise = raise:tonumber() + compensationHeight + else + raise = raise:tonumber() + hbox.depth:tonumber() + end + -- Setup up the necessary indents for the final paragraph content local joinOffset = join and standoff:tonumber() or 0 SILE.settings:set("current.hangAfter", -lines) SILE.settings:set("current.hangIndent", targetWidth + joinOffset) + SILE.call("noindent") SU.debug("dropcaps", "joinOffset", joinOffset) -- The paragraph is indented so as to leave enough space for the drop cap. -- We "trick" the typesetter with a zero-dimension box wrapping our original box. - SILE.call("rebox", { height = 0, width = -joinOffset }, function () + SILE.call("rebox", { height = 0, depth = 0, width = -joinOffset }, function () SILE.call("glue", { width = shift - targetWidth - joinOffset }) SILE.call("lower", { height = extraHeight - raise }, function () SILE.call(color and "color" or "noop", { color = color }, function () @@ -79,6 +163,7 @@ end package.documentation = [[ \begin{document} +\use[module=packages.dropcaps] The \autodoc:package{dropcaps} package allows you to format paragraphs with an “initial capital” (also commonly referred as a “drop cap”), typically one large capital letter used as a decorative element at the beginning of a paragraph. It provides the \autodoc:command{\dropcap} command. @@ -92,6 +177,18 @@ To tweak the position of the dropcap, measurements may be passed to the \autodoc Other options passed to \autodoc:command{\dropcap} will be passed through to \autodoc:command{\font} when drawing the initial letter(s). This may be useful for passing OpenType options or other font preferences. +Some fonts have capitals — such as, typically, \autodoc:example{Q} and \autodoc:example{J} — hanging below the baseline. +By default, the dropcap fits the specified number of lines and the characters are typeset in a smaller size to fit these descenders. + +With the \autodoc:parameter{strict=false} option, the characters are scaled with respect to their height only, and extra hanged lines are added to the dropcap in order to accommodate the descenders. +The dropcap is allowed to overflow the baseline by a reasonable amount, before triggering the addition of extra lines, for fonts that have capitals very slightly hanging below the baseline. +This tolerance is computed based on the font metrics. +If you want to bypass this mechanism and adjust the tolerance, you can use the \autodoc:setting{dropcaps.bsratio} setting. + +Moreover, some fonts, such as EB Garamond Initials, have \em{all} capitals hanging below the baseline. +To take this case into account in non-strict mode, the depth adjustment of the dropcap is empirically corrected based on that of a character which shouldn't have any, by default an \autodoc:example{I}. +The character(s) used for this depth adjustment correction can be specified using the \autodoc:parameter{depthadjust} option. + \begin{autodoc:note} One caveat is that the size of the initials is calculated using the default linespacing mechanism. If you are using an alternative method from the \autodoc:package{linespacing} package, you might see strange results. diff --git a/packages/inputfilter/init.lua b/packages/inputfilter/init.lua index 13fff8e07..448e5739d 100644 --- a/packages/inputfilter/init.lua +++ b/packages/inputfilter/init.lua @@ -25,14 +25,8 @@ function package:transformContent (content, transformFunction, extraArgs) end function package.createCommand (_, pos, col, lno, command, options, content) - local result = { content } - result.col = col - result.lno = lno - result.pos = pos - result.options = options - result.command = command - result.id = "command" - return result + local position = { lno = lno, col = col, pos = pos } + return SU.ast.createCommand(command, options, content, position) end function package:_init () diff --git a/packages/math/base-elements.lua b/packages/math/base-elements.lua index f8332ec8a..2a57d3367 100644 --- a/packages/math/base-elements.lua +++ b/packages/math/base-elements.lua @@ -1112,7 +1112,7 @@ function elements.table:_init (children, options) self.children = children self.options = options self.nrows = #self.children - self.ncols = math.max(table.unpack(mapList(function(_, row) + self.ncols = math.max(pl.utils.unpack(mapList(function(_, row) return #row.children end, self.children))) SU.debug("math", "self.ncols =", self.ncols) self.rowspacing = self.options.rowspacing and SILE.length(self.options.rowspacing) diff --git a/packages/math/texlike.lua b/packages/math/texlike.lua index edc5fee4d..04224f487 100644 --- a/packages/math/texlike.lua +++ b/packages/math/texlike.lua @@ -83,7 +83,7 @@ local mathGrammar = function (_ENV) -- Remove the last mathlist if empty. This way, -- `inner1 \\ inner2 \\` is the same as `inner1 \\ inner2`. if not t[#t][1] or not t[#t][1][1] then table.remove(t) end - return table.unpack(t) + return pl.utils.unpack(t) end START "texlike_math" diff --git a/packages/pdf/init.lua b/packages/pdf/init.lua index f6622a3bc..9a9e2f394 100644 --- a/packages/pdf/init.lua +++ b/packages/pdf/init.lua @@ -1,44 +1,17 @@ +-- +-- This package and its commands are perhaps ill-named: +-- Exception made of the pdf:literal command below, the concepts of links +-- (anchor, target), bookmarks, and metadata are not specific to PDF. +-- local base = require("packages.base") local package = pl.class(base) package._name = "pdf" -local pdf - -local function borderColor (color) - if color then - if color.r then return "/C [" .. color.r .. " " .. color.g .. " " .. color.b .. "]" end - if color.c then return "/C [" .. color.c .. " " .. color.m .. " " .. color.y .. " " .. color.k .. "]" end - if color.l then return "/C [" .. color.l .. "]" end - end - return "" -end - -local function borderStyle (style, width) - if style == "underline" then return "/BS<</Type/Border/S/U/W " .. width .. ">>" end - if style == "dashed" then return "/BS<</Type/Border/S/D/D[3 2]/W " .. width .. ">>" end - return "/Border[0 0 " .. width .. "]" -end - -local function validate_date (date) - return string.match(date, [[^D:%d+%s*-%s*%d%d%s*'%s*%d%d%s*'?$]]) ~= nil -end - -function package:_init () - base._init(self) - pdf = require("justenoughlibtexpdf") - if SILE.outputter._name ~= "libtexpdf" then - SU.error("pdf package requires libtexpdf backend") - end -end - function package:registerCommands () self:registerCommand("pdf:destination", function (options, _) local name = SU.required(options, "name", "pdf:destination") - if type(SILE.outputter._ensureInit) == "function" then - SILE.outputter:_ensureInit() - end SILE.typesetter:pushHbox({ outputYourself = function (_, typesetter, line) local state = typesetter.frame.state @@ -46,7 +19,7 @@ function package:registerCommands () local x, y = state.cursorX, state.cursorY typesetter.frame:advancePageDirection(line.height) local _y = SILE.documentState.paperSize[2] - y - pdf.destination(name, x:tonumber(), _y:tonumber()) + SILE.outputter:linkAnchor(x, _y, name) end }) end) @@ -54,29 +27,26 @@ function package:registerCommands () self:registerCommand("pdf:bookmark", function (options, _) local dest = SU.required(options, "dest", "pdf:bookmark") local title = SU.required(options, "title", "pdf:bookmark") - local level = options.level or 1 - -- Added UTF8 to UTF16-BE conversion - -- For annotations and bookmarks, text strings must be encoded using - -- either PDFDocEncoding or UTF16-BE with a leading byte-order marker. - -- As PDFDocEncoding supports only limited character repertoire for - -- European languages, we use UTF-16BE for internationalization. - local ustr = SU.utf8_to_utf16be_hexencoded(title) - if type(SILE.outputter._ensureInit) == "function" then - SILE.outputter:_ensureInit() - end + local level = SU.cast("integer", options.level or 1) SILE.typesetter:pushHbox({ value = nil, height = SILE.measurement(0), width = SILE.measurement(0), depth = SILE.measurement(0), outputYourself = function () - local d = "<</Title<" .. ustr .. ">/A<</S/GoTo/D(" .. dest .. ")>>>>" - pdf.bookmark(d, level) + SILE.outputter:setBookmark(dest, title, level) end }) end) self:registerCommand("pdf:literal", function (_, content) + -- NOTE: This method is used by the pdfstructure package and should + -- probably be moved elsewhere, so there's no attempt here to delegate + -- the low-level libtexpdf call to te outputter. + if SILE.outputter._name ~= "libtexpdf" then + SU.error("pdf package requires libtexpdf backend") + end + local pdf = require("justenoughlibtexpdf") if type(SILE.outputter._ensureInit) == "function" then SILE.outputter:_ensureInit() end @@ -93,43 +63,44 @@ function package:registerCommands () self:registerCommand("pdf:link", function (options, content) local dest = SU.required(options, "dest", "pdf:link") - local target = options.external and "/Type/Action/S/URI/URI" or "/S/GoTo/D" + local external = SU.boolean(options.external, false) local borderwidth = options.borderwidth and SU.cast("measurement", options.borderwidth):tonumber() or 0 - local bordercolor = borderColor(SILE.color(options.bordercolor or "blue")) + local bordercolor = SILE.color(options.bordercolor or "blue") local borderoffset = SU.cast("measurement", options.borderoffset or "1pt"):tonumber() - local borderstyle = borderStyle(options.borderstyle, borderwidth) - local llx, lly - if type(SILE.outputter._ensureInit) == "function" then - SILE.outputter:_ensureInit() - end + local opts = { + external = external, + borderstyle = options.borderstyle, + bordercolor = bordercolor, + borderwidth = borderwidth, + borderoffset = borderoffset + } + + local x0, y0 SILE.typesetter:pushHbox({ value = nil, - height = SILE.measurement(0), - width = SILE.measurement(0), - depth = SILE.measurement(0), + height = 0, + width = 0, + depth = 0, outputYourself = function (_, typesetter, _) - llx = typesetter.frame.state.cursorX:tonumber() - lly = (SILE.documentState.paperSize[2] - typesetter.frame.state.cursorY):tonumber() - pdf.begin_annotation() + x0 = typesetter.frame.state.cursorX:tonumber() + y0 = (SILE.documentState.paperSize[2] - typesetter.frame.state.cursorY):tonumber() + SILE.outputter:enterLinkTarget(dest, opts) end }) - local hbox, hlist = SILE.typesetter:makeHbox(content) -- hack SILE.typesetter:pushHbox(hbox) - SILE.typesetter:pushHlist(hlist) - SILE.typesetter:pushHbox({ value = nil, - height = SILE.measurement(0), - width = SILE.measurement(0), - depth = SILE.measurement(0), + height = 0, + width = 0, + depth = 0, outputYourself = function (_, typesetter, _) - local d = "<</Type/Annot/Subtype/Link" .. borderstyle .. bordercolor .. "/A<<" .. target .. "(" .. dest .. ")>>>>" - local x = typesetter.frame.state.cursorX:tonumber() - local y = (SILE.documentState.paperSize[2] - typesetter.frame.state.cursorY + hbox.height):tonumber() - pdf.end_annotation(d, llx , lly - borderoffset, x, y + borderoffset) + local x1 = typesetter.frame.state.cursorX:tonumber() + local y1 = (SILE.documentState.paperSize[2] - typesetter.frame.state.cursorY + hbox.height):tonumber() + SILE.outputter:leaveLinkTarget(x0, y0, x1, y1, dest, opts) -- Unstable API end }) + SILE.typesetter:pushHlist(hlist) end) self:registerCommand("pdf:metadata", function (options, _) @@ -139,32 +110,7 @@ function package:registerCommands () end local value = SU.required(options, "value", "pdf:metadata") - if key == "Trapped" then - SU.warn("Skipping special metadata key \\Trapped") - return - end - - if key == "ModDate" or key == "CreationDate" then - if not validate_date(value) then - SU.warn("Invalid date: " .. value) - return - end - else - -- see comment in pdf:bookmark - value = SU.utf8_to_utf16be(value) - end - if type(SILE.outputter._ensureInit) == "function" then - SILE.outputter:_ensureInit() - end - SILE.typesetter:pushHbox({ - value = nil, - height = SILE.measurement(0), - width = SILE.measurement(0), - depth = SILE.measurement(0), - outputYourself = function (_, _, _) - pdf.metadata(key, value) - end - }) + SILE.outputter:setMetadata(key, value) end) end diff --git a/packages/retrograde/init.lua b/packages/retrograde/init.lua new file mode 100644 index 000000000..2669cb900 --- /dev/null +++ b/packages/retrograde/init.lua @@ -0,0 +1,91 @@ +local base = require("packages.base") + +local package = pl.class(base) +package._name = "retrograde" + +local semver = require("semver") + +local semver_descending = function (a, b) + a, b = semver(a), semver(b) + return a > b +end + +-- Default settings that have gone out of fashion +package.default_settings = { + ["0.15.0"] = { + ["shaper.spaceenlargementfactor"] = 1.2, + }, + ["0.9.5"] = { + ["font.family"] = "Gentium Basic", + }, +} + +function package:_init (options) + base._init(self, options) + self:defaults(options.target) +end + +function package:defaults (target) + target = semver(target and target or SILE.version) + SU.debug("retrograde", ("Targeting default changes back as far as the release of SILE v%s."):format(target)) + local target_hit = false + for version, settings in pl.tablex.sort(self.default_settings, semver_descending) do + version = semver(version) + if target_hit then + SU.debug("retrograde", ("The next set of default changes is from the release of SILE v%s, stopping."):format(version)) + break + end + for parameter, value in pairs(settings) do + SU.debug("retrograde", ("Resetting '%s' to '%s' as it was prior to v%s."):format(parameter, tostring(value), version)) + SILE.settings:set(parameter, value, true) + end + if version <= target then target_hit = true end + end +end + +function package:registerCommands () + + self:registerCommand("defaults", function (options, content) + if content then + SILE.settings:temporarily(function () + self:defaults(options.target) + end) + else + self:defaults(options.target) + end + end) + +end + +local doctarget = "v" .. tostring(semver(SILE.version)) +package.documentation = ([[ +\begin{document} + +From time to time, the default behavior of a function or value of a setting in SILE might change with a new release. +If these changes are expected to cause document reflows they will be noted in release notes as breaking changes. +That generally means old documents will have to be updated to keep rending the same way. +On a best-effort basis (not a guarantee) this package tries to restore earlier default behaviors and settings. + +For settings this is relatively simple. +You just set the old default value explicitly in your document or project. +But first, knowing what those are requires a careful reading of the release notes. +Then you have to chase down the incantations to set the old values. +This package tries to restore as many previous setting values as possible to make old documents render like they would have in previous releases without changing the documents themselves (beyond loading this package). + +For functions things are a little more complex, but for as many cases as possible we'll try to allow swapping old versions of code. + +None of this is a guarantee that your old document will be stable in new versions of SILE. +All of this is a danger zone. + +From inside a document, use \autodoc:command{\use[module=packages.retrograde,target=%s]} to load features from SILE %s. + +This can also be triggered from the command line with no changes to a document: + +\begin{autodoc:codeblock} +$ sile -u 'packages.retrograde[target=%s]' +\end{autodoc:codeblock} + +\end{document} +]]):format(doctarget, doctarget, doctarget) + +return package diff --git a/packages/rotate/init.lua b/packages/rotate/init.lua index 5982f0c2c..6aad18cca 100644 --- a/packages/rotate/init.lua +++ b/packages/rotate/init.lua @@ -3,23 +3,25 @@ local base = require("packages.base") local package = pl.class(base) package._name = "rotate" -local pdf = require("justenoughlibtexpdf") - local enter = function (self, _) + -- Probably broken, see: + -- https://github.com/sile-typesetter/sile/issues/427 if not self.rotate then return end - local x = -math.rad(self.rotate) + if not SILE.outputter.enterFrameRotate then + return SU.warn("Frame '".. self.id "' will not be rotated: backend '" .. SILE.outputter._name .. "' does not support rotation") + end + local theta = -math.rad(self.rotate) -- Keep center point the same - pdf:gsave() - local cx = self:left():tonumber() - local cy = -self:bottom():tonumber() - pdf.setmatrix(1, 0, 0, 1, cx + math.sin(x) * self:height():tonumber(), cy) - pdf.setmatrix(math.cos(x), math.sin(x), -math.sin(x), math.cos(x), 0, 0) - pdf.setmatrix(1, 0, 0, 1, -cx, -cy) + local x0 = self:left():tonumber() + local x1 = x0 + math.sin(theta) * self:height():tonumber() + local y0 = self:bottom():tonumber() + SILE.outputter:enterFrameRotate(x0, x1, y0, theta) -- Unstable API end -local leave = function(self, _) +local leave = function(self, _) if not self.rotate then return end - pdf:grestore() + if not SILE.outputter.enterFrameRotate then return end -- no enter no leave. + SILE.outputter:leaveFrameRotate() end -- What is the width, depth and height of a rectangle width w and height h rotated by angle theta? @@ -35,20 +37,20 @@ end local outputRotatedHbox = function (self, typesetter, line) local origbox = self.value.orig - local x = self.value.theta + local theta = self.value.theta + -- Find origin of untransformed hbox - local save = typesetter.frame.state.cursorX - typesetter.frame.state.cursorX = typesetter.frame.state.cursorX - (origbox.width.length-self.width)/2 - - local horigin = (typesetter.frame.state.cursorX + origbox.width.length / 2):tonumber() - local vorigin = -(typesetter.frame.state.cursorY - (origbox.height - origbox.depth) / 2):tonumber() - pdf:gsave() - pdf.setmatrix(1, 0, 0, 1, horigin, vorigin) - pdf.setmatrix(math.cos(x), math.sin(x), -math.sin(x), math.cos(x), 0, 0) - pdf.setmatrix(1, 0, 0, 1, -horigin, -vorigin) - origbox:outputYourself(typesetter, line) - pdf:grestore() - typesetter.frame.state.cursorX = save + local X = typesetter.frame.state.cursorX + local Y = typesetter.frame.state.cursorY + typesetter.frame.state.cursorX = X - (origbox.width.length-self.width)/2 + local horigin = X + origbox.width.length / 2 + local vorigin = Y - (origbox.height - origbox.depth) / 2 + + SILE.outputter:rotateFn(horigin, vorigin, theta, function () + origbox:outputYourself(typesetter, line) + end) + typesetter.frame.state.cursorX = X + typesetter.frame.state.cursorY = Y typesetter.frame:advanceWritingDirection(self.width) end @@ -65,6 +67,10 @@ end function package:registerCommands () self:registerCommand("rotate", function(options, content) + if not SILE.outputter.rotateFn then + SU.warn("Output will not be rotated: backend '" .. SILE.outputter._name .. "' does not support rotation") + return SILE.process(content) + end local angle = SU.required(options, "angle", "rotate command") local theta = -math.rad(angle) local origbox, hlist = SILE.typesetter:makeHbox(content) @@ -92,7 +98,6 @@ function package:registerCommands () end depth = -depth if depth < SILE.length(0) then depth = SILE.length(0) end - SILE.outputter:_ensureInit() SILE.typesetter:pushHbox({ value = { orig = origbox, theta = theta}, height = height, diff --git a/packages/scalebox/init.lua b/packages/scalebox/init.lua index f4d8375c2..8ab331fbb 100644 --- a/packages/scalebox/init.lua +++ b/packages/scalebox/init.lua @@ -6,12 +6,10 @@ package._name = "scalebox" function package:registerCommands () self:registerCommand("scalebox", function(options, content) - if SILE.outputter._name ~= "libtexpdf" then - SU.warn("Output will not be scaled: \\scalebox only works with the libtexpdf backend") + if not SILE.outputter.scaleFn then + SU.warn("Output will not be scaled: backend '" .. SILE.outputter._name .. "' does not support scaling") return SILE.process(content) end - SILE.outputter:_ensureInit() - local pdf = require("justenoughlibtexpdf") local hbox, hlist = SILE.typesetter:makeHbox(content) local xratio, yratio = SU.cast("number", options.xratio or 1), SU.cast("number", options.yratio or 1) @@ -37,18 +35,13 @@ function package:registerCommands () local outputWidth = SU.rationWidth(node.width, node.width, line.ratio) local X = typesetter.frame.state.cursorX local Y = typesetter.frame.state.cursorY - local x0 = X:tonumber() - local y0 = -Y:tonumber() if xratio < 0 then typesetter.frame:advanceWritingDirection(-outputWidth) end - pdf:gsave() - pdf.setmatrix(1, 0, 0, 1, x0, y0) - pdf.setmatrix(xratio, 0, 0, yratio, 0, 0) - pdf.setmatrix(1, 0, 0, 1, -x0, -y0) - hbox.outputYourself(hbox, typesetter, line) - pdf:grestore() + SILE.outputter:scaleFn(X, Y, xratio, yratio, function () + hbox:outputYourself(typesetter, line) + end) typesetter.frame.state.cursorX = X typesetter.frame.state.cursorY = Y typesetter.frame:advanceWritingDirection(outputWidth) diff --git a/packages/tableofcontents/init.lua b/packages/tableofcontents/init.lua index b4036660d..5d2f08129 100644 --- a/packages/tableofcontents/init.lua +++ b/packages/tableofcontents/init.lua @@ -57,7 +57,7 @@ local function _linkWrapper (dest, func) end -- Flatten a node list into just its string representation. --- (Similar to SU.contentToString(), but allows passing typeset +-- (Similar to SU.ast.contentToString(), but allows passing typeset -- objects to functions that need plain strings). local function _nodesToText (nodes) -- A real interword space width depends on several settings (depending on variable @@ -174,7 +174,7 @@ function package:registerCommands () SILE.call("info", { category = "toc", value = { - label = SU.stripContentPos(content), + label = SU.ast.stripContentPos(content), level = (options.level or 1), number = options.number, link = dest diff --git a/packages/url/init.lua b/packages/url/init.lua index f30259445..b754595cc 100644 --- a/packages/url/init.lua +++ b/packages/url/init.lua @@ -3,8 +3,6 @@ local base = require("packages.base") local package = pl.class(base) package._name = "url" -local pdf - -- URL escape sequence, URL fragment: local preferBreakBefore = "%#" -- URL path elements, URL query arguments, acceptable extras: @@ -23,8 +21,7 @@ function package:_init () base._init(self) self:loadPackage("verbatim") self:loadPackage("inputfilter") - pdf = SILE.outputter._name == "libtexpdf" - if pdf then self:loadPackage("pdf") end + self:loadPackage("pdf") end function package.declareSettings (_) @@ -48,15 +45,6 @@ end function package:registerCommands () self:registerCommand("href", function (options, content) - if not pdf then - if options.src then - SILE.process(content) - else - SILE.call("url", { language = options.language }, content) - end - return -- DONE. - end - if options.src then SILE.call("pdf:link", { dest = options.src, external = true, borderwidth = options.borderwidth, diff --git a/shapers/base.lua b/shapers/base.lua index 330dea190..d0f347449 100644 --- a/shapers/base.lua +++ b/shapers/base.lua @@ -5,7 +5,7 @@ -- end SILE.settings:declare({ parameter = "shaper.variablespaces", type = "boolean", default = true }) -SILE.settings:declare({ parameter = "shaper.spaceenlargementfactor", type = "number or integer", default = 1.2 }) +SILE.settings:declare({ parameter = "shaper.spaceenlargementfactor", type = "number or integer", default = 1 }) SILE.settings:declare({ parameter = "shaper.spacestretchfactor", type = "number or integer", default = 1/2 }) SILE.settings:declare({ parameter = "shaper.spaceshrinkfactor", type = "number or integer", default = 1/3 }) diff --git a/shapers/harfbuzz.lua b/shapers/harfbuzz.lua index b932ef867..b65116b42 100644 --- a/shapers/harfbuzz.lua +++ b/shapers/harfbuzz.lua @@ -98,12 +98,15 @@ function shaper.getFace (opts) SU.debug("fonts", "Instanciated", _pretty_varitions(face), "as", face.tempfilename) elseif (face.variations ~= "") or (bitshim.rshift(face.index, 16) ~= 0) then if not SILE.features.font_variations then - SU.warn([[This build of SILE was compiled with font variations support disabled, + SU.warn([[ + This build of SILE was compiled with font variations support disabled, likely due to not having the subsetter library included in HarfBuzz >= 6. This document specifies font variations which cannot be correctly rendered. Please rebuild SILE with the necessary library support. Alternatively to procede anyway *incorrectly* render this document run: + sile -e 'SILE.features.font_variations = true' .... + Or modify the document to remove variations options from font commands.]]) end SU.error("Failed to instanciate: " .. _pretty_varitions(face)) diff --git a/sile.in b/sile.in index 54ad51a60..945766662 100755 --- a/sile.in +++ b/sile.in @@ -49,15 +49,15 @@ if SILE.input.filenames and #SILE.input.filenames >= 1 then SILE.use(spec.module, spec.options) end - local main, err = xpcall(function() + local process_status, error_msg = xpcall(function() pl.tablex.imap(SILE.processFile, SILE.input.filenames) end, SILE.errorHandler) - if not main then - if type(err) == "string" and err:match(": interrupted!") then + if not process_status then + if type(error_msg) == "string" and error_msg:match(": interrupted!") then SILE.outputter:finish() else - io.stderr:write("\nerror summary:\n\t" .. tostring(err) .. "\n") + io.stderr:write("\nerror summary:\n\t" .. tostring(error_msg) .. "\n") end os.exit(1) end diff --git a/src/lib.rs b/src/lib.rs index e77d704f5..6efc0b115 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -53,6 +53,7 @@ pub fn inject_version(lua: &Lua) { let sile: LuaTable = lua.globals().get("SILE").unwrap(); let mut full_version: String = sile.get("full_version").unwrap(); full_version.push_str(" [Rust]"); + sile.set("full_version", full_version).unwrap(); } pub fn load_sile(lua: &Lua) { @@ -64,8 +65,7 @@ pub fn load_sile(lua: &Lua) { pub fn version() -> crate::Result<String> { let lua = start_luavm()?; let sile: LuaTable = lua.globals().get("SILE").unwrap(); - let mut full_version: String = sile.get("full_version").unwrap(); - full_version.push_str(" [Rust]"); + let full_version: String = sile.get("full_version").unwrap(); Ok(full_version) } diff --git a/tests/alignment.sil b/tests/alignment.sil index f50f413a7..144257d62 100644 --- a/tests/alignment.sil +++ b/tests/alignment.sil @@ -1,4 +1,5 @@ \begin[papersize=a6]{document} +\use[module=packages.retrograde,target=v0.15.0] \nofolios \use[module=packages.lorem] \font[family=Libertinus Serif] diff --git a/tests/amharic.sil b/tests/amharic.sil index b22d154f8..247d2d62e 100644 --- a/tests/amharic.sil +++ b/tests/amharic.sil @@ -1,4 +1,5 @@ \begin[papersize=a5]{document} +\use[module=packages.retrograde,target=v0.15.0] \font[family=Noto Sans Ethiopic,language=am] የሰው፡ልጅ፡ሁሉ፡ሲወለድ፡ነጻና፡በክብርና፡በመብትም፡እኩልነት፡ያለው፡ነው።፡የተፈጥሮ፡ማስተዋልና፡ሕሊና፡ስላለው፡አንዱ፡ሌላውን፡በወንድማማችነት፡መንፈስ፡መመልከት፡ይገባዋል። diff --git a/tests/arabic-scripts.sil b/tests/arabic-scripts.sil index 10ec342c1..bf939b49d 100644 --- a/tests/arabic-scripts.sil +++ b/tests/arabic-scripts.sil @@ -1,4 +1,5 @@ \begin[papersize=a6]{document} +\use[module=packages.retrograde,target=v0.15.0] \nofolios \use[module=packages.bidi] \font[family=LateefGR,size=16pt,language=en] diff --git a/tests/bibtex.sil b/tests/bibtex.sil index d50221a8a..06adcc5c4 100644 --- a/tests/bibtex.sil +++ b/tests/bibtex.sil @@ -1,4 +1,5 @@ \begin[papersize=a6]{document} +\use[module=packages.retrograde,target=v0.15.0] \neverindent \nofolios \use[module=packages.bibtex] diff --git a/tests/bidi.sil b/tests/bidi.sil index 1e26ebff0..6f4a8a900 100644 --- a/tests/bidi.sil +++ b/tests/bidi.sil @@ -1,4 +1,5 @@ \begin[papersize=a5]{document} +\use[module=packages.retrograde,target=v0.15.0] \font[family=SBL Hebrew,language=he] \font[size=25pt] \set[parameter=document.baselineskip,value=29pt] diff --git a/tests/bug-1044.sil b/tests/bug-1044.sil index 26d156816..f9962bf15 100644 --- a/tests/bug-1044.sil +++ b/tests/bug-1044.sil @@ -1,4 +1,5 @@ \begin[papersize=a6]{document} +\use[module=packages.retrograde,target=v0.15.0] \nofolios \neverindent \font[family=Libertinus Serif]{Ta of} diff --git a/tests/bug-1101.sil b/tests/bug-1101.sil index ddc7e0a01..d2b2f6102 100644 --- a/tests/bug-1101.sil +++ b/tests/bug-1101.sil @@ -1,4 +1,5 @@ \begin[class=jplain,layout=tate,papersize=a4]{document} +\use[module=packages.retrograde,target=v0.15.0] \neverindent \nofolios diff --git a/tests/bug-117.sil b/tests/bug-117.sil index ed044f8f1..60250d6f3 100644 --- a/tests/bug-117.sil +++ b/tests/bug-117.sil @@ -1,4 +1,5 @@ \begin[papersize=a5]{document} +\use[module=packages.retrograde,target=v0.15.0] %nice script from SILE book \begin{script} for i=1,10 do diff --git a/tests/bug-1259.sil b/tests/bug-1259.sil index 55f47dfa1..6f1a5dc47 100644 --- a/tests/bug-1259.sil +++ b/tests/bug-1259.sil @@ -1,4 +1,5 @@ \begin[papersize=a5]{document} +\use[module=packages.retrograde,target=v0.15.0] \neverindent \nofolios \use[module=packages.rules] diff --git a/tests/bug-1280.sil b/tests/bug-1280.sil index e70e280f5..b85dfcda8 100644 --- a/tests/bug-1280.sil +++ b/tests/bug-1280.sil @@ -1,4 +1,5 @@ \begin[papersize=15cm x 6cm]{document} +\use[module=packages.retrograde,target=v0.15.0] \font[filename=.fonts/NotoSerifCJK-Regular.ttc] \nofolios \neverindent diff --git a/tests/bug-1297-hyph-fr-ca.sil b/tests/bug-1297-hyph-fr-ca.sil index 77416554c..03fe2fac1 100644 --- a/tests/bug-1297-hyph-fr-ca.sil +++ b/tests/bug-1297-hyph-fr-ca.sil @@ -1,4 +1,5 @@ \begin[papersize=6in x 9in]{document} +\use[module=packages.retrograde,target=v0.15.0] \nofolios \language[main=fr] diff --git a/tests/bug-1317.sil b/tests/bug-1317.sil index 57413de07..bff19d3f4 100644 --- a/tests/bug-1317.sil +++ b/tests/bug-1317.sil @@ -1,4 +1,5 @@ \begin[direction=RTL,papersize=a7]{document} +\use[module=packages.retrograde,target=v0.15.0] \font[family=Amiri,size=30pt] \nofolios \neverindent diff --git a/tests/bug-1320.sil b/tests/bug-1320.sil index 285d12f93..169645c68 100644 --- a/tests/bug-1320.sil +++ b/tests/bug-1320.sil @@ -1,4 +1,5 @@ \begin[papersize=a6]{document} +\use[module=packages.retrograde,target=v0.15.0] \neverindent \nofolios \use[module=packages.rules] diff --git a/tests/bug-1343-dotfill-stretch.sil b/tests/bug-1343-dotfill-stretch.sil index 265b76f81..cb4d6d87e 100644 --- a/tests/bug-1343-dotfill-stretch.sil +++ b/tests/bug-1343-dotfill-stretch.sil @@ -1,4 +1,5 @@ \begin[papersize=a5]{document} +\use[module=packages.retrograde,target=v0.15.0] \nofolios \use[module=packages.leaders] \use[module=packages.lorem] diff --git a/tests/bug-1359.sil b/tests/bug-1359.sil index fc2205d0e..118a25641 100644 --- a/tests/bug-1359.sil +++ b/tests/bug-1359.sil @@ -1,4 +1,5 @@ \begin[papersize=6in x 9in]{document} +\use[module=packages.retrograde,target=v0.15.0] \nofolios \neverindent \language[main=fr] diff --git a/tests/bug-1362.sil b/tests/bug-1362.sil index 5feb57409..8854f72bd 100644 --- a/tests/bug-1362.sil +++ b/tests/bug-1362.sil @@ -1,4 +1,5 @@ \begin[papersize=a5]{document} +\use[module=packages.retrograde,target=v0.15.0] \neverindent \nofolios \language[main=en] diff --git a/tests/bug-1430.sil b/tests/bug-1430.sil index 96788b9f4..3cd767d5c 100644 --- a/tests/bug-1430.sil +++ b/tests/bug-1430.sil @@ -1,4 +1,5 @@ \begin[papersize=a6]{document} +\use[module=packages.retrograde,target=v0.15.0] \neverindent \nofolios \use[module=packages.grid,spacing=50pt] diff --git a/tests/bug-1495-inline-math-layout.sil b/tests/bug-1495-inline-math-layout.sil index ca96b1272..56e2975d6 100644 --- a/tests/bug-1495-inline-math-layout.sil +++ b/tests/bug-1495-inline-math-layout.sil @@ -1,4 +1,5 @@ \begin[papersize=a6]{document} +\use[module=packages.retrograde,target=v0.15.0] \nofolios \neverindent \use[module=packages.math] diff --git a/tests/bug-1580.sil b/tests/bug-1580.sil index 3c0d6a3b4..753dd51f4 100644 --- a/tests/bug-1580.sil +++ b/tests/bug-1580.sil @@ -1,4 +1,5 @@ \begin[class=plain,papersize=a7]{document} +\use[module=packages.retrograde,target=v0.15.0] \neverindent \nofolios \use[module=packages.masters] diff --git a/tests/bug-162.sil b/tests/bug-162.sil index acad9ffa6..87d6d6db1 100644 --- a/tests/bug-162.sil +++ b/tests/bug-162.sil @@ -1,4 +1,5 @@ \begin[papersize=a5]{document} +\use[module=packages.retrograde,target=v0.15.0] Both lines below should end in a period. \font[language=cs] diff --git a/tests/bug-1647.sil b/tests/bug-1647.sil index 82e70794c..09789db28 100644 --- a/tests/bug-1647.sil +++ b/tests/bug-1647.sil @@ -1,4 +1,5 @@ \begin[papersize=a7]{document} +\use[module=packages.retrograde,target=v0.15.0] \neverindent \nofolios \set[parameter=document.parskip, value=50pt] diff --git a/tests/bug-1674.sil b/tests/bug-1674.sil index 209af1e54..e8cb0a0d4 100644 --- a/tests/bug-1674.sil +++ b/tests/bug-1674.sil @@ -1,4 +1,5 @@ \begin[papersize=a6]{document} +\use[module=packages.retrograde,target=v0.15.0] \neverindent \nofolios \script{SILE.processString("Foo \\em{bar} \\em{baz}", "sil")} diff --git a/tests/bug-1708.sil b/tests/bug-1708.sil index cf6d14b1d..a1c498af0 100644 --- a/tests/bug-1708.sil +++ b/tests/bug-1708.sil @@ -1,4 +1,5 @@ \begin[papersize=a7,class=book]{document} +\use[module=packages.retrograde,target=v0.15.0] \neverindent \nofolios \set[parameter=document.letterspaceglue, value=5pt] @@ -9,4 +10,4 @@ Lorem ipsum\footnote{test} Lorem ipsum% Should still have letterspacing at 5pt -\end{document} \ No newline at end of file +\end{document} diff --git a/tests/bug-192.sil b/tests/bug-192.sil index f0a46b6a5..be773d121 100644 --- a/tests/bug-192.sil +++ b/tests/bug-192.sil @@ -1,4 +1,5 @@ \begin[papersize=a6]{document} +\use[module=packages.retrograde,target=v0.15.0] \nofolios \font[family=Noto Naskh Arabic,language=urd,size=18pt] \hbox\skip[height=95%fh] diff --git a/tests/bug-200.sil b/tests/bug-200.sil index ec9682e67..162b89f92 100644 --- a/tests/bug-200.sil +++ b/tests/bug-200.sil @@ -1,4 +1,5 @@ \begin[papersize=a6]{document} +\use[module=packages.retrograde,target=v0.15.0] \nofolios \font[family=Gentium Plus,size=16pt,language=en] \begin{raggedright} diff --git a/tests/bug-226.sil b/tests/bug-226.sil index 8a4876a90..35212e48c 100644 --- a/tests/bug-226.sil +++ b/tests/bug-226.sil @@ -1,4 +1,5 @@ \begin{document} +\use[module=packages.retrograde,target=v0.15.0] \hfill Filler content here: Par 1 (One) \hfill Par 2 (Two) @@ -8,4 +9,4 @@ \hfill Out, \hfill Caleb Maclennan -\end{document} \ No newline at end of file +\end{document} diff --git a/tests/bug-241.sil b/tests/bug-241.sil index 4d0d0a810..4ca7d2ccf 100644 --- a/tests/bug-241.sil +++ b/tests/bug-241.sil @@ -1,4 +1,5 @@ \begin[papersize=a6]{document} +\use[module=packages.retrograde,target=v0.15.0] \nofolios \font[family=Gentium Plus,size=9pt] \center{TITILE\break{}Then vfill to logo\vfill{}<logo>\par\break} diff --git a/tests/bug-243.sil b/tests/bug-243.sil index bf1377f40..9083807b8 100644 --- a/tests/bug-243.sil +++ b/tests/bug-243.sil @@ -1,4 +1,5 @@ \begin[papersize=a5]{document} +\use[module=packages.retrograde,target=v0.15.0] \nofolios \use[module=packages.leaders] \font[size=50pt] diff --git a/tests/bug-244.sil b/tests/bug-244.sil index 044c6462e..63bdb4412 100644 --- a/tests/bug-244.sil +++ b/tests/bug-244.sil @@ -1,3 +1,4 @@ \begin[papersize=a4,class=jplain,layout=tate]{document} +\use[module=packages.retrograde,target=v0.15.0] \latin-in-tate{Hello world.} \end{document} diff --git a/tests/bug-252.sil b/tests/bug-252.sil index 3c1f8e81f..6fed341b7 100644 --- a/tests/bug-252.sil +++ b/tests/bug-252.sil @@ -1,4 +1,5 @@ \begin[papersize=a7,class=book]{document} +\use[module=packages.retrograde,target=v0.15.0] \use[module=packages.frametricks] \use[module=packages.lorem] This is a test\footnote{What happens to frames?}. diff --git a/tests/bug-252a.sil b/tests/bug-252a.sil index b9a4c8840..0e8bd4593 100644 --- a/tests/bug-252a.sil +++ b/tests/bug-252a.sil @@ -1,7 +1,8 @@ \begin[papersize=a7,class=book]{document} +\use[module=packages.retrograde,target=v0.15.0] \use[module=packages.lorem] \use[module=packages.rebox] \footnote:separator{\skip[height=5pt]} \define[command=deepbox]{\rebox[depth=60pt,height=10pt]{x}} This is a test\footnote{\deepbox}. -\end{document} \ No newline at end of file +\end{document} diff --git a/tests/bug-254.sil b/tests/bug-254.sil index f9956afbf..6aa33e71a 100644 --- a/tests/bug-254.sil +++ b/tests/bug-254.sil @@ -1,4 +1,5 @@ \begin[papersize=a5]{document} +\use[module=packages.retrograde,target=v0.15.0] \raggedright{ \font[weight=600]{This} is a sample of bogus\break extra space. @@ -6,4 +7,4 @@ extra space. \font[weight=600]{This} does not have\break {}extra space. } -\end{document} \ No newline at end of file +\end{document} diff --git a/tests/bug-255.sil b/tests/bug-255.sil index bf9a2d019..3ea12f0d8 100644 --- a/tests/bug-255.sil +++ b/tests/bug-255.sil @@ -1,4 +1,5 @@ \begin[papersize=a6]{document} +\use[module=packages.retrograde,target=v0.15.0] \use[module=packages.frametricks] \script{ SILE.registerCommand("donothing", function (options, content) diff --git a/tests/bug-255b.sil b/tests/bug-255b.sil index 6c0293fe1..707bedd3e 100644 --- a/tests/bug-255b.sil +++ b/tests/bug-255b.sil @@ -1,4 +1,5 @@ \begin[papersize=a6]{document} +\use[module=packages.retrograde,target=v0.15.0] \use[module=packages.frametricks] \script{ SILE.registerCommand("donothing", function(o,c) diff --git a/tests/bug-262.sil b/tests/bug-262.sil index 091d21bbd..96881e880 100644 --- a/tests/bug-262.sil +++ b/tests/bug-262.sil @@ -1,4 +1,5 @@ \begin[papersize=a5]{document} +\use[module=packages.retrograde,target=v0.15.0] \nofolios \use[module=packages.lorem] \hbox diff --git a/tests/bug-264.sil b/tests/bug-264.sil index c29bd8d56..10072fe70 100644 --- a/tests/bug-264.sil +++ b/tests/bug-264.sil @@ -1,4 +1,5 @@ \begin[papersize=a7,class=book]{document} +\use[module=packages.retrograde,target=v0.15.0] \nofolios Footnote\skip[height=170pt plus 50pt] marker.\footnote{Same page\hfill\break as marker?} diff --git a/tests/bug-264b.sil b/tests/bug-264b.sil index ecaef722e..71afaea96 100644 --- a/tests/bug-264b.sil +++ b/tests/bug-264b.sil @@ -1,6 +1,7 @@ \begin[papersize=a5,class=book]{document} +\use[module=packages.retrograde,target=v0.15.0] % Note: The failure case for this involves an infinite loop when it -% erroniously matched penalty types that arent actually page breaks +% erroneously matched penalty types that aren't actually page breaks \use[module=packages.linespacing] \set[parameter=linespacing.method,value=fit-font] \set[parameter=linespacing.fit-font.extra-space,value=15pt plus 0.5pt minus 0.5pt] diff --git a/tests/bug-266.sil b/tests/bug-266.sil index 2294ba367..593cf29ad 100644 --- a/tests/bug-266.sil +++ b/tests/bug-266.sil @@ -1,4 +1,5 @@ \begin[papersize=a6]{document} +\use[module=packages.retrograde,target=v0.15.0] \nofolios Word\glue[width=1ex]to the wise diff --git a/tests/bug-269.sil b/tests/bug-269.sil index 091780cde..ec4a9a2fd 100644 --- a/tests/bug-269.sil +++ b/tests/bug-269.sil @@ -1,4 +1,5 @@ \begin[papersize=a6,class=book]{document} +\use[module=packages.retrograde,target=v0.15.0] \nofolios \font[family=Gentium Plus,size=10.1pt,language=tr] \use[module=packages.footnotes] diff --git a/tests/bug-283.sil b/tests/bug-283.sil index 7f0f3b724..d9a57cb1b 100644 --- a/tests/bug-283.sil +++ b/tests/bug-283.sil @@ -1,4 +1,5 @@ \begin[papersize=a6]{document} +\use[module=packages.retrograde,target=v0.15.0] \nofolios \font[family=Libertinus Serif,size=12.7pt,language=tr] \set[parameter=shaper.spacestretchfactor,value=1.2] diff --git a/tests/bug-284.sil b/tests/bug-284.sil index e87ced8c7..6c34b098c 100644 --- a/tests/bug-284.sil +++ b/tests/bug-284.sil @@ -1,4 +1,5 @@ \begin[papersize=a6]{document} +\use[module=packages.retrograde,target=v0.15.0] \nofolios \set[parameter=document.lskip,value=15pt] \set[parameter=document.rskip,value=10pt] diff --git a/tests/bug-301.sil b/tests/bug-301.sil index 379286497..98dcb2f80 100644 --- a/tests/bug-301.sil +++ b/tests/bug-301.sil @@ -1,4 +1,5 @@ \begin[papersize=a7,class=book]{document} +\use[module=packages.retrograde,target=v0.15.0] \use[module=packages.linespacing] \nofolios \font[family=Gentium Plus,size=9.5pt] diff --git a/tests/bug-309.sil b/tests/bug-309.sil index 6499873e8..7e7b3c38f 100644 --- a/tests/bug-309.sil +++ b/tests/bug-309.sil @@ -1,4 +1,5 @@ \begin[papersize=a6]{document} +\use[module=packages.retrograde,target=v0.15.0] \nofolios \set[parameter=document.parskip,value=2em plus 1em] Test par diff --git a/tests/bug-317.sil b/tests/bug-317.sil index dc0a729c2..ca86f4cb5 100644 --- a/tests/bug-317.sil +++ b/tests/bug-317.sil @@ -1,4 +1,5 @@ \begin[papersize=a6]{document} +\use[module=packages.retrograde,target=v0.15.0] \nofolios \use[module=packages.verbatim] \define[command=verbatim:font]{\set[parameter=font.family,value=Hack]} diff --git a/tests/bug-337.expected b/tests/bug-337.expected index a21541759..ed8b90595 100644 --- a/tests/bug-337.expected +++ b/tests/bug-337.expected @@ -1,69 +1,68 @@ -Set paper size 297.6377985 419.5275636 +Set paper size 209.7637818 297.6377985 Begin page -Mx 43.9370 -My 67.1949 +My 6.2500 Set font Gentium Plus;10;400;;normal;;;LTR T 21 20 19 83 87 w=22.8174 (210pt) -Mx 69.4140 +Mx 25.4770 T 2258 w=4.1016 (×) -Mx 76.1752 +Mx 32.2382 T 21 28 27 83 87 w=22.8174 (298pt) -Draw line 33.9370 60.9449 -10.0000 0.5000 -Draw line 43.9370 50.9449 0.5000 -10.0000 -Draw line 263.7008 60.9449 10.0000 0.5000 -Draw line 253.7008 50.9449 0.5000 -10.0000 -Draw line 33.9370 358.5827 -10.0000 0.5000 -Draw line 43.9370 368.5827 0.5000 10.0000 -Draw line 263.7008 358.5827 10.0000 0.5000 -Draw line 253.7008 368.5827 0.5000 10.0000 -Mx 53.9370 -My 47.9449 +Draw line -10.0000 0.0000 -20.0000 0.5000 +Draw line 0.0000 -10.0000 0.5000 -20.0000 +Draw line 219.7638 0.0000 20.0000 0.5000 +Draw line 209.7638 -10.0000 0.5000 -20.0000 +Draw line -10.0000 297.6378 -20.0000 0.5000 +Draw line 0.0000 307.6378 0.5000 20.0000 +Draw line 219.7638 297.6378 20.0000 0.5000 +Draw line 209.7638 307.6378 0.5000 20.0000 +Mx 10.0000 +My -14.0000 Set font Gentium Plus;6;400;;normal;;;LTR T 87 72 86 87 86 w=11.5371 (tests) -Mx 65.4741 +Mx 21.5371 T 18 w=2.8154 (/) -Mx 68.2895 +Mx 24.3525 T 69 88 74 w=9.1523 (bug) -Mx 77.4419 +Mx 33.5049 T 16 w=2.0215 (-) -Mx 79.4634 +Mx 35.5264 T 22 22 26 w=8.4463 (337) -Mx 87.9097 +Mx 43.9727 T 17 w=1.3740 (.) -Mx 89.2837 +Mx 45.3467 T 86 76 79 w=5.5693 (sil) New page -Mx 43.9370 -My 67.1949 +Mx 0.0000 +My 6.2500 Set font Gentium Plus;10;400;;normal;;;LTR T 21 20 19 83 87 w=22.8174 (210pt) -Mx 69.4140 +Mx 25.4770 T 2258 w=4.1016 (×) -Mx 76.1752 +Mx 32.2382 T 21 28 27 83 87 w=22.8174 (298pt) -Draw line 33.9370 60.9449 -10.0000 0.5000 -Draw line 43.9370 50.9449 0.5000 -10.0000 -Draw line 263.7008 60.9449 10.0000 0.5000 -Draw line 253.7008 50.9449 0.5000 -10.0000 -Draw line 33.9370 358.5827 -10.0000 0.5000 -Draw line 43.9370 368.5827 0.5000 10.0000 -Draw line 263.7008 358.5827 10.0000 0.5000 -Draw line 253.7008 368.5827 0.5000 10.0000 -Mx 53.9370 -My 47.9449 +Draw line -10.0000 0.0000 -20.0000 0.5000 +Draw line 0.0000 -10.0000 0.5000 -20.0000 +Draw line 219.7638 0.0000 20.0000 0.5000 +Draw line 209.7638 -10.0000 0.5000 -20.0000 +Draw line -10.0000 297.6378 -20.0000 0.5000 +Draw line 0.0000 307.6378 0.5000 20.0000 +Draw line 219.7638 297.6378 20.0000 0.5000 +Draw line 209.7638 307.6378 0.5000 20.0000 +Mx 10.0000 +My -14.0000 Set font Gentium Plus;6;400;;normal;;;LTR T 87 72 86 87 86 w=11.5371 (tests) -Mx 65.4741 +Mx 21.5371 T 18 w=2.8154 (/) -Mx 68.2895 +Mx 24.3525 T 69 88 74 w=9.1523 (bug) -Mx 77.4419 +Mx 33.5049 T 16 w=2.0215 (-) -Mx 79.4634 +Mx 35.5264 T 22 22 26 w=8.4463 (337) -Mx 87.9097 +Mx 43.9727 T 17 w=1.3740 (.) -Mx 89.2837 +Mx 45.3467 T 86 76 79 w=5.5693 (sil) End page Finish diff --git a/tests/bug-337.sil b/tests/bug-337.sil index abe69f27b..8c702824c 100644 --- a/tests/bug-337.sil +++ b/tests/bug-337.sil @@ -1,7 +1,9 @@ -\begin[papersize=a7,class=book]{document} +\begin[papersize=a7,class=book,sheetsize=a6]{document} +\use[module=packages.retrograde,target=v0.15.0] +\use[module=packages.color] \use[module=inc.bug-337] -\define[command=crop:header]{tests/bug-337.sil} -\crop:setup[papersize=a6] +\define[command=cropmarks:header]{tests/bug-337.sil} +\cropmarks:setup \nofolios \set[parameter=document.parindent,value=0] diff --git a/tests/bug-344.sil b/tests/bug-344.sil index 22a5388ae..43485b9fe 100644 --- a/tests/bug-344.sil +++ b/tests/bug-344.sil @@ -1,4 +1,5 @@ \begin[papersize=a5,class=book]{document} +\use[module=packages.retrograde,target=v0.15.0] \nofolios \define[command=mwe]{One, two. Buckle my shoe.\smallskip} diff --git a/tests/bug-353.sil b/tests/bug-353.sil index 636cb60e5..448668c47 100644 --- a/tests/bug-353.sil +++ b/tests/bug-353.sil @@ -1,5 +1,7 @@ \begin[papersize=a5]{document} +\use[module=packages.retrograde,target=v0.15.0] \use[module=packages.background] +\use[module=packages.color] \nofolios \background[color=#e9d8ba] \color[color=#5a4129]{Sepia baby.} diff --git a/tests/bug-355-tr-hyphenation.sil b/tests/bug-355-tr-hyphenation.sil index b0304a4f3..06ff668a3 100644 --- a/tests/bug-355-tr-hyphenation.sil +++ b/tests/bug-355-tr-hyphenation.sil @@ -1,4 +1,5 @@ \begin[papersize=a7]{document} +\use[module=packages.retrograde,target=v0.15.0] \nofolios \neverindent \set[parameter=shaper.variablespaces, value=false] diff --git a/tests/bug-39.sil b/tests/bug-39.sil index 87f1c6697..9d6127c4b 100644 --- a/tests/bug-39.sil +++ b/tests/bug-39.sil @@ -1,4 +1,5 @@ \begin[papersize=a5,class=book]{document} +\use[module=packages.retrograde,target=v0.15.0] \use[module=packages.frametricks] \right-running-head{First Line of Header\skip[height=8mm] Second Line of Header} \showframe[id=all] diff --git a/tests/bug-465-a.sil b/tests/bug-465-a.sil index 34651f9c2..a57bb8fda 100644 --- a/tests/bug-465-a.sil +++ b/tests/bug-465-a.sil @@ -1,3 +1,4 @@ \begin[papersize=a5]{document} +\use[module=packages.retrograde,target=v0.15.0] Hello \include[src=bug-465-b.sil]. -\end{document} \ No newline at end of file +\end{document} diff --git a/tests/bug-526.sil b/tests/bug-526.sil index 63395abe4..52edb662e 100644 --- a/tests/bug-526.sil +++ b/tests/bug-526.sil @@ -1,4 +1,5 @@ \begin[class=plain,papersize=a6]{document} +\use[module=packages.retrograde,target=v0.15.0] \nofolios \use[module=packages.frametricks] \use[module=packages.lorem] diff --git a/tests/bug-530.sil b/tests/bug-530.sil index 40ab0f816..d9fff3048 100644 --- a/tests/bug-530.sil +++ b/tests/bug-530.sil @@ -1,4 +1,5 @@ \begin[direction=RTL]{document} +\use[module=packages.retrograde,target=v0.15.0] \use[module=packages.lorem] \lorem @@ -7,4 +8,4 @@ \lorem -\end{document} \ No newline at end of file +\end{document} diff --git a/tests/bug-54.sil b/tests/bug-54.sil index 5807b4dc5..160a951cb 100644 --- a/tests/bug-54.sil +++ b/tests/bug-54.sil @@ -1,4 +1,5 @@ \begin[papersize=a6]{document} +\use[module=packages.retrograde,target=v0.15.0] \nofolios \font[family=Gentium Plus,size=12pt] \set[parameter=document.parindent,value=10mm] diff --git a/tests/bug-583.sil b/tests/bug-583.sil index e843838d5..f8e33b50c 100644 --- a/tests/bug-583.sil +++ b/tests/bug-583.sil @@ -1,4 +1,5 @@ \begin[papersize=a6]{document} +\use[module=packages.retrograde,target=v0.15.0] \neverindent \nofolios \define[command=ah]{\discretionary[prebreak=-, replacement=’]} diff --git a/tests/bug-61.sil b/tests/bug-61.sil index 8a4efd80a..95218e40d 100644 --- a/tests/bug-61.sil +++ b/tests/bug-61.sil @@ -1,4 +1,5 @@ \begin[papersize=a6,class=book]{document} +\use[module=packages.retrograde,target=v0.15.0] \use[module=packages.frametricks] \begin[first-content-frame=frame1]{pagetemplate} \frame[id=frame1,left=left(content),right=right(content),height=18pt,top=top(content),next=frame2] diff --git a/tests/bug-62.sil b/tests/bug-62.sil index 6d87df13d..f1b91a0f4 100644 --- a/tests/bug-62.sil +++ b/tests/bug-62.sil @@ -1,4 +1,5 @@ \begin[papersize=a5]{document} +\use[module=packages.retrograde,target=v0.15.0] First paragraph %comment diff --git a/tests/bug-621.sil b/tests/bug-621.sil index 9fd878b1d..ba5b5056f 100644 --- a/tests/bug-621.sil +++ b/tests/bug-621.sil @@ -1,4 +1,5 @@ \begin{document} +\use[module=packages.retrograde,target=v0.15.0] \font[language=fr, size=15pt] La peine de mort est nécessaire, disent les partisans de l’antique et barbare routine ; sans elle il n’est point de frein assez puissant pour le crime. Qui vous l’a dit ? Avez-vous calculé tous les ressorts par lesquels les lois pénales peuvent agir sur la sensibilité humaine ? Hélas ! avant la mort, combien de douleurs physiques et morales l’homme ne peut-il pas endurer ! diff --git a/tests/bug-702.sil b/tests/bug-702.sil index 0c6b9b9c7..a101a6898 100644 --- a/tests/bug-702.sil +++ b/tests/bug-702.sil @@ -1,4 +1,5 @@ \begin[papersize=a6]{document} +\use[module=packages.retrograde,target=v0.15.0] \language[main=fr] Il était une fois, dans un pays très lointain (dont le nom périlleux ne doit pas être prononcé), vivait Bernadette, qui nous disait « Rien d’important! » As-tu entendu? \end{document} diff --git a/tests/bug-704.sil b/tests/bug-704.sil index 2205eba4f..18e4b9479 100644 --- a/tests/bug-704.sil +++ b/tests/bug-704.sil @@ -1,4 +1,5 @@ \begin[papersize=6in x 9in]{document} +\use[module=packages.retrograde,target=v0.15.0] \nofolios \language[main=fr] @@ -10,7 +11,7 @@ Cinq : « Six ‹ Sept › `Huit » ! Treize ; Quatorze… ! -Quinze (?), ?!, [!], …? etc. +Quinze (?), ?!, [!], …? etc. Un! Deux? Trois!? Quatre!!! @@ -21,6 +22,6 @@ Cinq: «Six ‹Sept› `Huit»! Treize; Quatorze…! -Quinze ( ?), ? !, [ !], … ? etc. +Quinze ( ?), ? !, [ !], … ? etc. \end{document} diff --git a/tests/bug-76.sil b/tests/bug-76.sil index dc7bdd0bc..6e06e48da 100644 --- a/tests/bug-76.sil +++ b/tests/bug-76.sil @@ -1,4 +1,5 @@ \begin[papersize=a6]{document} +\use[module=packages.retrograde,target=v0.15.0] \nofolios \use[module=packages.bidi] \thisframeRTL diff --git a/tests/bug-79.sil b/tests/bug-79.sil index 3178b8df4..28b72c312 100644 --- a/tests/bug-79.sil +++ b/tests/bug-79.sil @@ -1,4 +1,5 @@ \begin[papersize=a6]{document} +\use[module=packages.retrograde,target=v0.15.0] \nofolios \begin[first-content-frame=frame]{pagetemplate} \frame[id=frame, left=2cm, width=5.8cm, top=2cm, bottom=10cm] diff --git a/tests/bug-80.sil b/tests/bug-80.sil index 90889a074..063a92cb8 100644 --- a/tests/bug-80.sil +++ b/tests/bug-80.sil @@ -1,4 +1,5 @@ \begin[papersize=a5]{document} +\use[module=packages.retrograde,target=v0.15.0] \define[command=item]{\quad – \process} diff --git a/tests/bug-865.sil b/tests/bug-865.sil index 8b2bb3012..b82a36eb5 100644 --- a/tests/bug-865.sil +++ b/tests/bug-865.sil @@ -1,4 +1,5 @@ \begin[papersize=a6]{document} +\use[module=packages.retrograde,target=v0.15.0] \nofolios \use[module=packages.pullquote] \use[module=packages.lorem] diff --git a/tests/bug-990.sil b/tests/bug-990.sil index 0ef9a521a..c12087fb2 100644 --- a/tests/bug-990.sil +++ b/tests/bug-990.sil @@ -1,4 +1,5 @@ \begin[papersize=a6,class=book]{document} +\use[module=packages.retrograde,target=v0.15.0] \neverindent \define[command=open-spread]{} \nofolios diff --git a/tests/centering.sil b/tests/centering.sil index 702321fff..b0ae8b687 100644 --- a/tests/centering.sil +++ b/tests/centering.sil @@ -1,4 +1,5 @@ \begin[papersize=a5]{document} +\use[module=packages.retrograde,target=v0.15.0] \use[module=packages.lorem] \ragged[right=true,left=true]{\lorem[words=100]} diff --git a/tests/chapterverse.sil b/tests/chapterverse.sil index d309b318a..ded8997a1 100644 --- a/tests/chapterverse.sil +++ b/tests/chapterverse.sil @@ -1,4 +1,5 @@ \begin[papersize=a7,class=bible]{document} +\use[module=packages.retrograde,target=v0.15.0] \nofolios \font[family=Gentium Plus] \begin{script} diff --git a/tests/combining.sil b/tests/combining.sil index 89c079f75..7ee1c4c6b 100644 --- a/tests/combining.sil +++ b/tests/combining.sil @@ -1,4 +1,5 @@ \begin[papersize=a6]{document} +\use[module=packages.retrograde,target=v0.15.0] \nofolios \font[family=Gentium Plus,size=24pt] Ầ Ầ diff --git a/tests/counters.sil b/tests/counters.sil index 6d581dc95..d6599a40e 100644 --- a/tests/counters.sil +++ b/tests/counters.sil @@ -1,5 +1,6 @@ \begin[papersize=a6]{document} \nofolios +\use[module=packages.retrograde,target=v0.15.0] \set[parameter=document.parindent,value=0pt] \font[family=Libertinus Serif] \use[module=packages.counters] diff --git a/tests/cursive-shaping.sil b/tests/cursive-shaping.sil index a70023414..57d3bd45d 100644 --- a/tests/cursive-shaping.sil +++ b/tests/cursive-shaping.sil @@ -1,4 +1,5 @@ \begin[papersize=a6,direction=RTL]{document} +\use[module=packages.retrograde,target=v0.15.0] \nofolios \neverindent \language[main=ar] diff --git a/tests/disappearing-skip.sil b/tests/disappearing-skip.sil index 5300b852e..34cf537f2 100644 --- a/tests/disappearing-skip.sil +++ b/tests/disappearing-skip.sil @@ -1,4 +1,5 @@ \begin[papersize=129mm x 198mm]{document} +\use[module=packages.retrograde,target=v0.15.0] Para 1. \skip[height=155mm] diff --git a/tests/dropcaps-descenders.expected b/tests/dropcaps-descenders.expected new file mode 100644 index 000000000..2e26616c4 --- /dev/null +++ b/tests/dropcaps-descenders.expected @@ -0,0 +1,947 @@ +Set paper size 297.6377985 419.5275636 +Begin page +Mx 32.5576 +My 28.9514 +Mx 14.8819 +My 55.3514 +Set font Cormorant Infant;53.24;400;;normal;;;LTR +T 74 w=17.6757 (I) +Mx 32.5576 +My 28.9514 +Set font Cormorant Infant;11;400;;normal;;;LTR +T 550 597 679 w=12.3310 (bis) +Mx 49.8658 +Mx 2.8380 +Mx 5.2690 +Mx 3.8720 +Mx 4.4880 +Mx 8.3930 +T 620 a=2.8380 642 a=5.2690 672 a=4.0040 563 a=4.4880 629 a=8.3930 (lorem) +Mx 79.7030 +T 597 669 679 699 629 w=26.1580 (ipsum) +Mx 110.8381 +T 557 642 620 642 672 w=23.0120 (dolor) +Mx 138.8273 +T 679 597 690 w=10.4390 (sit) +Mx 154.2435 +T 522 629 563 690 w=21.9890 (amet) +Mx 176.2325 +T 2367 w=2.4420 (,) +Mx 183.6517 +Mx 4.4550 +Mx 5.2690 +Mx 5.6870 +Mx 3.7180 +Mx 4.4220 +Mx 4.5210 +Mx 3.7180 +Mx 4.4880 +Mx 3.7180 +Mx 5.4230 +Mx 4.0040 +T 551 a=4.5210 642 a=5.2690 632 a=5.6870 679 a=3.7180 563 a=4.4880 551 a=4.5210 690 a=3.7180 563 a=4.4880 690 a=3.7180 699 a=5.4230 672 a=4.0040 (consectetur) +Mx 238.0519 +T 522 557 597 669 597 679 551 597 632 583 w=44.7040 (adipiscing) +Mx 32.5576 +My 42.1514 +T 563 620 597 690 w=14.0470 (elit) +Mx 46.6046 +T 2366 w=2.1670 (.) +Mx 51.8575 +Mx 5.4010 +Mx 4.4220 +Mx 5.6320 +T 152 a=5.4010 563 a=4.4880 557 a=5.6320 (Sed) +Mx 70.3984 +T 632 642 632 w=16.6430 (non) +Mx 90.1273 +T 672 597 679 699 679 w=19.8660 (risus) +Mx 109.9933 +T 2366 w=2.1670 (.) +Mx 115.2462 +Mx 5.4010 +Mx 5.4230 +Mx 3.7180 +Mx 5.6210 +Mx 4.4880 +Mx 5.6870 +Mx 5.6320 +Mx 3.0030 +Mx 3.6520 +Mx 3.7180 +Mx 4.4880 +T 152 a=5.4010 699 a=5.4230 679 a=3.7180 669 a=5.6210 563 a=4.4880 632 a=5.6870 557 a=5.6320 597 a=3.0030 679 a=3.7180 679 a=3.7180 563 a=4.4880 (Suspendisse) +Mx 169.1632 +Mx 2.8380 +Mx 4.4220 +Mx 4.5210 +Mx 3.7180 +Mx 5.4230 +Mx 3.7180 +T 620 a=2.8380 563 a=4.4880 551 a=4.5210 690 a=3.7180 699 a=5.4230 679 a=3.7180 (lectus) +Mx 196.8891 +Mx 3.7180 +Mx 5.2690 +Mx 4.0040 +Mx 3.7180 +Mx 5.2690 +Mx 3.6190 +T 690 a=3.7180 642 a=5.2690 672 a=4.0040 690 a=3.7180 642 a=5.2690 672 a=4.0040 (tortor) +T 2367 w=2.4420 (,) +Mx 228.0140 +Mx 5.6320 +Mx 3.0030 +Mx 5.1260 +Mx 5.6870 +Mx 3.0030 +Mx 3.6520 +Mx 3.7180 +Mx 3.0030 +Mx 8.3930 +T 557 a=5.6320 597 a=3.0030 583 a=5.1260 632 a=5.6870 597 a=3.0030 679 a=3.7180 679 a=3.7180 597 a=3.0030 629 a=8.3930 (dignissim) +Mx 272.3169 +T 679 597 690 w=10.4390 (sit) +Mx 32.5576 +My 55.3514 +T 522 629 563 690 w=21.9890 (amet) +Mx 54.5466 +T 2367 w=2.4420 (,) +Mx 59.8208 +T 522 557 597 669 597 679 551 597 632 583 w=44.7040 (adipiscing) +Mx 107.3570 +Mx 5.6870 +Mx 4.4220 +Mx 4.5210 +T 632 a=5.6870 563 a=4.4880 551 a=4.5210 (nec) +T 2367 w=2.4420 (,) +Mx 127.2611 +T 699 620 690 672 597 551 597 563 679 w=34.7160 (ultricies) +Mx 164.8093 +Mx 3.7180 +Mx 4.4220 +Mx 5.6320 +T 679 a=3.7180 563 a=4.4880 557 a=5.6320 (sed) +T 2367 w=2.4420 (,) +Mx 183.8555 +Mx 5.6320 +Mx 5.2690 +Mx 2.8380 +Mx 5.2690 +Mx 3.6190 +T 557 a=5.6320 642 a=5.2690 620 a=2.8380 642 a=5.2690 672 a=4.0040 (dolor) +T 2366 w=2.1670 (.) +Mx 211.4817 +Mx 7.5460 +Mx 3.8720 +Mx 5.3900 +Mx 3.7180 +T 30 a=7.5460 672 a=4.0040 522 a=5.3900 679 a=3.7180 (Cras) +Mx 234.8399 +T 563 620 563 629 563 632 690 699 629 w=47.9160 (elementum) +Mx 14.8819 +My 68.5514 +Mx 5.4230 +Mx 2.8380 +Mx 3.7180 +Mx 4.0040 +Mx 3.0030 +Mx 4.4550 +Mx 4.4880 +Mx 3.7180 +T 699 a=5.4230 620 a=2.8380 690 a=3.7180 672 a=4.0040 597 a=3.0030 551 a=4.5210 563 a=4.4880 679 a=3.7180 (ultrices) +Mx 49.6445 +T 557 597 522 629 w=22.4180 (diam) +Mx 72.0625 +T 2366 w=2.1670 (.) +Mx 27.2116 +My 81.7514 +Mx 14.8819 +My 98.8083 +Set font Cormorant Infant;38.2911;400;;normal;;;LTR +T 88 w=12.3297 (J) +Mx 27.2116 +My 81.7514 +Set font Cormorant Infant;11;400;;normal;;;LTR +T 522 632 699 522 w=21.8900 (anua) +Mx 53.4770 +Mx 2.8380 +Mx 5.2690 +Mx 3.8720 +Mx 4.4880 +Mx 8.3930 +T 620 a=2.8380 642 a=5.2690 672 a=4.0040 563 a=4.4880 629 a=8.3930 (lorem) +Mx 82.7123 +T 597 669 679 699 629 w=26.1580 (ipsum) +Mx 113.2456 +T 557 642 620 642 672 w=23.0120 (dolor) +Mx 140.6329 +T 679 597 690 w=10.4390 (sit) +Mx 155.4473 +T 522 629 563 690 w=21.9890 (amet) +Mx 177.4363 +T 2367 w=2.4420 (,) +Mx 184.2536 +Mx 4.4550 +Mx 5.2690 +Mx 5.6870 +Mx 3.7180 +Mx 4.4220 +Mx 4.5210 +Mx 3.7180 +Mx 4.4880 +Mx 3.7180 +Mx 5.4230 +Mx 4.0040 +T 551 a=4.5210 642 a=5.2690 632 a=5.6870 679 a=3.7180 563 a=4.4880 551 a=4.5210 690 a=3.7180 563 a=4.4880 690 a=3.7180 699 a=5.4230 672 a=4.0040 (consectetur) +Mx 238.0519 +T 522 557 597 669 597 679 551 597 632 583 w=44.7040 (adipiscing) +Mx 27.2116 +My 94.9514 +T 563 620 597 690 w=14.0470 (elit) +Mx 41.2586 +T 2366 w=2.1670 (.) +Mx 47.1798 +Mx 5.4010 +Mx 4.4220 +Mx 5.6320 +T 152 a=5.4010 563 a=4.4880 557 a=5.6320 (Sed) +Mx 66.3890 +T 632 642 632 w=16.6430 (non) +Mx 86.7861 +T 672 597 679 699 679 w=19.8660 (risus) +Mx 106.6521 +T 2366 w=2.1670 (.) +Mx 112.5733 +Mx 5.4010 +Mx 5.4230 +Mx 3.7180 +Mx 5.6210 +Mx 4.4880 +Mx 5.6870 +Mx 5.6320 +Mx 3.0030 +Mx 3.6520 +Mx 3.7180 +Mx 4.4880 +T 152 a=5.4010 699 a=5.4230 679 a=3.7180 669 a=5.6210 563 a=4.4880 632 a=5.6870 557 a=5.6320 597 a=3.0030 679 a=3.7180 679 a=3.7180 563 a=4.4880 (Suspendisse) +Mx 167.1584 +Mx 2.8380 +Mx 4.4220 +Mx 4.5210 +Mx 3.7180 +Mx 5.4230 +Mx 3.7180 +T 620 a=2.8380 563 a=4.4880 551 a=4.5210 690 a=3.7180 699 a=5.4230 679 a=3.7180 (lectus) +Mx 195.5526 +Mx 3.7180 +Mx 5.2690 +Mx 4.0040 +Mx 3.7180 +Mx 5.2690 +Mx 3.6190 +T 690 a=3.7180 642 a=5.2690 672 a=4.0040 690 a=3.7180 642 a=5.2690 672 a=4.0040 (tortor) +T 2367 w=2.4420 (,) +Mx 227.3457 +Mx 5.6320 +Mx 3.0030 +Mx 5.1260 +Mx 5.6870 +Mx 3.0030 +Mx 3.6520 +Mx 3.7180 +Mx 3.0030 +Mx 8.3930 +T 557 a=5.6320 597 a=3.0030 583 a=5.1260 632 a=5.6870 597 a=3.0030 679 a=3.7180 679 a=3.7180 597 a=3.0030 629 a=8.3930 (dignissim) +Mx 272.3169 +T 679 597 690 w=10.4390 (sit) +Mx 27.2116 +My 108.1514 +T 522 629 563 690 w=21.9890 (amet) +Mx 49.2006 +T 2367 w=2.4420 (,) +Mx 55.2385 +T 522 557 597 669 597 679 551 597 632 583 w=44.7040 (adipiscing) +Mx 103.5384 +Mx 5.6870 +Mx 4.4220 +Mx 4.5210 +T 632 a=5.6870 563 a=4.4880 551 a=4.5210 (nec) +T 2367 w=2.4420 (,) +Mx 124.2063 +T 699 620 690 672 597 551 597 563 679 w=34.7160 (ultricies) +Mx 162.5182 +Mx 3.7180 +Mx 4.4220 +Mx 5.6320 +T 679 a=3.7180 563 a=4.4880 557 a=5.6320 (sed) +T 2367 w=2.4420 (,) +Mx 182.3281 +Mx 5.6320 +Mx 5.2690 +Mx 2.8380 +Mx 5.2690 +Mx 3.6190 +T 557 a=5.6320 642 a=5.2690 620 a=2.8380 642 a=5.2690 672 a=4.0040 (dolor) +T 2366 w=2.1670 (.) +Mx 210.7180 +Mx 7.5460 +Mx 3.8720 +Mx 5.3900 +Mx 3.7180 +T 30 a=7.5460 672 a=4.0040 522 a=5.3900 679 a=3.7180 (Cras) +Mx 234.8399 +T 563 620 563 629 563 632 690 699 629 w=47.9160 (elementum) +Mx 14.8819 +My 121.3514 +Mx 5.4230 +Mx 2.8380 +Mx 3.7180 +Mx 4.0040 +Mx 3.0030 +Mx 4.4550 +Mx 4.4880 +Mx 3.7180 +T 699 a=5.4230 620 a=2.8380 690 a=3.7180 672 a=4.0040 597 a=3.0030 551 a=4.5210 563 a=4.4880 679 a=3.7180 (ultrices) +Mx 49.6445 +T 557 597 522 629 w=22.4180 (diam) +Mx 72.0625 +T 2366 w=2.1670 (.) +Mx 32.0252 +My 134.5514 +Mx 14.8819 +My 160.9514 +Set font Cormorant Infant;53.24;400;;normal;;;LTR +T 88 w=17.1433 (J) +Mx 32.0252 +My 134.5514 +Set font Cormorant Infant;11;400;;normal;;;LTR +T 522 632 699 522 w=21.8900 (anua) +Mx 57.6028 +Mx 2.8380 +Mx 5.2690 +Mx 3.8720 +Mx 4.4880 +Mx 8.3930 +T 620 a=2.8380 642 a=5.2690 672 a=4.0040 563 a=4.4880 629 a=8.3930 (lorem) +Mx 86.1505 +T 597 669 679 699 629 w=26.1580 (ipsum) +Mx 115.9962 +T 557 642 620 642 672 w=23.0120 (dolor) +Mx 142.6959 +T 679 597 690 w=10.4390 (sit) +Mx 156.8226 +T 522 629 563 690 w=21.9890 (amet) +Mx 178.8116 +T 2367 w=2.4420 (,) +Mx 184.9412 +Mx 4.4550 +Mx 5.2690 +Mx 5.6870 +Mx 3.7180 +Mx 4.4220 +Mx 4.5210 +Mx 3.7180 +Mx 4.4880 +Mx 3.7180 +Mx 5.4230 +Mx 4.0040 +T 551 a=4.5210 642 a=5.2690 632 a=5.6870 679 a=3.7180 563 a=4.4880 551 a=4.5210 690 a=3.7180 563 a=4.4880 690 a=3.7180 699 a=5.4230 672 a=4.0040 (consectetur) +Mx 238.0519 +T 522 557 597 669 597 679 551 597 632 583 w=44.7040 (adipiscing) +Mx 32.0252 +My 147.7514 +T 563 620 597 690 w=14.0470 (elit) +Mx 46.0722 +T 2366 w=2.1670 (.) +Mx 51.3916 +Mx 5.4010 +Mx 4.4220 +Mx 5.6320 +T 152 a=5.4010 563 a=4.4880 557 a=5.6320 (Sed) +Mx 69.9991 +T 632 642 632 w=16.6430 (non) +Mx 89.7946 +T 672 597 679 699 679 w=19.8660 (risus) +Mx 109.6606 +T 2366 w=2.1670 (.) +Mx 114.9800 +Mx 5.4010 +Mx 5.4230 +Mx 3.7180 +Mx 5.6210 +Mx 4.4880 +Mx 5.6870 +Mx 5.6320 +Mx 3.0030 +Mx 3.6520 +Mx 3.7180 +Mx 4.4880 +T 152 a=5.4010 699 a=5.4230 679 a=3.7180 669 a=5.6210 563 a=4.4880 632 a=5.6870 557 a=5.6320 597 a=3.0030 679 a=3.7180 679 a=3.7180 563 a=4.4880 (Suspendisse) +Mx 168.9635 +Mx 2.8380 +Mx 4.4220 +Mx 4.5210 +Mx 3.7180 +Mx 5.4230 +Mx 3.7180 +T 620 a=2.8380 563 a=4.4880 551 a=4.5210 690 a=3.7180 699 a=5.4230 679 a=3.7180 (lectus) +Mx 196.7560 +Mx 3.7180 +Mx 5.2690 +Mx 4.0040 +Mx 3.7180 +Mx 5.2690 +Mx 3.6190 +T 690 a=3.7180 642 a=5.2690 672 a=4.0040 690 a=3.7180 642 a=5.2690 672 a=4.0040 (tortor) +T 2367 w=2.4420 (,) +Mx 227.9474 +Mx 5.6320 +Mx 3.0030 +Mx 5.1260 +Mx 5.6870 +Mx 3.0030 +Mx 3.6520 +Mx 3.7180 +Mx 3.0030 +Mx 8.3930 +T 557 a=5.6320 597 a=3.0030 583 a=5.1260 632 a=5.6870 597 a=3.0030 679 a=3.7180 679 a=3.7180 597 a=3.0030 629 a=8.3930 (dignissim) +Mx 272.3169 +T 679 597 690 w=10.4390 (sit) +Mx 32.0252 +My 160.9514 +T 522 629 563 690 w=21.9890 (amet) +Mx 54.0142 +T 2367 w=2.4420 (,) +Mx 59.3644 +T 522 557 597 669 597 679 551 597 632 583 w=44.7040 (adipiscing) +Mx 106.9767 +Mx 5.6870 +Mx 4.4220 +Mx 4.5210 +T 632 a=5.6870 563 a=4.4880 551 a=4.5210 (nec) +T 2367 w=2.4420 (,) +Mx 126.9569 +T 699 620 690 672 597 551 597 563 679 w=34.7160 (ultricies) +Mx 164.5812 +Mx 3.7180 +Mx 4.4220 +Mx 5.6320 +T 679 a=3.7180 563 a=4.4880 557 a=5.6320 (sed) +T 2367 w=2.4420 (,) +Mx 183.7034 +Mx 5.6320 +Mx 5.2690 +Mx 2.8380 +Mx 5.2690 +Mx 3.6190 +T 557 a=5.6320 642 a=5.2690 620 a=2.8380 642 a=5.2690 672 a=4.0040 (dolor) +T 2366 w=2.1670 (.) +Mx 211.4057 +Mx 7.5460 +Mx 3.8720 +Mx 5.3900 +Mx 3.7180 +T 30 a=7.5460 672 a=4.0040 522 a=5.3900 679 a=3.7180 (Cras) +Mx 234.8399 +T 563 620 563 629 563 632 690 699 629 w=47.9160 (elementum) +Mx 32.0252 +My 174.1514 +Mx 5.4230 +Mx 2.8380 +Mx 3.7180 +Mx 4.0040 +Mx 3.0030 +Mx 4.4550 +Mx 4.4880 +Mx 3.7180 +T 699 a=5.4230 620 a=2.8380 690 a=3.7180 672 a=4.0040 597 a=3.0030 551 a=4.5210 563 a=4.4880 679 a=3.7180 (ultrices) +Mx 68.4284 +T 557 597 522 629 w=22.4180 (diam) +Mx 90.8464 +T 2366 w=2.1670 (.) +Mx 97.7697 +Mx 9.1960 +Mx 5.3900 +Mx 4.4220 +Mx 4.4550 +Mx 4.4880 +Mx 5.6870 +Mx 5.3900 +Mx 3.7180 +T 103 a=9.1960 522 a=5.3900 563 a=4.4880 551 a=4.5210 563 a=4.4880 632 a=5.6870 522 a=5.3900 679 a=3.7180 (Maecenas) +Mx 145.2719 +T 620 597 583 699 620 522 w=24.6180 (ligula) +Mx 174.6462 +Mx 8.3930 +Mx 5.3900 +Mx 3.6520 +Mx 3.7180 +Mx 5.3900 +T 629 a=8.3930 522 a=5.3900 679 a=3.7180 679 a=3.7180 522 a=5.3900 (massa) +T 2367 w=2.4420 (,) +Mx 208.3874 +T 723 522 672 597 699 679 w=26.3120 (varius) +Mx 239.4557 +T 522 w=5.3900 (a) +Mx 244.8457 +T 2367 w=2.4420 (,) +Mx 252.0439 +T 679 563 629 669 563 672 w=30.7120 (semper) +Mx 14.8819 +My 187.3514 +Mx 4.4550 +Mx 5.2690 +Mx 5.6870 +Mx 5.1260 +Mx 5.4230 +Mx 4.4880 +T 551 a=4.5210 642 a=5.2690 632 a=5.6870 583 a=5.1260 699 a=5.4230 563 a=4.4880 (congue) +T 2367 w=2.4420 (,) +Mx 50.8809 +T 563 699 597 679 629 642 557 w=35.9260 (euismod) +Mx 89.9159 +T 632 642 632 w=16.6430 (non) +Mx 106.5589 +T 2367 w=2.4420 (,) +Mx 112.1099 +T 629 597 w=11.3960 (mi) +Mx 123.5059 +T 2366 w=2.1670 (.) +Mx 39.2060 +My 200.5514 +Mx 14.8819 +My 213.7514 +Set font Cormorant Infant;31.7547;400;;normal;;;LTR +T 115 w=24.3241 (O) +Mx 39.2060 +My 200.5514 +Set font Cormorant Infant;11;400;;normal;;;LTR +T 557 642 679 w=14.6190 (dos) +Mx 57.5256 +Mx 2.8380 +Mx 5.2690 +Mx 3.8720 +Mx 4.4880 +Mx 8.3930 +T 620 a=2.8380 642 a=5.2690 672 a=4.0040 563 a=4.4880 629 a=8.3930 (lorem) +Mx 86.0861 +T 597 669 679 699 629 w=26.1580 (ipsum) +Mx 115.9447 +T 557 642 620 642 672 w=23.0120 (dolor) +Mx 142.6572 +T 679 597 690 w=10.4390 (sit) +Mx 156.7968 +T 522 629 563 690 w=21.9890 (amet) +Mx 178.7858 +T 2367 w=2.4420 (,) +Mx 184.9284 +Mx 4.4550 +Mx 5.2690 +Mx 5.6870 +Mx 3.7180 +Mx 4.4220 +Mx 4.5210 +Mx 3.7180 +Mx 4.4880 +Mx 3.7180 +Mx 5.4230 +Mx 4.0040 +T 551 a=4.5210 642 a=5.2690 632 a=5.6870 679 a=3.7180 563 a=4.4880 551 a=4.5210 690 a=3.7180 563 a=4.4880 690 a=3.7180 699 a=5.4230 672 a=4.0040 (consectetur) +Mx 238.0519 +T 522 557 597 669 597 679 551 597 632 583 w=44.7040 (adipiscing) +Mx 39.2060 +My 213.7514 +T 563 620 597 690 w=14.0470 (elit) +Mx 53.2530 +T 2366 w=2.1670 (.) +Mx 59.4883 +Mx 5.4010 +Mx 4.4220 +Mx 5.6320 +T 152 a=5.4010 563 a=4.4880 557 a=5.6320 (Sed) +Mx 79.0115 +T 632 642 632 w=16.6430 (non) +Mx 99.7228 +T 672 597 679 699 679 w=19.8660 (risus) +Mx 119.5888 +T 2366 w=2.1670 (.) +Mx 125.8241 +Mx 5.4010 +Mx 5.4230 +Mx 3.7180 +Mx 5.6210 +Mx 4.4880 +Mx 5.6870 +Mx 5.6320 +Mx 3.0030 +Mx 3.6520 +Mx 3.7180 +Mx 4.4880 +T 152 a=5.4010 699 a=5.4230 679 a=3.7180 669 a=5.6210 563 a=4.4880 632 a=5.6870 557 a=5.6320 597 a=3.0030 679 a=3.7180 679 a=3.7180 563 a=4.4880 (Suspendisse) +Mx 180.7234 +Mx 2.8380 +Mx 4.4220 +Mx 4.5210 +Mx 3.7180 +Mx 5.4230 +Mx 3.7180 +T 620 a=2.8380 563 a=4.4880 551 a=4.5210 690 a=3.7180 699 a=5.4230 679 a=3.7180 (lectus) +Mx 209.4316 +Mx 3.7180 +Mx 5.2690 +Mx 4.0040 +Mx 3.7180 +Mx 5.2690 +Mx 3.6190 +T 690 a=3.7180 642 a=5.2690 672 a=4.0040 690 a=3.7180 642 a=5.2690 672 a=4.0040 (tortor) +T 2367 w=2.4420 (,) +Mx 241.5389 +Mx 5.6320 +Mx 3.0030 +Mx 5.1260 +Mx 5.6870 +Mx 3.0030 +Mx 3.6520 +Mx 3.7180 +Mx 3.0030 +Mx 8.3930 +T 557 a=5.6320 597 a=3.0030 583 a=5.1260 632 a=5.6870 597 a=3.0030 679 a=3.7180 679 a=3.7180 597 a=3.0030 629 a=8.3930 (dignissim) +Mx 14.8819 +My 226.9514 +T 679 597 690 w=10.4390 (sit) +Mx 28.7036 +T 522 629 563 690 w=21.9890 (amet) +Mx 50.6926 +T 2367 w=2.4420 (,) +Mx 56.5174 +T 522 557 597 669 597 679 551 597 632 583 w=44.7040 (adipiscing) +Mx 104.6041 +Mx 5.6870 +Mx 4.4220 +Mx 4.5210 +T 632 a=5.6870 563 a=4.4880 551 a=4.5210 (nec) +T 2367 w=2.4420 (,) +Mx 125.0589 +T 699 620 690 672 597 551 597 563 679 w=34.7160 (ultricies) +Mx 163.1577 +Mx 3.7180 +Mx 4.4220 +Mx 5.6320 +T 679 a=3.7180 563 a=4.4880 557 a=5.6320 (sed) +T 2367 w=2.4420 (,) +Mx 182.7544 +Mx 5.6320 +Mx 5.2690 +Mx 2.8380 +Mx 5.2690 +Mx 3.6190 +T 557 a=5.6320 642 a=5.2690 620 a=2.8380 642 a=5.2690 672 a=4.0040 (dolor) +T 2366 w=2.1670 (.) +Mx 210.9312 +Mx 7.5460 +Mx 3.8720 +Mx 5.3900 +Mx 3.7180 +T 30 a=7.5460 672 a=4.0040 522 a=5.3900 679 a=3.7180 (Cras) +Mx 234.8399 +T 563 620 563 629 563 632 690 699 629 w=47.9160 (elementum) +Mx 14.8819 +My 240.1514 +Mx 5.4230 +Mx 2.8380 +Mx 3.7180 +Mx 4.0040 +Mx 3.0030 +Mx 4.4550 +Mx 4.4880 +Mx 3.7180 +T 699 a=5.4230 620 a=2.8380 690 a=3.7180 672 a=4.0040 597 a=3.0030 551 a=4.5210 563 a=4.4880 679 a=3.7180 (ultrices) +Mx 49.6445 +T 557 597 522 629 w=22.4180 (diam) +Mx 72.0625 +T 2366 w=2.1670 (.) +Mx 33.7709 +My 253.3514 +Mx 14.8819 +My 262.0387 +Set font Cormorant Infant;24.6593;400;;normal;;;LTR +T 144 w=18.8890 (Q) +Mx 33.7709 +My 253.3514 +Set font Cormorant Infant;11;400;;normal;;;LTR +T 699 642 w=10.6920 (uo) +Mx 49.5009 +Mx 2.8380 +Mx 5.2690 +Mx 3.8720 +Mx 4.4880 +Mx 8.3930 +T 620 a=2.8380 642 a=5.2690 672 a=4.0040 563 a=4.4880 629 a=8.3930 (lorem) +Mx 79.3989 +T 597 669 679 699 629 w=26.1580 (ipsum) +Mx 110.5949 +T 557 642 620 642 672 w=23.0120 (dolor) +Mx 138.6449 +T 679 597 690 w=10.4390 (sit) +Mx 154.1219 +T 522 629 563 690 w=21.9890 (amet) +Mx 176.1109 +T 2367 w=2.4420 (,) +Mx 183.5909 +Mx 4.4550 +Mx 5.2690 +Mx 5.6870 +Mx 3.7180 +Mx 4.4220 +Mx 4.5210 +Mx 3.7180 +Mx 4.4880 +Mx 3.7180 +Mx 5.4230 +Mx 4.0040 +T 551 a=4.5210 642 a=5.2690 632 a=5.6870 679 a=3.7180 563 a=4.4880 551 a=4.5210 690 a=3.7180 563 a=4.4880 690 a=3.7180 699 a=5.4230 672 a=4.0040 (consectetur) +Mx 238.0519 +T 522 557 597 669 597 679 551 597 632 583 w=44.7040 (adipiscing) +Mx 33.7709 +My 266.5514 +T 563 620 597 690 w=14.0470 (elit) +Mx 47.8179 +T 2366 w=2.1670 (.) +Mx 52.9192 +Mx 5.4010 +Mx 4.4220 +Mx 5.6320 +T 152 a=5.4010 563 a=4.4880 557 a=5.6320 (Sed) +Mx 71.3084 +T 632 642 632 w=16.6430 (non) +Mx 90.8857 +T 672 597 679 699 679 w=19.8660 (risus) +Mx 110.7517 +T 2366 w=2.1670 (.) +Mx 115.8529 +Mx 5.4010 +Mx 5.4230 +Mx 3.7180 +Mx 5.6210 +Mx 4.4880 +Mx 5.6870 +Mx 5.6320 +Mx 3.0030 +Mx 3.6520 +Mx 3.7180 +Mx 4.4880 +T 152 a=5.4010 699 a=5.4230 679 a=3.7180 669 a=5.6210 563 a=4.4880 632 a=5.6870 557 a=5.6320 597 a=3.0030 679 a=3.7180 679 a=3.7180 563 a=4.4880 (Suspendisse) +Mx 169.6182 +Mx 2.8380 +Mx 4.4220 +Mx 4.5210 +Mx 3.7180 +Mx 5.4230 +Mx 3.7180 +T 620 a=2.8380 563 a=4.4880 551 a=4.5210 690 a=3.7180 699 a=5.4230 679 a=3.7180 (lectus) +Mx 197.1924 +Mx 3.7180 +Mx 5.2690 +Mx 4.0040 +Mx 3.7180 +Mx 5.2690 +Mx 3.6190 +T 690 a=3.7180 642 a=5.2690 672 a=4.0040 690 a=3.7180 642 a=5.2690 672 a=4.0040 (tortor) +T 2367 w=2.4420 (,) +Mx 228.1657 +Mx 5.6320 +Mx 3.0030 +Mx 5.1260 +Mx 5.6870 +Mx 3.0030 +Mx 3.6520 +Mx 3.7180 +Mx 3.0030 +Mx 8.3930 +T 557 a=5.6320 597 a=3.0030 583 a=5.1260 632 a=5.6870 597 a=3.0030 679 a=3.7180 679 a=3.7180 597 a=3.0030 629 a=8.3930 (dignissim) +Mx 272.3169 +T 679 597 690 w=10.4390 (sit) +Mx 14.8819 +My 279.7514 +T 522 629 563 690 w=21.9890 (amet) +Mx 36.8709 +T 2367 w=2.4420 (,) +Mx 42.4133 +T 522 557 597 669 597 679 551 597 632 583 w=44.7040 (adipiscing) +Mx 90.2178 +Mx 5.6870 +Mx 4.4220 +Mx 4.5210 +T 632 a=5.6870 563 a=4.4880 551 a=4.5210 (nec) +T 2367 w=2.4420 (,) +Mx 110.3902 +T 699 620 690 672 597 551 597 563 679 w=34.7160 (ultricies) +Mx 148.2066 +Mx 3.7180 +Mx 4.4220 +Mx 5.6320 +T 679 a=3.7180 563 a=4.4880 557 a=5.6320 (sed) +T 2367 w=2.4420 (,) +Mx 167.5211 +Mx 5.6320 +Mx 5.2690 +Mx 2.8380 +Mx 5.2690 +Mx 3.6190 +T 557 a=5.6320 642 a=5.2690 620 a=2.8380 642 a=5.2690 672 a=4.0040 (dolor) +T 2366 w=2.1670 (.) +Mx 39.2060 +My 292.9514 +Mx 14.8819 +My 306.1514 +Set font Cormorant Infant;31.7547;400;;normal;;;LTR +T 144 w=24.3241 (Q) +Mx 39.2060 +My 292.9514 +Set font Cormorant Infant;11;400;;normal;;;LTR +T 699 642 w=10.6920 (uo) +Mx 54.1596 +Mx 2.8380 +Mx 5.2690 +Mx 3.8720 +Mx 4.4880 +Mx 8.3930 +T 620 a=2.8380 642 a=5.2690 672 a=4.0040 563 a=4.4880 629 a=8.3930 (lorem) +Mx 83.2811 +T 597 669 679 699 629 w=26.1580 (ipsum) +Mx 113.7007 +T 557 642 620 642 672 w=23.0120 (dolor) +Mx 140.9742 +T 679 597 690 w=10.4390 (sit) +Mx 155.6748 +T 522 629 563 690 w=21.9890 (amet) +Mx 177.6638 +T 2367 w=2.4420 (,) +Mx 184.3674 +Mx 4.4550 +Mx 5.2690 +Mx 5.6870 +Mx 3.7180 +Mx 4.4220 +Mx 4.5210 +Mx 3.7180 +Mx 4.4880 +Mx 3.7180 +Mx 5.4230 +Mx 4.0040 +T 551 a=4.5210 642 a=5.2690 632 a=5.6870 679 a=3.7180 563 a=4.4880 551 a=4.5210 690 a=3.7180 563 a=4.4880 690 a=3.7180 699 a=5.4230 672 a=4.0040 (consectetur) +Mx 238.0519 +T 522 557 597 669 597 679 551 597 632 583 w=44.7040 (adipiscing) +Mx 39.2060 +My 306.1514 +T 563 620 597 690 w=14.0470 (elit) +Mx 53.2530 +T 2366 w=2.1670 (.) +Mx 59.4883 +Mx 5.4010 +Mx 4.4220 +Mx 5.6320 +T 152 a=5.4010 563 a=4.4880 557 a=5.6320 (Sed) +Mx 79.0115 +T 632 642 632 w=16.6430 (non) +Mx 99.7228 +T 672 597 679 699 679 w=19.8660 (risus) +Mx 119.5888 +T 2366 w=2.1670 (.) +Mx 125.8241 +Mx 5.4010 +Mx 5.4230 +Mx 3.7180 +Mx 5.6210 +Mx 4.4880 +Mx 5.6870 +Mx 5.6320 +Mx 3.0030 +Mx 3.6520 +Mx 3.7180 +Mx 4.4880 +T 152 a=5.4010 699 a=5.4230 679 a=3.7180 669 a=5.6210 563 a=4.4880 632 a=5.6870 557 a=5.6320 597 a=3.0030 679 a=3.7180 679 a=3.7180 563 a=4.4880 (Suspendisse) +Mx 180.7234 +Mx 2.8380 +Mx 4.4220 +Mx 4.5210 +Mx 3.7180 +Mx 5.4230 +Mx 3.7180 +T 620 a=2.8380 563 a=4.4880 551 a=4.5210 690 a=3.7180 699 a=5.4230 679 a=3.7180 (lectus) +Mx 209.4316 +Mx 3.7180 +Mx 5.2690 +Mx 4.0040 +Mx 3.7180 +Mx 5.2690 +Mx 3.6190 +T 690 a=3.7180 642 a=5.2690 672 a=4.0040 690 a=3.7180 642 a=5.2690 672 a=4.0040 (tortor) +T 2367 w=2.4420 (,) +Mx 241.5389 +Mx 5.6320 +Mx 3.0030 +Mx 5.1260 +Mx 5.6870 +Mx 3.0030 +Mx 3.6520 +Mx 3.7180 +Mx 3.0030 +Mx 8.3930 +T 557 a=5.6320 597 a=3.0030 583 a=5.1260 632 a=5.6870 597 a=3.0030 679 a=3.7180 679 a=3.7180 597 a=3.0030 629 a=8.3930 (dignissim) +Mx 14.8819 +My 319.3514 +T 679 597 690 w=10.4390 (sit) +Mx 28.7036 +T 522 629 563 690 w=21.9890 (amet) +Mx 50.6926 +T 2367 w=2.4420 (,) +Mx 56.5174 +T 522 557 597 669 597 679 551 597 632 583 w=44.7040 (adipiscing) +Mx 104.6041 +Mx 5.6870 +Mx 4.4220 +Mx 4.5210 +T 632 a=5.6870 563 a=4.4880 551 a=4.5210 (nec) +T 2367 w=2.4420 (,) +Mx 125.0589 +T 699 620 690 672 597 551 597 563 679 w=34.7160 (ultricies) +Mx 163.1577 +Mx 3.7180 +Mx 4.4220 +Mx 5.6320 +T 679 a=3.7180 563 a=4.4880 557 a=5.6320 (sed) +T 2367 w=2.4420 (,) +Mx 182.7544 +Mx 5.6320 +Mx 5.2690 +Mx 2.8380 +Mx 5.2690 +Mx 3.6190 +T 557 a=5.6320 642 a=5.2690 620 a=2.8380 642 a=5.2690 672 a=4.0040 (dolor) +T 2366 w=2.1670 (.) +Mx 210.9312 +Mx 7.5460 +Mx 3.8720 +Mx 5.3900 +Mx 3.7180 +T 30 a=7.5460 672 a=4.0040 522 a=5.3900 679 a=3.7180 (Cras) +Mx 234.8399 +T 563 620 563 629 563 632 690 699 629 w=47.9160 (elementum) +Mx 14.8819 +My 332.5514 +Mx 5.4230 +Mx 2.8380 +Mx 3.7180 +Mx 4.0040 +Mx 3.0030 +Mx 4.4550 +Mx 4.4880 +Mx 3.7180 +T 699 a=5.4230 620 a=2.8380 690 a=3.7180 672 a=4.0040 597 a=3.0030 551 a=4.5210 563 a=4.4880 679 a=3.7180 (ultrices) +Mx 49.6445 +T 557 597 522 629 w=22.4180 (diam) +Mx 72.0625 +T 2366 w=2.1670 (.) +End page +Finish diff --git a/tests/dropcaps-descenders.sil b/tests/dropcaps-descenders.sil new file mode 100644 index 000000000..7c6789ac5 --- /dev/null +++ b/tests/dropcaps-descenders.sil @@ -0,0 +1,32 @@ +\begin[papersize=a6]{document} +\use[module=packages.retrograde,target=v0.15.0] +\nofolios +\neverindent +\script[src=packages/dropcaps] +\set[parameter=document.baselineskip, value=1.2em] +\font[family=Cormorant Infant, size=11pt] +% Normal I +\dropcap[lines=3]{I}bis lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor, dignissim sit amet, adipiscing nec, ultricies sed, dolor. Cras elementum ultrices diam. + +% J has a depth is Cormorant Infant. +% Depth used in scaling in strict mode (default) +\dropcap[lines=3]{J}anua lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor, dignissim sit amet, adipiscing nec, ultricies sed, dolor. Cras elementum ultrices diam. + +% Depth allowed to trigger extra hanged line in non-strict mode +\dropcap[lines=3, strict=false]{J}anua lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor, dignissim sit amet, adipiscing nec, ultricies sed, dolor. Cras elementum ultrices diam. Maecenas ligula massa, varius a, semper congue, euismod non, mi. + +% Normal O +\dropcap[lines=2, strict=false]{O}dos lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor, dignissim sit amet, adipiscing nec, ultricies sed, dolor. Cras elementum ultrices diam. + +% Q has a depth is Cormorant Infant. +% Depth used in scaling in strict mode (default) +\dropcap[lines=2]{Q}uo lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor, dignissim sit amet, adipiscing nec, ultricies sed, dolor. + +% J has a depth is Cormorant Infant. +% Depth allowed to trigger extra hanged line in non-strict mode... +% ... but allow an (exagerated) baseline ratio tolerance. +\set[parameter=dropcaps.bsratio, value=0.5]{% +\dropcap[lines=2, strict=false]{Q}uo lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor, dignissim sit amet, adipiscing nec, ultricies sed, dolor. Cras elementum ultrices diam. +\par} + +\end{document} diff --git a/tests/eject.sil b/tests/eject.sil index 970473ed3..03b28a974 100644 --- a/tests/eject.sil +++ b/tests/eject.sil @@ -1,4 +1,5 @@ \begin[papersize=a5]{document} +\use[module=packages.retrograde,target=v0.15.0] \use[module=packages.lorem] \pagetemplate[first-content-frame=a]{ \frame[id=a,top=5%ph,bottom=95%ph,next=b,left=5%pw,right=28%pw] diff --git a/tests/feat-1092-raw.sil b/tests/feat-1092-raw.sil index cc36d2ef0..1e4cb6913 100644 --- a/tests/feat-1092-raw.sil +++ b/tests/feat-1092-raw.sil @@ -1,4 +1,5 @@ \begin[papersize=a6]{document} +\use[module=packages.retrograde,target=v0.15.0] \nofolios \neverindent \use[module=packages.svg] @@ -18,4 +19,4 @@ This is a plain text inline. A bit like a true verbatim. \lets[do]{weird things}% Yeah! } -\end{document} \ No newline at end of file +\end{document} diff --git a/tests/feat-1365-lists-alternate.sil b/tests/feat-1365-lists-alternate.sil index 87709ad6c..07bb13c74 100644 --- a/tests/feat-1365-lists-alternate.sil +++ b/tests/feat-1365-lists-alternate.sil @@ -1,4 +1,5 @@ \begin[papersize=a6, class=book]{document} +\use[module=packages.retrograde,target=v0.15.0] \use[module=packages.lists] \font[family=Libertinus Serif]% Default Gentium lacks the white circle. \nofolios diff --git a/tests/feat-1365-lists-compact.sil b/tests/feat-1365-lists-compact.sil index 3040fae45..10fac5d94 100644 --- a/tests/feat-1365-lists-compact.sil +++ b/tests/feat-1365-lists-compact.sil @@ -1,4 +1,5 @@ \begin[papersize=a6, class=book]{document} +\use[module=packages.retrograde,target=v0.15.0] \use[module=packages.lists] \font[family=Libertinus Serif]% Default Gentium lacks the white circle. \nofolios diff --git a/tests/feat-1365-lists-footnote.sil b/tests/feat-1365-lists-footnote.sil index 5418482a7..1f44d4387 100644 --- a/tests/feat-1365-lists-footnote.sil +++ b/tests/feat-1365-lists-footnote.sil @@ -1,4 +1,5 @@ \begin[papersize=a6, class=book]{document} +\use[module=packages.retrograde,target=v0.15.0] \use[module=packages.lists] \font[family=Libertinus Serif]% Default Gentium lacks the white circle. \nofolios @@ -19,7 +20,7 @@ \item{Level 2 Ft} \end{itemize} \item{Level 1 Ft} -\end{itemize} +\end{itemize} }} \begin{itemize} \item{Level 3} diff --git a/tests/feat-875-dotfill-alignment.sil b/tests/feat-875-dotfill-alignment.sil index cb3c3d8a6..add5c385e 100644 --- a/tests/feat-875-dotfill-alignment.sil +++ b/tests/feat-875-dotfill-alignment.sil @@ -1,4 +1,5 @@ \begin[papersize=a5]{document} +\use[module=packages.retrograde,target=v0.15.0] \use[module=packages.leaders] \nofolios \neverindent diff --git a/tests/feat-875-leaders-alignment.sil b/tests/feat-875-leaders-alignment.sil index fda2cdc09..10cd9ca15 100644 --- a/tests/feat-875-leaders-alignment.sil +++ b/tests/feat-875-leaders-alignment.sil @@ -1,4 +1,5 @@ \begin[papersize=a5]{document} +\use[module=packages.retrograde,target=v0.15.0] \use[module=packages.leaders] \nofolios \neverindent diff --git a/tests/feat-875-leaders-fixed-alignment.sil b/tests/feat-875-leaders-fixed-alignment.sil index 6878f0acb..cf8fea785 100644 --- a/tests/feat-875-leaders-fixed-alignment.sil +++ b/tests/feat-875-leaders-fixed-alignment.sil @@ -1,4 +1,5 @@ \begin[papersize=a5]{document} +\use[module=packages.retrograde,target=v0.15.0] \use[module=packages.leaders] \nofolios \neverindent diff --git a/tests/feat-fullrule-hfillrule.sil b/tests/feat-fullrule-hfillrule.sil index 2ba797163..3b58f7553 100644 --- a/tests/feat-fullrule-hfillrule.sil +++ b/tests/feat-fullrule-hfillrule.sil @@ -1,4 +1,5 @@ \begin[papersize=a6]{document} +\use[module=packages.retrograde,target=v0.15.0] \nofolios \neverindent \use[module=packages.rules] diff --git a/tests/feat-italic-correction.sil b/tests/feat-italic-correction.sil index 8820db833..7f2077549 100644 --- a/tests/feat-italic-correction.sil +++ b/tests/feat-italic-correction.sil @@ -1,4 +1,5 @@ \begin[papersize=a6]{document} +\use[module=packages.retrograde,target=v0.15.0] \nofolios \neverindent \font[size=15pt] @@ -43,7 +44,7 @@ % Enabled \set[parameter=typesetter.italicCorrection, value=true] -+ \em{fluff}! \em{fluff} fluff aaaaaaa aaaa aaaaaa \em{fluff} fluff ++ \em{fluff}! \em{fluff} fluff aaaaaaa aaaa aaaaaa \em{fluff} fluff % Repeated with another font \font[family=Cormorant Infant] diff --git a/tests/feat-unicode-nbsp.expected b/tests/feat-unicode-nbsp.expected new file mode 100644 index 000000000..fb6b2179d --- /dev/null +++ b/tests/feat-unicode-nbsp.expected @@ -0,0 +1,176 @@ +Set paper size 297.6377985 419.5275636 +Begin page +Mx 14.8819 +My 28.5447 +Set font Gentium Plus;10;400;;normal;;;LTR +T 47 82 85 72 80 w=26.4014 (Lorem) +Mx 45.5228 +T 76 83 86 88 80 w=25.2002 (ipsum) +Mx 74.9626 +T 71 82 79 82 85 w=21.9287 (dolor) +Mx 101.1308 +T 86 76 87 w=10.0146 (sit) +Mx 115.3850 +T 68 80 72 87 w=20.6836 (amet) +Mx 136.0686 +T 15 w=2.2900 (,) +Mx 142.5982 +T 86 76 87 w=10.0146 (sit) +Mx 156.8524 +T 68 80 72 87 w=20.6836 (amet) +Mx 181.7755 +T 68 71 76 83 76 86 70 76 81 74 w=41.8457 (adipiscing) +Mx 227.8608 +T 72 79 76 87 w=13.4814 (elit) +Mx 241.3422 +T 17 w=2.2900 (.) +Mx 247.8718 +T 54 72 71 w=14.5801 (Sed) +Mx 266.6915 +T 81 82 81 w=16.0645 (non) +Mx 14.8819 +My 40.5447 +T 85 76 86 88 86 w=19.6924 (risus) +Mx 34.5743 +T 17 w=2.2900 (.) +Mx 39.5220 +T 54 88 86 83 72 81 71 76 86 86 72 w=49.6094 (Suspendisse) +Mx 91.7890 +T 79 72 70 87 88 86 w=24.3018 (lectus) +Mx 118.7484 +T 87 82 85 87 82 85 w=24.8633 (tortor) +Mx 143.6117 +T 17 w=2.2900 (.) +Mx 14.8819 +My 58.5447 +T 47 82 85 72 80 w=26.4014 (Lorem) +Mx 49.1701 +T 76 83 86 88 80 w=25.2002 (ipsum) +Mx 82.2572 +T 71 82 79 82 85 w=21.9287 (dolor) +Mx 112.0727 +T 86 76 87 w=10.0146 (sit) +Mx 129.9742 +T 68 80 72 87 w=20.6836 (amet) +Mx 150.6578 +T 15 w=2.2900 (,) +Mx 160.8347 +T 70 82 81 86 72 70 87 72 87 88 85 w=48.5303 (consectetur) +Mx 217.2519 +T 68 71 76 83 76 86 70 76 81 74 w=41.8457 (adipiscing) +Mx 266.9844 +T 72 79 76 87 w=13.4814 (elit) +Mx 280.4659 +T 17 w=2.2900 (.) +Mx 14.8819 +My 70.5447 +T 54 72 71 w=14.5801 (Sed) +Mx 32.1157 +T 81 82 81 w=16.0645 (non) +Mx 50.8338 +T 85 76 86 88 86 w=19.6924 (risus) +Mx 70.5262 +T 17 w=2.2900 (.) +Mx 75.4699 +T 54 88 86 83 72 81 71 76 86 86 72 w=49.6094 (Suspendisse) +Mx 127.7330 +T 79 72 70 87 88 86 w=24.3018 (lectus) +Mx 154.6884 +T 87 82 85 87 82 85 w=24.8633 (tortor) +Mx 179.5517 +T 17 w=2.2900 (.) +Mx 14.8819 +My 82.5447 +T 47 82 85 72 80 w=26.4014 (Lorem) +Mx 43.1918 +T 76 83 86 88 80 w=25.2002 (ipsum) +Mx 70.3005 +T 71 82 79 82 85 w=21.9287 (dolor) +Mx 94.1377 +T 86 76 87 w=10.0146 (sit) +Mx 106.0609 +T 68 80 72 87 w=20.6836 (amet) +Mx 126.7445 +T 15 w=2.2900 (,) +Mx 130.9431 +T 86 76 87 w=10.0146 (sit) +Mx 142.8663 +T 68 80 72 87 w=20.6836 (amet) +Mx 165.4584 +T 68 71 76 83 76 86 70 76 81 74 w=41.8457 (adipiscing) +Mx 209.2126 +T 72 79 76 87 w=13.4814 (elit) +Mx 222.6941 +T 17 w=2.2900 (.) +Mx 226.8926 +T 54 72 71 w=14.5801 (Sed) +Mx 243.3812 +T 81 82 81 w=16.0645 (non) +Mx 261.3542 +T 85 76 86 88 86 w=19.6924 (risus) +Mx 281.0466 +T 17 w=2.2900 (.) +Mx 14.8819 +My 94.5447 +T 54 88 86 83 72 81 71 76 86 86 72 w=49.6094 (Suspendisse) +Mx 67.1516 +T 79 72 70 87 88 86 w=24.3018 (lectus) +Mx 94.1137 +T 87 82 85 87 82 85 w=24.8633 (tortor) +Mx 118.9770 +T 17 w=2.2900 (.) +Mx 14.8819 +My 106.5447 +T 47 82 85 72 80 w=26.4014 (Lorem) +Mx 53.6435 +T 76 83 86 88 80 w=25.2002 (ipsum) +Mx 91.2039 +T 71 82 79 82 85 w=21.9287 (dolor) +Mx 125.4928 +T 86 76 87 w=10.0146 (sit) +Mx 147.8677 +T 68 80 72 87 w=20.6836 (amet) +Mx 168.5513 +T 15 w=2.2900 (,) +Mx 183.2015 +T 86 76 87 w=10.0146 (sit) +Mx 205.5764 +T 68 80 72 87 w=20.6836 (amet) +Mx 238.6202 +T 68 71 76 83 76 86 70 76 81 74 w=41.8457 (adipiscing) +Mx 280.4659 +T 17 w=2.2900 (.) +Mx 14.8819 +My 118.5447 +T 54 88 86 83 72 81 71 76 86 86 72 w=49.6094 (Suspendisse) +Mx 67.1516 +T 79 72 70 87 88 86 w=24.3018 (lectus) +Mx 94.1137 +T 87 82 85 87 82 85 w=24.8633 (tortor) +Mx 118.9770 +T 17 w=2.2900 (.) +Mx 14.8819 +My 136.5447 +T 41 85 68 81 111 68 76 86 w=34.3799 (Français) +Mx 50.5831 +T 34 w=4.3311 (?) +Mx 57.5711 +T 41 85 68 81 111 68 76 w=30.5176 (Françai) +Mx 88.0887 +T 86 w=3.8623 (s) +Mx 94.6080 +T 29 w=2.2900 (:) +Mx 99.5550 +T 169 w=4.8535 («) +Mx 106.5269 +T 41 85 68 81 111 w=23.2178 (Franç) +Mx 129.7447 +T 68 w=4.5898 (a) +Mx 134.3345 +T 76 86 w=6.5723 (is) +Mx 142.2281 +T 4 w=2.7197 (!) +Mx 147.0662 +T 170 w=4.8535 (») +End page +Finish diff --git a/tests/feat-unicode-nbsp.sil b/tests/feat-unicode-nbsp.sil new file mode 100644 index 000000000..b28a557db --- /dev/null +++ b/tests/feat-unicode-nbsp.sil @@ -0,0 +1,34 @@ +\begin[papersize=a6]{document} +\use[module=packages.retrograde,target=v0.15.0] +\neverindent +\nofolios +\language[main=und] +% Reference text +Lorem ipsum dolor sit amet, sit amet adipiscing elit. +Sed non risus. Suspendisse lectus tortor. +\medskip +% Four first spaces are U+00A0. +% Expect proper stretchability as regular spaces. +Lorem ipsum dolor sit amet, consectetur adipiscing elit.\break +Sed non risus. Suspendisse lectus tortor. + +% All spaces are U+00A0 but two: +% Expectation: +% Expect non-breakable spaces, shrinking as regular spaces +% when necessary. +Lorem ipsum dolor sit amet, sit amet adipiscing elit. +Sed non risus. Suspendisse lectus tortor. + +\set[parameter=linebreak.emergencyStretch, value=20em] +Lorem ipsum dolor sit amet, sit amet adipiscing. +Suspendisse lectus tortor. + +% Punctiation spaces are U+00A0 in the following case. +% Expectation: +% French punctuation spaces are managed automatically, +% also replacing U+00A0. +\medskip +\language[main=fr] +Français ? Français : « Français ! » + +\end{document} diff --git a/tests/feat-unicode-softhyphen.expected b/tests/feat-unicode-softhyphen.expected new file mode 100644 index 000000000..46c759d59 --- /dev/null +++ b/tests/feat-unicode-softhyphen.expected @@ -0,0 +1,76 @@ +Set paper size 297.6377985 419.5275636 +Begin page +Mx 14.8819 +My 28.5447 +Set font Gentium Plus;10;400;;normal;;;LTR +T 47 82 85 72 80 w=26.4014 (Lorem) +Mx 44.6950 +T 76 83 w=8.0078 (ip) +Mx 52.7028 +T 86 88 80 w=17.1924 (sum) +Mx 69.8952 +T 71 82 w=10.2295 (do) +Mx 80.1247 +T 79 82 85 w=11.6992 (lor) +Mx 91.8239 +T 86 76 87 w=10.0146 (sit) +Mx 101.8385 +T 68 80 72 87 w=20.6836 (amet) +Mx 122.5221 +T 17 w=2.2900 (.) +Mx 128.2239 +T 47 82 85 72 80 w=26.4014 (Lorem) +Mx 158.0370 +T 76 83 w=8.0078 (ip) +Mx 166.0448 +T 86 88 80 w=17.1924 (sum) +Mx 183.2372 +T 71 82 w=10.2295 (do) +Mx 193.4667 +T 79 82 85 w=11.6992 (lor) +Mx 205.1659 +T 86 76 87 w=10.0146 (sit) +Mx 215.1805 +T 68 80 72 87 w=20.6836 (amet) +Mx 235.8641 +T 17 w=2.2900 (.) +Mx 241.5659 +T 47 82 85 72 80 w=26.4014 (Lorem) +Mx 271.3790 +T 76 83 w=8.0078 (ip) +Mx 279.3868 +T 16 w=3.3691 (-) +Mx 14.8819 +My 40.5447 +T 86 88 80 w=17.1924 (sum) +Mx 32.0743 +T 71 82 w=10.2295 (do) +Mx 42.3038 +T 79 82 85 w=11.6992 (lor) +Mx 54.0030 +T 86 76 87 w=10.0146 (sit) +Mx 64.0176 +T 68 80 72 87 w=20.6836 (amet) +Mx 84.7012 +T 17 w=2.2900 (.) +Mx 88.8998 +T 47 82 85 72 80 w=26.4014 (Lorem) +Mx 117.2097 +T 76 83 86 88 80 71 82 79 82 85 86 76 87 68 80 72 87 w=77.8271 (ipsumdolorsitamet) +Mx 195.0368 +T 17 w=2.2900 (.) +Mx 199.2354 +T 47 82 85 72 80 w=26.4014 (Lorem) +Mx 227.5453 +T 76 83 86 88 80 71 82 79 82 85 86 76 87 68 80 72 87 w=77.8271 (ipsumdolorsitamet) +Mx 305.3724 +T 17 w=2.2900 (.) +Mx 14.8819 +My 52.5447 +T 47 82 85 72 80 w=26.4014 (Lorem) +Mx 43.9433 +T 76 83 86 88 80 71 82 79 82 85 86 76 87 68 80 72 87 w=77.8271 (ipsumdolorsitamet) +Mx 121.7705 +T 17 w=2.2900 (.) +End page +Finish diff --git a/tests/feat-unicode-softhyphen.sil b/tests/feat-unicode-softhyphen.sil new file mode 100644 index 000000000..8eb691855 --- /dev/null +++ b/tests/feat-unicode-softhyphen.sil @@ -0,0 +1,24 @@ +\begin[papersize=a6]{document} +\use[module=packages.retrograde,target=v0.15.0] +\begin{lua} + -- Recent versions of ICU report different information about chunking around + -- soft hyphens. Our test expectations are wired for 74, but our IC has 70. + local icu = require("justenoughicu") + local icu70minus = tostring(icu.version()) <= "70.0" + if icu70minus then SILE.status.unsupported = true end +\end{lua} +\nofolios +\neverindent +% Language without hyphenation patterns +% (so we are sure that the hyphenation comes from the soft hyphens) +\set[parameter=document.language, value=und] +% The text has soft hyphens U+00AD inside words. +Lorem ip­sum­do­lor­sit­amet. +Lorem ip­sum­do­lor­sit­amet. +Lorem ip­sum­do­lor­sit­amet.% Should be hyphenated here as "ip-sum" + +\set[parameter=typesetter.softHyphen, value=false] +Lorem ip­sum­do­lor­sit­amet. +Lorem ip­sum­do­lor­sit­amet. +Lorem ip­sum­do­lor­sit­amet. +\end{document} diff --git a/tests/fluent.sil b/tests/fluent.sil index f78935f53..dbee08d7b 100644 --- a/tests/fluent.sil +++ b/tests/fluent.sil @@ -1,4 +1,5 @@ \begin[papersize=a6]{document} +\use[module=packages.retrograde,target=v0.15.0] \neverindent \nofolios % Output a message with variable replacement diff --git a/tests/font-features-cvXX.sil b/tests/font-features-cvXX.sil index de0b9826d..e266d2038 100644 --- a/tests/font-features-cvXX.sil +++ b/tests/font-features-cvXX.sil @@ -1,4 +1,5 @@ \begin[papersize=a6]{document} +\use[module=packages.retrograde,target=v0.15.0] \nofolios \neverindent \use[module=packages.features] diff --git a/tests/footnote-skip.sil b/tests/footnote-skip.sil index 104cee520..4babbb28d 100644 --- a/tests/footnote-skip.sil +++ b/tests/footnote-skip.sil @@ -1,4 +1,5 @@ \begin[papersize=a5,class=book]{document} +\use[module=packages.retrograde,target=v0.15.0] \use[module=packages.lorem] \use[module=packages.rules] \begin{script} diff --git a/tests/footnote.sil b/tests/footnote.sil index 53432aec3..f925d5e1c 100644 --- a/tests/footnote.sil +++ b/tests/footnote.sil @@ -1,4 +1,5 @@ \begin[papersize=a6,class=book]{document} +\use[module=packages.retrograde,target=v0.15.0] \nofolios \use[module=packages.lorem] \font[family=Gentium Plus,size=10pt] diff --git a/tests/grid.sil b/tests/grid.sil index b5bdbd28f..3d7f7c303 100644 --- a/tests/grid.sil +++ b/tests/grid.sil @@ -1,4 +1,6 @@ \begin[papersize=a5,class=book]{document} +\use[module=packages.retrograde,target=v0.15.0] +\use[module=packages.retrograde,target=v0.15.0] \use[module=packages.lorem] \use[module=packages.grid] \use[module=packages.frametricks] diff --git a/tests/hangafter.sil b/tests/hangafter.sil index 72e36f057..658afcc06 100644 --- a/tests/hangafter.sil +++ b/tests/hangafter.sil @@ -1,4 +1,5 @@ \begin[papersize=a6]{document} +\use[module=packages.retrograde,target=v0.15.0] \nofolios \use[module=packages.lorem] \set[parameter=document.parskip,value=1ex] diff --git a/tests/image.sil b/tests/image.sil index ea50fbd0f..ef03f44ab 100644 --- a/tests/image.sil +++ b/tests/image.sil @@ -1,4 +1,5 @@ \begin[papersize=a5]{document} +\use[module=packages.retrograde,target=v0.15.0] \use[module=packages.image] One two \img[src=documentation/fig1.png,width=50] three diff --git a/tests/inc/bug-337.lua b/tests/inc/bug-337.lua index 1c60bc951..82e9dad7f 100644 --- a/tests/inc/bug-337.lua +++ b/tests/inc/bug-337.lua @@ -4,9 +4,9 @@ local package = pl.class(base) package._name = "bug-337" -function package:_init () +function package:_init (options) - base._init(self) + base._init(self, options) self.class:defineMaster({ id = "right", diff --git a/tests/inline-lua.sil b/tests/inline-lua.sil index 174335f2c..9cecda9bf 100644 --- a/tests/inline-lua.sil +++ b/tests/inline-lua.sil @@ -1,4 +1,5 @@ \begin[papersize=a5,class=book]{document} +\use[module=packages.retrograde,target=v0.15.0] % A real comment \begin{script} answer = { output = tostring(3 * 3 % 5) } diff --git a/tests/kannada.sil b/tests/kannada.sil index 8d0e49d2e..8f9d232f9 100644 --- a/tests/kannada.sil +++ b/tests/kannada.sil @@ -1,4 +1,5 @@ \begin[papersize=a6]{document} +\use[module=packages.retrograde,target=v0.15.0] \nofolios \noindent \font[family=Libertinus Serif,size=16pt] diff --git a/tests/letterspacing.sil b/tests/letterspacing.sil index 9d44e0852..9a319ab2c 100644 --- a/tests/letterspacing.sil +++ b/tests/letterspacing.sil @@ -1,4 +1,5 @@ \begin[papersize=a5]{document} +\use[module=packages.retrograde,target=v0.15.0] No letterspacing. diff --git a/tests/linespacing.sil b/tests/linespacing.sil index e90724b75..90f2d22eb 100644 --- a/tests/linespacing.sil +++ b/tests/linespacing.sil @@ -1,4 +1,5 @@ \begin[papersize=a6]{document} +\use[module=packages.retrograde,target=v0.15.0] \use[module=packages.lorem] \nofolios \font[family=Libertinus Serif,size=12pt] diff --git a/tests/linespacing2.sil b/tests/linespacing2.sil index a56580c73..c753e17fb 100644 --- a/tests/linespacing2.sil +++ b/tests/linespacing2.sil @@ -1,4 +1,5 @@ \begin{document} +\use[module=packages.retrograde,target=v0.15.0] \nofolios \font[family=Libertinus Serif,size=11pt] \use[module=packages.linespacing] diff --git a/tests/masters.sil b/tests/masters.sil index f09a2ed95..a86b68e35 100644 --- a/tests/masters.sil +++ b/tests/masters.sil @@ -1,4 +1,5 @@ \begin{document} +\use[module=packages.retrograde,target=v0.15.0] \use[module=packages.masters] \use[module=packages.lorem] \use[module=packages.frametricks] diff --git a/tests/math-bigops.xml b/tests/math-bigops.xml index b10e6805e..a4d714423 100644 --- a/tests/math-bigops.xml +++ b/tests/math-bigops.xml @@ -1,4 +1,5 @@ <sile> +<use module="packages.retrograde" target="v0.15.0" /> <use module="packages.math"/> Big operators, text, MathML: diff --git a/tests/math-fractions.xml b/tests/math-fractions.xml index 64e6e347d..46125a2e3 100644 --- a/tests/math-fractions.xml +++ b/tests/math-fractions.xml @@ -1,4 +1,5 @@ <sile> +<use module="packages.retrograde" target="v0.15.0" /> <use module="packages.math"/> Fractions, text, MathML: diff --git a/tests/math-ops.sil b/tests/math-ops.sil index 0ac686dff..56c5a7fbf 100644 --- a/tests/math-ops.sil +++ b/tests/math-ops.sil @@ -1,4 +1,5 @@ \begin[papersize=a5]{document} +\use[module=packages.retrograde,target=v0.15.0] \use[module=packages.math] diff --git a/tests/math-spaces.sil b/tests/math-spaces.sil index 7a1122cfd..a8ef4bd59 100644 --- a/tests/math-spaces.sil +++ b/tests/math-spaces.sil @@ -1,4 +1,5 @@ \begin[class=plain]{document} +\use[module=packages.retrograde,target=v0.15.0] \use[module=packages.math] diff --git a/tests/math-stretchy.xml b/tests/math-stretchy.xml index 2dbb47547..a3c8ba33f 100644 --- a/tests/math-stretchy.xml +++ b/tests/math-stretchy.xml @@ -1,4 +1,5 @@ <sile> +<use module="packages.retrograde" target="v0.15.0" /> <use module="packages.math"/> Stretchy parentheses, text, MathML: diff --git a/tests/math-subsup.xml b/tests/math-subsup.xml index 0b5bb7663..dec315905 100644 --- a/tests/math-subsup.xml +++ b/tests/math-subsup.xml @@ -1,4 +1,5 @@ <sile> +<use module="packages.retrograde" target="v0.15.0" /> <use module="packages.math"/> Sub-superscripts, text, MathML: diff --git a/tests/math-tables-mathml.xml b/tests/math-tables-mathml.xml index 79ecabb10..7ebdfe5db 100644 --- a/tests/math-tables-mathml.xml +++ b/tests/math-tables-mathml.xml @@ -1,4 +1,5 @@ <sile> +<use module="packages.retrograde" target="v0.15.0" /> <use module="packages.math"/> Number matrix, text, MathML: diff --git a/tests/math-tables-tex.sil b/tests/math-tables-tex.sil index e22730bad..924bfb327 100644 --- a/tests/math-tables-tex.sil +++ b/tests/math-tables-tex.sil @@ -1,4 +1,5 @@ \begin[class=plain]{document} +\use[module=packages.retrograde,target=v0.15.0] \use[module=packages.math] diff --git a/tests/math-variants.xml b/tests/math-variants.xml index 0e08d9ad4..5850deabe 100644 --- a/tests/math-variants.xml +++ b/tests/math-variants.xml @@ -1,4 +1,5 @@ <sile> +<use module="packages.retrograde" target="v0.15.0" /> <use module="packages.math"/> Math variants, text, MathML: diff --git a/tests/mini-arabic.sil b/tests/mini-arabic.sil index 039b64745..206cf89aa 100644 --- a/tests/mini-arabic.sil +++ b/tests/mini-arabic.sil @@ -1,4 +1,5 @@ \begin[papersize=a6]{document} +\use[module=packages.retrograde,target=v0.15.0] \nofolios \use[module=packages.bidi] \thisframeRTL diff --git a/tests/mlcounter.sil b/tests/mlcounter.sil index f0c62a1ea..617c86dc7 100644 --- a/tests/mlcounter.sil +++ b/tests/mlcounter.sil @@ -1,4 +1,5 @@ \begin[papersize=a5]{document} +\use[module=packages.retrograde,target=v0.15.0] \use[module=packages.counters] \increment-multilevel-counter[id=test] diff --git a/tests/negative-spaces-in-line.sil b/tests/negative-spaces-in-line.sil index 4838acb3a..cd44cdcd4 100644 --- a/tests/negative-spaces-in-line.sil +++ b/tests/negative-spaces-in-line.sil @@ -1,4 +1,5 @@ \begin[papersize=a6,direction=RTL-TTB]{document} +\use[module=packages.retrograde,target=v0.15.0] \nofolios \neverindent \font[family=Awami Nastaliq,size=22] diff --git a/tests/nondeterminism.sil b/tests/nondeterminism.sil index 07412c8a1..c003469dd 100644 --- a/tests/nondeterminism.sil +++ b/tests/nondeterminism.sil @@ -1,6 +1,7 @@ \begin[papersize=a6]{document} +\use[module=packages.retrograde,target=v0.15.0] \nofolios \font[size=11pt,family=Gentium Plus] -\noindent{}Now that we understand some of what SILE is about and what it seeks to do, +\noindent{}Now that we understand some of what SILE is about and what it seeks to do, let’s dive into SILE itself. \end{document} diff --git a/tests/parshaping-simple.sil b/tests/parshaping-simple.sil index 1f7e8ebfc..d695f4b60 100644 --- a/tests/parshaping-simple.sil +++ b/tests/parshaping-simple.sil @@ -1,4 +1,5 @@ \begin[papersize=a7]{document} +\use[module=packages.retrograde,target=v0.15.0] \nofolios \use[module=packages.lorem] \begin{script} diff --git a/tests/regressions.pl.in b/tests/regressions.pl.in index 65198c357..bea5e7f64 100644 --- a/tests/regressions.pl.in +++ b/tests/regressions.pl.in @@ -10,6 +10,9 @@ my (@failed, @passed, @unsupported, @knownbad, @knownbadbutpassing, @missing); my @specifics = @ARGV; my @DISABLEDSRCS = split(/ +/, $DISABLEDSRCS); +my $highlighter = -t STDOUT ? "| @DELTA@" : ""; +my $diffcontext = -t STDOUT ? "2" : "0"; + my $exit = 0; for (@specifics ? @specifics : <tests/*.sil tests/*.xml tests/*.nil>) { my $expectation = $_; $expectation =~ s/\.(sil|xml)$/\.expected/; @@ -30,7 +33,7 @@ for (@specifics ? @specifics : <tests/*.sil tests/*.xml tests/*.nil>) { push @failed, $_; } elsif (!system("grep -qx 'UNSUPPORTED' $actual")) { $unsupported = 1; - } elsif (!system("diff -".($knownbad?"q":"")."U0 $expectation $actual")) { + } elsif (!system("diff -".($knownbad?"q":"")."U$diffcontext $expectation $actual $highlighter")) { if ($knownbad) { push @knownbadbutpassing, $_; } else { push @passed, $_; } } elsif ($knownbad) { diff --git a/tests/rskip.sil b/tests/rskip.sil index 1c2e1b393..97cba4ef4 100644 --- a/tests/rskip.sil +++ b/tests/rskip.sil @@ -1,4 +1,5 @@ \begin[papersize=a5,class=book]{document} +\use[module=packages.retrograde,target=v0.15.0] \use[module=packages.lorem] \set[parameter=document.rskip,value=20mm] \lorem[words=50] diff --git a/tests/settings.sil b/tests/settings.sil index 03e13b2cb..e352a2fbf 100644 --- a/tests/settings.sil +++ b/tests/settings.sil @@ -1,4 +1,5 @@ \begin[papersize=a6]{document} +\use[module=packages.retrograde,target=v0.15.0] \nofolios \neverindent foo diff --git a/tests/split-footnote.sil b/tests/split-footnote.sil index 9c5201416..5afe6e1ee 100644 --- a/tests/split-footnote.sil +++ b/tests/split-footnote.sil @@ -1,4 +1,5 @@ \begin[papersize=a6,class=book]{document} +\use[module=packages.retrograde,target=v0.15.0] \use[module=packages.lorem] \nofolios Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod diff --git a/tests/sura-2.expected b/tests/sura-2.expected index 6a755a023..06bb3cd0e 100644 --- a/tests/sura-2.expected +++ b/tests/sura-2.expected @@ -7,23 +7,20 @@ Mx 9.6600 Mx 4.7600 Mx 4.3400 T 121 x=3.9000 y=-0.1800 1294 a=9.6600 121 x=1.9600 y=0.5000 1121 a=4.7600 43 a=4.3400 (الۤمۤ) -Mx 238.1559 -T 22 w=5.8400 ( ) +Mx 235.3368 Set font Amiri Quran;20;400;;normal;;;LTR T 1263 a=5.8400 x=-15.7200 (١) -Mx 212.5759 +Mx 209.7568 T 114 w=25.5800 (۝) -Mx 193.4531 +Mx 192.0976 Set font Amiri Quran;20;400;;normal;;;RTL Mx 9.0000 T 77 x=-1.2800 y=-0.2600 52 a=9.0000 (ذَ) -Mx 189.2931 -T 1257 w=4.1600 ( ٰ) -Mx 169.2331 +Mx 163.3785 Mx 16.9000 Mx 3.1600 T 77 x=1.6600 y=-0.2600 1181 a=16.9000 79 x=-3.2200 1178 a=3.1600 (لِكَ) -Mx 107.4303 +Mx 103.0393 Mx 17.6600 Mx 5.8400 Mx 4.8800 @@ -32,11 +29,11 @@ Mx 3.7000 Mx 3.5000 Mx 4.3400 T 78 x=3.7200 y=-0.3800 472 a=17.6600 1258 a=5.8400 77 x=-3.7200 y=-0.2600 491 a=4.8800 79 x=0.7200 523 a=11.7600 118 x=0.8400 y=-0.2800 1295 a=3.7000 525 a=3.5000 102 a=4.3400 (ٱلۡكِتَـٰبُ) -Mx 84.4675 +Mx 81.5402 Mx 6.8000 Mx 6.0400 T 679 a=6.8000 77 x=-1.4800 y=-0.2600 677 a=6.0400 (لَا) -Mx 43.3647 +Mx 41.9010 Mx 15.4400 Mx 5.9000 Mx 9.6400 @@ -52,7 +49,7 @@ Mx 15.2800 Mx 9.4200 Mx 9.0400 T 72 a=15.2800 141 x=-0.3400 y=-0.4000 497 a=9.4200 78 x=-2.5800 y=-0.3800 519 a=9.0400 (هُدࣰى) -Mx 197.3824 +Mx 198.4611 Mx 10.8400 Mx 4.3600 Mx 7.5600 @@ -61,13 +58,12 @@ Mx 4.7400 Mx 4.8600 Mx 3.1600 T 77 x=-0.2400 y=-0.2600 878 a=10.8400 877 a=4.3600 79 x=-2.0000 505 a=7.5600 369 x=1.5400 y=0.2200 80 x=-2.5000 y=-0.4600 491 a=4.8800 78 x=-3.4400 y=-0.3800 802 a=4.7200 118 x=-1.5600 y=-0.2800 1188 a=5.7000 x=-0.8400 79 x=-3.2200 80 x=-1.9600 y=-0.4600 1178 a=3.1600 (لِّلۡمُتَّقِینَ) -Mx 191.5424 -T 22 w=5.8400 ( ) +Mx 188.3063 Set font Amiri Quran;20;400;;normal;;;LTR T 1264 a=5.8400 x=-15.7200 (٢) -Mx 165.9624 +Mx 162.7263 T 114 w=25.5800 (۝) -Mx 123.6689 +Mx 121.5115 Set font Amiri Quran;20;400;;normal;;;RTL Mx 11.2400 Mx 2.9000 @@ -75,7 +71,7 @@ Mx 9.7600 Mx 2.8200 Mx 4.3400 T 77 x=1.0600 y=-0.2600 726 a=11.2400 725 a=2.9000 79 x=-0.9000 1071 a=9.7600 369 x=-0.8600 y=0.2200 80 x=-4.9000 y=-0.4600 1067 a=2.8200 102 a=4.3400 (ٱلَّذِینَ) -Mx 70.7354 +Mx 69.6567 Mx 11.4400 Mx 6.9000 Mx 4.8800 @@ -101,7 +97,7 @@ Mx 7.5600 Mx 3.8000 Mx 10.4400 T 77 y=-0.2600 69 a=11.4400 555 a=6.9000 78 x=-1.6000 y=-0.3800 529 a=9.2600 495 a=4.8800 79 x=-2.0000 505 a=7.5600 78 x=-4.3200 y=-0.3800 484 a=3.8000 77 x=1.2600 y=-0.2600 71 a=8.0000 x=2.4400 (وَیُقِیمُونَ) -Mx 180.8874 +Mx 181.0131 Mx 7.3800 Mx 6.4000 Mx 5.0600 @@ -109,13 +105,13 @@ Mx 14.4400 Mx 3.5000 Mx 4.3400 T 77 x=-1.7800 y=-0.2600 45 a=7.3800 101 x=0.0400 y=-9.6800 577 a=6.4000 77 x=-4.1200 y=-0.2600 575 a=5.0600 369 x=7.1000 y=0.2200 80 x=3.0600 y=-0.4600 541 a=14.4400 525 a=3.5000 102 a=4.3400 (ٱلصَّلَوٰةَ) -Mx 152.7789 +Mx 153.0303 Mx 4.5800 Mx 3.4600 Mx 5.6000 Mx 8.0000 T 459 a=4.5800 369 x=1.8400 y=0.2200 80 x=-2.2000 y=-0.4600 1091 a=3.4600 79 x=-1.5600 1090 a=5.6000 77 x=-1.1800 y=-0.2600 71 a=8.0000 (وَمِمَّا) -Mx 95.4904 +Mx 95.8675 Mx 10.4400 Mx 7.8000 Mx 5.8400 @@ -124,7 +120,7 @@ Mx 5.9000 Mx 7.9800 Mx 7.9800 T 118 x=0.9800 y=-0.2800 527 a=10.4400 78 x=-1.6000 y=-0.3800 520 a=7.8000 1258 a=5.8400 77 x=-3.7200 y=-0.2600 490 a=4.8800 118 x=-2.0800 y=-0.2800 501 a=5.9000 77 x=-1.4800 y=-0.2600 54 a=7.9800 77 x=-1.4800 y=-0.2600 53 a=7.9800 (رَزَقۡنَـٰهُمۡ) -Mx 46.3019 +Mx 46.8047 Mx 11.4400 Mx 6.9000 Mx 7.5600 @@ -133,7 +129,6 @@ Mx 3.3600 Mx 5.9000 T 77 y=-0.2600 69 a=11.4400 555 a=6.9000 78 x=-1.1000 y=-0.3800 505 a=7.5600 79 x=-2.0000 506 a=7.5600 688 a=3.3600 78 x=-3.0600 y=-0.3800 825 a=5.9000 (یُنفِقُونَ) Mx 40.4619 -T 22 w=5.8400 ( ) Set font Amiri Quran;20;400;;normal;;;LTR T 1265 a=5.8400 x=-15.7200 (٣) Mx 14.8819 @@ -195,7 +190,7 @@ Mx 3.9800 Mx 4.8800 Mx 5.9000 T 77 x=1.9400 y=-0.2600 1186 a=16.2600 79 x=-5.2200 1183 a=3.9800 118 x=-1.9800 y=-0.2800 488 a=4.8800 77 x=-3.8200 y=-0.2600 501 a=5.9000 (قَبۡلِكَ) -Mx 182.0124 +Mx 183.0491 Mx 7.3800 Mx 5.9800 Mx 11.5800 @@ -205,11 +200,11 @@ Mx 5.5600 Mx 5.7000 Mx 9.6600 T 79 x=-1.2200 45 a=7.3800 77 x=-1.4400 y=-0.2600 884 a=5.9800 79 x=0.5400 880 a=11.5800 679 a=6.8000 77 x=-5.3600 y=-0.2600 1260 118 x=0.2600 y=-0.2800 677 a=6.0400 462 a=5.5600 79 x=-2.2400 1012 a=5.7000 77 x=0.4800 y=-0.2600 71 a=8.0000 x=1.6600 (وَبِٱلۡءَاخِرَةِ) -Mx 151.5089 +Mx 153.5823 Mx 10.4400 Mx 9.0400 T 118 x=0.9800 y=-0.2800 527 a=10.4400 78 x=-2.5800 y=-0.3800 519 a=9.0400 (هُمۡ) -Mx 100.6654 +Mx 103.7755 Mx 11.4400 Mx 6.9000 Mx 4.8800 @@ -217,11 +212,10 @@ Mx 5.9000 Mx 6.9000 Mx 3.8000 T 77 y=-0.2600 69 a=11.4400 555 a=6.9000 78 x=-3.8400 y=-0.3800 490 a=4.8800 79 x=-2.3000 501 a=5.9000 555 a=6.9000 78 x=-4.3200 y=-0.3800 484 a=3.8000 (یُوقِنُونَ) -Mx 94.8254 -T 22 w=5.8400 ( ) +Mx 93.7887 Set font Amiri Quran;20;400;;normal;;;LTR T 1266 a=5.8400 x=-15.7200 (٤) -Mx 69.2454 +Mx 68.2087 T 114 w=25.5800 (۝) Mx 14.8819 Set font Amiri Quran;20;400;;normal;;;RTL @@ -277,11 +271,10 @@ Mx 9.2600 Mx 3.5000 Mx 4.3400 T 77 y=-0.2600 69 a=11.4400 555 a=6.9000 78 x=0.8400 y=-0.3800 515 a=12.2000 79 x=-3.3600 526 a=3.9400 118 x=0.7600 y=-0.2800 506 a=7.5600 78 x=-1.6000 y=-0.3800 529 a=9.2600 118 x=-2.8600 y=-0.2800 525 a=3.5000 102 a=4.3400 (ٱلۡمُفۡلِحُونَ) -Mx 10.9879 -T 22 w=5.8400 ( ) +Mx 11.7666 Set font Amiri Quran;20;400;;normal;;;LTR T 1267 a=5.8400 x=-15.7200 (٥) -Mx -14.5921 +Mx -13.8134 T 114 w=25.5800 (۝) Mx 266.9759 My 131.0364 @@ -335,7 +328,7 @@ My 206.0364 Mx 9.6600 Mx 4.7600 T 118 x=0.2600 y=-0.2800 1294 a=9.6600 77 x=-3.4200 y=0.4200 1121 a=4.7600 (لَمۡ) -Mx 214.6788 +Mx 214.6791 Mx 10.4400 Mx 9.0400 Mx 7.9800 @@ -343,11 +336,11 @@ Mx 9.4200 Mx 3.3600 Mx 6.3800 T 118 x=0.9800 y=-0.2800 527 a=10.4400 78 x=-2.5800 y=-0.3800 519 a=9.0400 118 x=0.2600 y=-0.2800 53 a=7.9800 79 x=-0.3400 496 a=9.4200 688 a=3.3600 78 x=-3.0600 y=-0.3800 821 a=6.3800 (تُنذِرۡهُمۡ) -Mx 194.8016 +Mx 194.8023 Mx 6.8000 Mx 6.0400 T 679 a=6.8000 77 x=-1.4800 y=-0.2600 677 a=6.0400 (لَا) -Mx 146.0645 +Mx 146.0656 Mx 11.4400 Mx 6.9000 Mx 4.8800 @@ -355,11 +348,10 @@ Mx 7.7800 Mx 6.9000 Mx 3.8000 T 77 y=-0.2600 69 a=11.4400 555 a=6.9000 78 x=-3.8400 y=-0.3800 490 a=4.8800 79 x=-1.3200 528 a=7.7800 118 x=-0.7200 y=-0.2800 554 a=6.9000 78 x=-4.3200 y=-0.3800 484 a=3.8000 (یُؤۡمِنُونَ) -Mx 140.2245 -T 22 w=5.8400 ( ) +Mx 139.0288 Set font Amiri Quran;20;400;;normal;;;LTR T 1268 a=5.8400 x=-15.7200 (٦) -Mx 114.6445 +Mx 113.4488 T 114 w=25.5800 (۝) End page Finish diff --git a/tests/sura-2.sil b/tests/sura-2.sil index f077563a4..2d1c3d80a 100644 --- a/tests/sura-2.sil +++ b/tests/sura-2.sil @@ -1,4 +1,18 @@ \begin[papersize=a6,direction=RTL]{document} +\use[module=packages.retrograde,target=v0.15.0] +\begin{lua} + -- ICU 74 introduced a change that affects where SILE sees font + -- property changes in this text. Both outputs are fine, but we + -- don't have tooling to expect different outputs for the same + -- inputs yet, so this work around just allows this test to fail + -- on ICU 74. As of this commit our CI system uses ICU 70, so + -- only some local developer testing is affected. When CI ever + -- starts breaking we might make that the expectation and mark it + -- unsupported on other versions. + local icu = require("justenoughicu") + local icu74plus = tostring(icu.version()) >= "74.0" + if icu74plus then SILE.status.unsupported = true end +\end{lua} \nofolios \font[family=Amiri Quran,size=20pt] \use[module=packages.linespacing] diff --git a/tests/tracking.sil b/tests/tracking.sil index 6b730039b..ce5c707f9 100644 --- a/tests/tracking.sil +++ b/tests/tracking.sil @@ -1,4 +1,5 @@ \begin[papersize=a6]{document} +\use[module=packages.retrograde,target=v0.15.0] \nofolios \font[size=20pt] \set[parameter=document.parindent,value=0] diff --git a/tests/twoside.sil b/tests/twoside.sil index 45cac8390..837879def 100644 --- a/tests/twoside.sil +++ b/tests/twoside.sil @@ -1,4 +1,5 @@ \begin[papersize=a8,class=book]{document} +\use[module=packages.retrograde,target=v0.15.0] \neverindent % Note folio suppression on some pages are part of test \begin[command=stuff]{define} diff --git a/tests/variations-axis.sil b/tests/variations-axis.sil index bc43280d5..4103ead91 100644 --- a/tests/variations-axis.sil +++ b/tests/variations-axis.sil @@ -1,4 +1,5 @@ \begin[papersize=a6]{document} +\use[module=packages.retrograde,target=v0.15.0] \neverindent \nofolios \font[family=Tourney,size=48pt] diff --git a/tests/vertical.sil b/tests/vertical.sil index 3c9fcf787..faaae3f17 100644 --- a/tests/vertical.sil +++ b/tests/vertical.sil @@ -1,4 +1,5 @@ \begin[class=jplain,layout=tate]{document} +\use[module=packages.retrograde,target=v0.15.0] \nofolios % Note: differences between Noto font versions make adding more characters to % this test brittle. For example 日本は昔からruns into trouble when the height diff --git a/typesetters/base.lua b/typesetters/base.lua index 679334e07..131d40669 100644 --- a/typesetters/base.lua +++ b/typesetters/base.lua @@ -139,6 +139,20 @@ function typesetter.declareSettings(_) help = "Whether italic correction is activated or not" }) + SILE.settings:declare({ + parameter = "typesetter.softHyphen", + type = "boolean", + default = true, + help = "When true, soft hyphens are rendered as discretionary breaks, otherwise they are ignored" + }) + + SILE.settings:declare({ + parameter = "typesetter.softHyphenWarning", + type = "boolean", + default = false, + help = "When true, a warning is issued when a soft hyphen is encountered" + }) + end function typesetter:initState () @@ -283,7 +297,29 @@ function typesetter:typeset (text) if token.separator then self:endline() else - self:setpar(token.string) + if SILE.settings:get("typesetter.softHyphen") then + local warnedshy = false + for token2 in SU.gtoke(token.string, luautf8.char(0x00AD)) do + if token2.separator then -- soft hyphen support + local discretionary = SILE.nodefactory.discretionary({}) + local hbox = SILE.typesetter:makeHbox({ SILE.settings:get("font.hyphenchar") }) + discretionary.prebreak = { hbox } + table.insert(SILE.typesetter.state.nodes, discretionary) + if not warnedshy and SILE.settings:get("typesetter.softHyphenWarning") then + SU.warn("Soft hyphen encountered and replaced with discretionary") + end + warnedshy = true + else + self:setpar(token2.string) + end + end + else + if SILE.settings:get("typesetter.softHyphenWarning") and luautf8.match(token.string, luautf8.char(0x00AD)) then + SU.warn("Soft hyphen encountered and ignored") + end + text = luautf8.gsub(token.string, luautf8.char(0x00AD), "") + self:setpar(text) + end end end SILE.traceStack:pop(pId) @@ -501,7 +537,7 @@ function typesetter:boxUpNodes () self:pushGlue(parfillskip) self:pushPenalty(-inf_bad) SU.debug("typesetter", function () - return "Boxed up "..(#nodelist > 500 and (#nodelist).." nodes" or SU.contentToString(nodelist)) + return "Boxed up "..(#nodelist > 500 and (#nodelist).." nodes" or SU.ast.contentToString(nodelist)) end) local breakWidth = SILE.settings:get("typesetter.breakwidth") or self.frame:getLineWidth() local lines = self:breakIntoLines(nodelist, breakWidth) @@ -1072,16 +1108,18 @@ function typesetter:makeHbox (content) local ox = atypesetter.frame.state.cursorX local oy = atypesetter.frame.state.cursorY SILE.outputter:setCursor(atypesetter.frame.state.cursorX, atypesetter.frame.state.cursorY) + SU.debug("hboxes", function () + -- setCursor is also invoked by the internal (wrapped) hboxes etc. + -- so we must show our debug box before outputting its content. + SILE.outputter:debugHbox(box, box:scaledWidth(line)) + return "Drew debug outline around hbox" + end) for _, node in ipairs(box.value) do node:outputYourself(atypesetter, line) end atypesetter.frame.state.cursorX = ox atypesetter.frame.state.cursorY = oy _post() - SU.debug("hboxes", function () - SILE.outputter:debugHbox(box, box:scaledWidth(line)) - return "Drew debug outline around hbox" - end) end }) return hbox, migratingNodes