feat(render): Typst renderer, contrast analysis and print pre-flight

render/typst.ts stages each job as a self-contained bundle (<job>/.typst/
lib.typ + template + resolved.json) and roots Typst there, so artwork living
outside the package is reachable and old jobs stay re-renderable. Paths are
root-relative throughout -- Typst resolves a leading / against --root, not
the filesystem.

render/contrast.ts measures the region behind the text with sharp and forces
a scrim on high variance even when mean luminance passes; verified with a
checkerboard that scores 5.45:1 contrast yet stdev 119.9.

render/preflight.ts checks TrimBox, embedded fonts, image dpi and structure,
degrading to 'non installato' rather than failing when a tool is absent.

E2E verified via jiti: TrimBox 297.0x420.0mm, font axes injected, bundle
staged. 0 type errors.
This commit is contained in:
mozempk
2026-08-27 09:50:22 +02:00
parent 0b29c1587d
commit 756dd9994e
16 changed files with 1234 additions and 283 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
# Caratteri di terze parti inclusi in pi-imgen
Generato da `scripts/fetch-fonts.sh` il 2026-08-27 07:30 UTC. Non modificare a mano.
Generato da `scripts/fetch-fonts.sh` il 2026-08-27 07:43 UTC. Non modificare a mano.
I file dei caratteri stanno in `vendor/fonts/<id>/` e **non** sono versionati.
Ogni cartella contiene il file `LICENSE` originale.