Skip to content

Text: make every supplied font family available to documents - #2111

Merged
bflatastic merged 1 commit into
storytold:mainfrom
IanHollow:codex/vectorcraft-document-fonts
Oct 15, 2026
Merged

bflatastic merged 1 commit into
storytold:mainfrom
IanHollow:codex/vectorcraft-document-fonts

Conversation

@IanHollow

@IanHollow IanHollow commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

The build script embeds every native face supplied through CRAFT_FONTS_DIR, but document registration filters that input to Japanese, Arabic and Thai. Other supplied families, including the Chinese faces added to release inputs in #1204, remain unavailable without another copy on the host.

Append the remaining supplied faces after the exact existing Japanese, Arabic and Thai registration order. Existing bundled fonts stay first. Multi-script faces are included once, and remaining faces keep manifest order. The input remains optional and explicit; no font files, dependencies, build defaults, web-font lists or fallback lookup rules change.

A synthetic test checks the existing priority, empty input and multi-script deduplication. A separate registration test asks for every supplied family without system font directories and reports a skip when no optional input was supplied.

The selector regression fails with the original filtered selection and passes with the repair. Full cargo xtask ci passed on the reviewed commit d461223432ce5b48c2d79acd7b5bf8e19630b388 on x86_64 Linux with Rust 1.99.1. All eight stages passed: formatting, workspace Clippy with warnings denied, workspace tests, PDF dependency checks, assets, brands, layers, and all 23 wasm targets. The source tree and Cargo.lock remained unchanged.

The run used the release-pinned craft-fonts input at 3d9ab3a132ed0eff457e424226a435a901da30d3 with CRAFT_FONTS_REQUIRED=1. The actual supplied-family registration test, synthetic ordering/deduplication test, Japanese and Thai priority tests, and web-font-list test all passed. Wasm checks emitted the existing build-script warning for optional web faces absent from that font input. A separate focused run with both CRAFT_FONTS_DIR and CRAFT_FONTS_REQUIRED unset passed tests::japanese_text_lays_out_without_the_craft_fonts, with exactly one test executed.

  • cargo xtask ci

This keeps the explicit-input requirement from #1605 and the existing loaded-face priority discussed in #1424. It introduces no UI-language preference or installed-font ranking.

Validation above records the original reviewed commit. The maintainer subsequently rebased the change as 83f40f135acd8b0fc68102c302e1f6c14e708c58 and merged it. These local results do not claim a fresh full CI run on that rebased commit.

@IanHollow
IanHollow marked this pull request as ready for review October 15, 2026 06:17
@FeiLiuEM

Copy link
Copy Markdown

This looks complementary to #1424 rather than overlapping: that one gives Han text a script preference for the faces the database can already reach, and this one widens what a build can reach when CRAFT_FONTS_DIR supplies more. Nothing in #1424 changes which families are registered, and nothing here changes the lookup order, so they should compose — a build that ships the Chinese faces plus an interface-language preference is exactly the case #1424 was written for.

They do share crates/text/src/fontdb.rs (and this one touches craft_fonts.rs, which #1424 does not), so whichever lands second will want a rebase. #1424 is approved as of this morning; happy to rebase it if yours goes in first.

@Messhias Messhias left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please tick - [x] cargo xtask ci on the PR body after a green end-to-end run (fmt, clippy, tests, assets, brands, layers, wasm), and reply with the outcome. Narrative mentions without a ticked checklist are not enough for approve from here.

@IanHollow

Copy link
Copy Markdown
Contributor Author

Ran the full, unmodified cargo xtask ci on d461223432ce5b48c2d79acd7b5bf8e19630b388 with Rust 1.99.1 on x86_64 Linux. All eight stages passed, including workspace Clippy/tests and all 23 wasm targets. The release-pinned craft-fonts input was enabled and required, so the supplied-family registration and script-priority tests exercised real fonts. The source tree and Cargo.lock stayed unchanged. Updated the PR validation notes and checked the CI item.

Assisted-by: GPT-6
Signed-off-by: IanHollow <72767437+IanHollow@users.noreply.github.com>
@bflatastic
bflatastic force-pushed the codex/vectorcraft-document-fonts branch from d461223 to 83f40f1 Compare October 15, 2026 21:34
@bflatastic
bflatastic merged commit c141d54 into storytold:main Oct 15, 2026
@bflatastic

Copy link
Copy Markdown
Member

Thanks @IanHollow! Merged after a full gate. If you'd like to chat with us, our Discord is at https://discord.gg/artcraft.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants