From 1a1119b1d40fd83e2922a77922f5ff96e4650019 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Fri, 9 Oct 2026 05:13:15 +0700 Subject: [PATCH] Tests: Arabic joining tests pick an OpenType (GSUB) font macOS's Geeza Pro is an AAT font: its morx shaping takes no context from outside the run, so different_style_arabic_boundary_receives_joining_context failed on Macs (reported in #610). The tests now use the first candidate with a GSUB table and skip when there is none. Co-Authored-By: Claude Opus 5.5 --- crates/text/src/tests_bidi.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/crates/text/src/tests_bidi.rs b/crates/text/src/tests_bidi.rs index 0f0884236..d73bbb62a 100644 --- a/crates/text/src/tests_bidi.rs +++ b/crates/text/src/tests_bidi.rs @@ -10,10 +10,16 @@ fn text_layout(s: &str) -> TextLayout { fn arabic_test_face(test: &str) -> Option> { let db = FontDb::global(); + // OpenType (GSUB) shaping only: AAT fonts such as macOS's Geeza Pro shape with `morx`, which + // takes no context from outside the run, so their joining across a style boundary differs. + let opentype = |face: &FontFace| { + use skrifa::raw::TableProvider; + face.skrifa().is_some_and(|f| f.gsub().is_ok()) + }; let face = ["Geeza Pro", "Arial", "Noto Sans Arabic"] .into_iter() .filter_map(|name| db.face(name, "Regular")) - .find(|face| face.covers('ب') && face.covers('ل') && face.covers('ا')); + .find(|face| face.covers('ب') && face.covers('ل') && face.covers('ا') && opentype(face)); if let Some(face) = &face { let path = face.path().map_or_else(|| "bundled font".to_string(), |p| p.display().to_string()); eprintln!("ASSERTIONS RUN: {test}; Arabic font {} {} ({path})", face.family, face.style);