diff --git a/crates/engine/src/cursor_tests.rs b/crates/engine/src/cursor_tests.rs index 39a18ce4..0975f3fa 100644 --- a/crates/engine/src/cursor_tests.rs +++ b/crates/engine/src/cursor_tests.rs @@ -58,6 +58,9 @@ fn close(a: f64, b: f64) -> bool { /// A square (100,100)–(200,200), selected, and the text "Hello" at (400, 100), not selected. fn scene() -> (Session, NodeId, NodeId) { + // The text is measured with a font: without craft-fonts that is a system one, scanned here + // rather than by whichever test happens to run first (#333). + figcraft_text::scan_system_fonts(); let mut s = Session::new(); let r = id(&ex(&mut s, "shape.rectangle", json!({"x": 100, "y": 100, "width": 100, "height": 100}))); let t = id(&ex(&mut s, "text.create", json!({"text": "Hello", "x": 400, "y": 100, "props": {"fontSize": 40}}))); diff --git a/crates/engine/src/double_click_tests.rs b/crates/engine/src/double_click_tests.rs index e51cb7da..2ffa0083 100644 --- a/crates/engine/src/double_click_tests.rs +++ b/crates/engine/src/double_click_tests.rs @@ -15,6 +15,9 @@ fn ex(s: &mut Session, cmd: &str, p: Value) -> Value { /// A frame holding a group of a rectangle and a text layer at (60, 60); returns (group, text). fn scene(s: &mut Session) -> (NodeId, NodeId) { + // The text is measured with a font: without craft-fonts that is a system one, scanned here + // rather than by whichever test happens to run first (#333). + figcraft_text::scan_system_fonts(); let f = id_of(&ex(s, "frame.create", json!({"x": 0, "y": 0, "width": 400, "height": 300}))["id"]).unwrap(); let r = id_of(&ex(s, "shape.rectangle", json!({"x": 40, "y": 40, "width": 200, "height": 60, "parent": f}))["id"]).unwrap(); let t = id_of(&ex(s, "text.create", json!({"text": "Hi there", "x": 60, "y": 60, "parent": f, "props": {"fontSize": 16}}))["id"]).unwrap();