mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-10-30 12:47:13 -06:00
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 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
79a67e2642
commit
1a1119b1d4
@@ -10,10 +10,16 @@ fn text_layout(s: &str) -> TextLayout {
|
||||
|
||||
fn arabic_test_face(test: &str) -> Option<Arc<FontFace>> {
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user