mirror of
https://github.com/storytold/effectcraft.git
synced 2026-11-02 06:27:11 -06:00
Text: the zh-hans Han order test replaces the skipping render test (#2039)
The CJK render test skipped wherever no Japanese face was installed, which is every CI runner, and on a Mac it drew glyphs with or without the fix, so it caught nothing. Replace it with a fallback-order test: fixture faces for `Hiragino Sans` and `Hiragino Sans GB` show that a zh-hans Han lookup tries the Chinese family first, that ja tries the Japanese one, and that a layout gets Hiragino Sans GB. Synthetic fonts in an isolated child process keep it independent of the host's fonts; with the Simplified list reverted it fails on `[7]` against `[8, 7]`. Delete `TEST_CJK_LOCALE`: the locale-mutating tests moved to an isolated child process, so nothing used the lock and the test-only static failed clippy's `-D warnings` gate. Trim the documentation edits to the single docs/gaps.md gap-11 row: revert the header and changelog edits in ROADMAP.md, docs/roadmap.md, docs/localization-parity.md and docs/target-app-parity.md, and the gaps.md header and changelog row, which conflict with other PRs. Tests: cargo clippy -p effectcraft-text -p effectcraft-render --all-targets -- -D warnings, cargo clippy --workspace --all-targets -- -D warnings, cargo test -p effectcraft-text (79 lib), cargo test -p effectcraft-render (264 passed, 1 ignored perf test), cargo fmt --all -- --check.
This commit is contained in:
@@ -237,27 +237,6 @@ fn text_layer_renders_glyphs() {
|
||||
assert!(covered > 300, "{covered}");
|
||||
}
|
||||
|
||||
/// #453: a composition's Japanese (and Chinese) text layer draws its glyphs, not missing-glyph
|
||||
/// boxes. Skipped where no CJK face is installed.
|
||||
#[test]
|
||||
fn text_layer_renders_cjk_glyphs() {
|
||||
let cjk = effectcraft_text::fonts::resolve("Inter", "Regular").face;
|
||||
if !effectcraft_text::fonts::face(effectcraft_text::fonts::fallback_for('日', cjk)).has_char('日') {
|
||||
eprintln!("no Japanese face installed; skipping");
|
||||
return;
|
||||
}
|
||||
for text in ["日本語", "中文"] {
|
||||
let (mut p, cid, comp) = setup();
|
||||
let mut l = build::layer(&mut p, &comp, "Text", LayerSource::Text, (200, 100), None);
|
||||
l.props.prop_mut("text/sourceText").unwrap().value = Value::Text(Box::new(TextDoc { text: text.into(), size: 46.0, ..Default::default() }));
|
||||
l.props.prop_mut("transform/position").unwrap().value = Value::Vec3([100.0, 70.0, 0.0]);
|
||||
p.comp_mut(cid).unwrap().layers.push(l);
|
||||
let img = render_frame(&p, cid, Tick::ZERO, 1.0);
|
||||
let covered = img.data.iter().filter(|px| px[3] > 0.5).count();
|
||||
assert!(covered > 200, "{text}: {covered} covered pixels");
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn precomp_and_3d_render() {
|
||||
let (mut p, cid, comp) = setup();
|
||||
|
||||
Reference in New Issue
Block a user