shaping, dev: test that the CJK fallback follows the query language #188

Merged
natsukium merged 1 commit from shaping/cjk-lang-fallback-test into main 2026-10-19 12:48:52 +09:00
Owner

Closes #96.

Adds a Simplified Chinese subset (--font-number=2, same ideograph) to the pinned test fonts and a fontconfig test: with the query language ja the face that draws 葛 is Noto Sans CJK JP, with zh-cn it is Noto Sans CJK SC. The test first checks that both faces load and cover 葛, so the result comes from ranking rather than a missing face.

The one-ideograph subsets get no lang from fontconfig, so target="scan" rules tag them as full faces would be. Without the rules the zh-cn half fails (zh-cn: Noto Sans CJK JP), which is the install-order regression the test is there to catch.

Not covered: the host path where FcDefaultSubstitute takes the language from the environment.

just check passes.

Closes #96. Adds a Simplified Chinese subset (`--font-number=2`, same ideograph) to the pinned test fonts and a fontconfig test: with the query language `ja` the face that draws 葛 is Noto Sans CJK JP, with `zh-cn` it is Noto Sans CJK SC. The test first checks that both faces load and cover 葛, so the result comes from ranking rather than a missing face. The one-ideograph subsets get no `lang` from fontconfig, so `target="scan"` rules tag them as full faces would be. Without the rules the `zh-cn` half fails (`zh-cn: Noto Sans CJK JP`), which is the install-order regression the test is there to catch. Not covered: the host path where `FcDefaultSubstitute` takes the language from the environment. `just check` passes.
shaping, dev: test that the CJK fallback follows the query language
All checks were successful
fuzz / cargo fuzz nightly long-run (pull_request) Has been skipped
darwin / detect relevant changes (pull_request) Successful in 9s
darwin / darwin docs-only no-op (pull_request) Has been skipped
windows / detect relevant changes (pull_request) Successful in 21s
windows / windows docs-only no-op (pull_request) Has been skipped
bench / instruction-count regression gate (pull_request) Successful in 53s
darwin / build felis (aarch64-darwin) (pull_request) Successful in 1m13s
fuzz / cargo fuzz smoke (per target) (pull_request) Successful in 1m56s
pr / nix flake check (pull_request) Successful in 59s
windows / cargo nextest (Windows) (pull_request) Successful in 6m19s
pr / cargo build / clippy / test / deny (pull_request) Successful in 4m9s
windows / frontend smoke (Windows) (pull_request) Successful in 1m30s
pr / wire schema is compatible with the base (pull_request) Successful in 47s
pr / frontend smoke (x86_64-linux) (pull_request) Successful in 1m31s
windows / cargo clippy (Windows cross) (pull_request) Successful in 35s
9a6be208bd
The Linux cascade relies on fontconfig ranking the Japanese face first
under a Japanese locale, but the pinned font set had only the JP face,
so nothing failed if the cascade stopped following that ranking.

The SC subset joins the JP one, and the test checks that `ja` and
`zh-cn` each put their own face first. One-ideograph subsets cover no
orthography, so fontconfig gives them no language; scan-time rules tag
them as full faces would be, or install order would decide both cases.
The host's environment-derived language is not exercised: changing the
environment from parallel tests is unsafe.

Assisted-by: Claude Code
natsukium scheduled this pull request to auto merge when all checks succeed 2026-10-19 12:41:08 +09:00
natsukium deleted branch shaping/cjk-lang-fallback-test 2026-10-19 12:48:52 +09:00
Sign in to join this conversation.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
felis-terminal/felis!188
No description provided.