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.
This commit is contained in:
dotCooCoo committed 2026-11-19 10:52:35 -08:00
1 parent 67fa32374d
commit 62ff5832d4
1 file changed
+7 -1
+7 -1
View File
@@ -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()