mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-11-28 14:19:22 -08:00
CRAFT_FONTS_DIR has to be passed on the command line, so a plain `cargo build --release` silently produces a CJK-blind binary: build.rs warns "no craft-fonts embedded: Chinese and Japanese text will render as empty boxes" and carries on. A build-time requirement that lives only in a warning is one that gets forgotten and comes back as a bug report about missing glyphs. relative = true resolves against the repo root rather than hardcoding an absolute path, on the assumption the warning already makes: that craft-fonts is cloned beside this repo. No force, so a CRAFT_FONTS_DIR already in the environment still wins for a one-off build against a different font set. If craft-fonts is absent, behaviour is unchanged — build.rs warns exactly as now. This mirrors deckcraft's own config, which already ships this block. Verified with the variable removed from the environment (env -u CRAFT_FONTS_DIR cargo build --release): the crate recompiled and the warning did not appear. Co-authored-by: Claude Opus 5 <noreply@anthropic.com> Co-authored-by: Fredrik Hallin <fredrik.hallin@guidelinegeo.com>