From 2abf5857c1b7e769143ff3ee7babc0ea62a638fb Mon Sep 17 00:00:00 2001 From: Brandon Thomas Date: Tue, 6 Oct 2026 14:10:31 -0400 Subject: [PATCH] Fonts docs: CRAFT_FONTS_DIR must be absolute Co-Authored-By: Claude Opus 5.5 --- AGENTS.md | 3 ++- CLAUDE.md | 2 +- CONTRIBUTING.md | 2 +- README.md | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 1a2bb2ac..33223f4e 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -93,9 +93,10 @@ EffectCraft uses it as an **optional build input**, never a Cargo dependency: ```sh git clone https://github.com/storytold/craft-fonts ../craft-fonts -CRAFT_FONTS_DIR=../craft-fonts cargo run -p effectcraft +CRAFT_FONTS_DIR="$PWD/../craft-fonts" cargo run -p effectcraft ``` +Use an absolute path: `build.rs` runs in `crates/text`, so a relative one resolves from there. `crates/text/build.rs` embeds the fonts in its `fonts/manifest.txt` as `effectcraft_text::fonts::CRAFT_FONTS` (wasm32: only BIZ UDPGothic Regular, for the download size); unset, `CRAFT_FONTS` is empty and the app builds, tests and runs as before. The Japanese faces are the diff --git a/CLAUDE.md b/CLAUDE.md index 2ecce002..567c6ea3 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -12,7 +12,7 @@ EffectCraft is a clean-room, open-source, pure-Rust motion graphics and visual e ## Non-negotiables **Read [`AGENTS.md`](AGENTS.md) first; its rules override everything here.** No Adobe assets, every asset licensed + attributed (`cargo xtask assets`). - **Never crash** (AGENTS.md "Never crash"; outranks feature work: a crash loses people's work). Non-test code has no `unwrap()`/`expect()`/`panic!`/`unreachable!`/`todo!`/`unimplemented!` and no `unsafe`: return `Result` and use `?`, `ok_or`, `let … else`. Input-derived indices, slices and arithmetic use `get()` and checked/saturating math; recursion is depth-limited; locks handle poisoning. The app's last-resort guard turns an escaped panic into an error and keeps the document. Every crash fix gets a regression test. Standard: [craftrules `standards/never-crash.md`](https://github.com/storytold/craftrules/blob/main/standards/never-crash.md). -- **Fonts live in [storytold/craft-fonts](https://github.com/storytold/craft-fonts)**; never commit font files here. It is an optional build input: `CRAFT_FONTS_DIR= cargo build` embeds them (Japanese UI and text fallback); unset, nothing changes. Details in AGENTS.md "Fonts live in craft-fonts"; standard: [craftrules `standards/fonts.md`](https://github.com/storytold/craftrules/blob/main/standards/fonts.md). +- **Fonts live in [storytold/craft-fonts](https://github.com/storytold/craft-fonts)**; never commit font files here. It is an optional build input: `CRAFT_FONTS_DIR= cargo build` embeds them (Japanese UI and text fallback); unset, nothing changes. Details in AGENTS.md "Fonts live in craft-fonts"; standard: [craftrules `standards/fonts.md`](https://github.com/storytold/craftrules/blob/main/standards/fonts.md). - **Clean-room.** Behaviour and public docs only. No GPL/LGPL/AGPL code. ffmpeg only as an external test oracle. - **Pure Rust.** Media codecs come from FilmCraft crates (git deps behind `crates/media`, see `plan/adr/0001`). - **Layering** (`cargo xtask layers`): nothing below L5 depends on egui/eframe/winit/rfd/cpal; L0–L4 build for wasm32. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 800b6dc4..351287c8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -18,7 +18,7 @@ Optional: build with the shared fonts from [craft-fonts](https://github.com/stor ```sh git clone https://github.com/storytold/craft-fonts ../craft-fonts -CRAFT_FONTS_DIR=../craft-fonts cargo test --workspace +CRAFT_FONTS_DIR="$PWD/../craft-fonts" cargo test --workspace ``` ## Ground rules diff --git a/README.md b/README.md index cf5c3a30..0049bd87 100644 --- a/README.md +++ b/README.md @@ -199,7 +199,7 @@ cargo xtask web --serve 8765 # the browser build on http://127.0. Japanese text in the UI and in text layers uses the system's Japanese fonts. To embed the shared fonts from [craft-fonts](https://github.com/storytold/craft-fonts) instead (as release builds do, and the only way the browser build gets Japanese), clone it and build with -`CRAFT_FONTS_DIR=../craft-fonts`; see [AGENTS.md](AGENTS.md). +`CRAFT_FONTS_DIR="$PWD/../craft-fonts"` (an absolute path: `build.rs` resolves a relative one from `crates/text`); see [AGENTS.md](AGENTS.md). To work on it: `cargo test --workspace`, and `cargo xtask ci` before every commit (format, lints, tests, layering, asset attribution and the WebAssembly build). See [CONTRIBUTING.md](CONTRIBUTING.md),