Fonts docs: CRAFT_FONTS_DIR must be absolute

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Brandon Thomas 2026-10-06 14:10:31 -04:00
parent e15aae1f1f
commit 2abf5857c1
4 changed files with 5 additions and 4 deletions

View File

@ -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

View File

@ -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=<checkout> 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=<absolute path to checkout> 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.

View File

@ -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

View File

@ -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),