From 62ff5832d4e87f251cb46ed5b90620d4b8e48ff0 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Thu, 19 Nov 2026 10:52:35 -0800 Subject: [PATCH] Tests: set the retype tests' type in a bundled font Outlined text without a font took the system's default face, so a near match of round glyphs depended on the machine's installed fonts. The outlined helper now sets such text in Source Sans 3. --- crates/engine/src/cmd/retype_tests.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/crates/engine/src/cmd/retype_tests.rs b/crates/engine/src/cmd/retype_tests.rs index 5c043a9e6f..48bf680e75 100644 --- a/crates/engine/src/cmd/retype_tests.rs +++ b/crates/engine/src/cmd/retype_tests.rs @@ -10,7 +10,13 @@ fn session() -> Session { } /// Point text, outlined: the id of the outlines' group. -fn outlined(s: &mut Session, p: serde_json::Value) -> u64 { +fn outlined(s: &mut Session, mut p: serde_json::Value) -> u64 { + // A text without a font is set in the system's default face, which differs from machine to + // machine and decides which glyphs a near match can tell apart. + if p.get("font").is_none() { + p["font"] = json!("Source Sans 3"); + p["style"] = json!("Regular"); + } let id = s.execute("text.create", &p).unwrap()["id"].as_u64().unwrap(); s.execute("select.set", &json!({"ids": [id]})).unwrap(); s.execute("type.createOutlines", &json!({})).unwrap()["ids"][0].as_u64().unwrap()