For each INDD with a reference IDML and a PDF of the same save, compare
the InDesign PDF (R), DesignCraft's render of the reference IDML (A) and
DesignCraft's render of the converter's IDML (B) page by page. A vs B
measures the converter: pixel-identical documents and pages, and the
first differing page with compare.py's gap keys on it. R vs A measures
DesignCraft: issue kinds counted on font-complete documents and on all.
DesignCraft is an input program (--designcraft or DESIGNCRAFT_CLI).
Needs poppler-utils and the Python standard library only. Documented in
docs/measurement.md, "Render comparison", and in CONTRIBUTING.md.
tools/corpus-manifest.json lists 2,884 files (5.5 GB) of 239 openly
licensed sources: InDesign, IDML, ICML and PDF files, the parts of
unzipped IDML packages, and the licence files. Each file has its
source, SPDX licence, size and SHA-256, and either a pinned URL (git
commit, Zenodo record, and a few unversioned URLs that the hash
guards) or a member of an archive with its own size and checksum.
Sources whose only licence is the OFL, Figshare records and files that
can only be downloaded by hand are left out.
tools/fetch_corpus.py downloads them into the git-ignored corpus/open/
as fetch_fixtures.py does: own download directory, size and hash
checks, atomic writes, paths kept inside the directory. Archives are
downloaded once, checked and unpacked member by member; requests to a
host are paced and retried on HTTP 429 and 5xx.
tools/check_wasm.sh builds the library for wasm32-unknown-unknown,
then builds a probe module (a cdylib generated under the target
directory that exports a function calling `indd::convert`) and checks
with Node.js that the module imports nothing: a conversion needs no
file system, clock or other host function. It then converts the
fetched fixtures, or the files given, in the probe module and compares
each package byte for byte with the native `indd convert` output.
No library change was needed: only `convert_file` and `read_header`
use `std::fs`, and `convert` does not call them. The 5 fixtures and 80
corpus files give the same packages in WebAssembly as natively. The
check takes about 10 s; it is documented in CLAUDE.md, CONTRIBUTING.md,
README.md and ARCHITECTURE.md. There is no hosted CI.
Idea from storytold/designcraft#98.
The README listed implemented features as not started, an old attribute
count, corpus size and numbers, and no library use. The numbers are from
compare.py --all with schema validation at this revision.