diff --git a/test/data/renderer/eval/style.mapcss b/test/data/renderer/eval/style.mapcss
index 287830287..4abbc72a0 100644
--- a/test/data/renderer/eval/style.mapcss
+++ b/test/data/renderer/eval/style.mapcss
@@ -1,4 +1,5 @@
 * {
+	font-family: "DejaVu Sans";
     font-size: 20;
 }
 
@@ -22,7 +23,7 @@ node[test=2] {
 
 node[test=3] {
     lst: 12, 3, 6;
-    tmp: list(get(prop("lst"), 1), get(prop("lst"), 0), get(prop("lst"), 2), length(prop("lst")));
+    tmp: list(get(prop("lst"), 1), get(prop("lst"), 0), get(prop("lst"), 2), count(prop("lst")));
     value: concat("", prop("tmp"));
     result: "[3.0, 12.0, 6.0, 3]";
 }
@@ -35,4 +36,3 @@ node[test=4] {
 node[test] {
     text: concat("Test ", tag("test"), ": ", prop(result), " == ", prop(value));
 }
-
diff --git a/test/data/renderer/node-text2/style.mapcss b/test/data/renderer/node-text2/style.mapcss
index cb17205c8..d474955a7 100644
--- a/test/data/renderer/node-text2/style.mapcss
+++ b/test/data/renderer/node-text2/style.mapcss
@@ -3,6 +3,7 @@
  * Text placement test
  */
 node[test=text-placement]::* {
+	font-family: "DejaVu Sans";
     font-size: 10;
     text: auto;
     symbol-shape: square;
diff --git a/test/functional/org/openstreetmap/josm/gui/mappaint/MapCSSRendererTest.java b/test/functional/org/openstreetmap/josm/gui/mappaint/MapCSSRendererTest.java
index 58177f778..2952a98ab 100644
--- a/test/functional/org/openstreetmap/josm/gui/mappaint/MapCSSRendererTest.java
+++ b/test/functional/org/openstreetmap/josm/gui/mappaint/MapCSSRendererTest.java
@@ -101,7 +101,7 @@ public class MapCSSRendererTest {
                         .setThresholdPixels(0).setThresholdTotalColorDiff(0),
 
                 /** Tests area label drawing/placement */
-                new TestConfig("area-text", AREA_DEFAULT)
+                new TestConfig("area-text", AREA_DEFAULT).usesFont("DejaVu Sans")
                         .setThresholdPixels(0).setThresholdTotalColorDiff(0),
 
                 /** Tests area icon drawing/placement */
@@ -120,7 +120,7 @@ public class MapCSSRendererTest {
                         .setThresholdPixels(0).setThresholdTotalColorDiff(0),
 
                 /** Tests text along a way */
-                new TestConfig("way-text", AREA_DEFAULT)
+                new TestConfig("way-text", AREA_DEFAULT).usesFont("DejaVu Sans")
                         .setThresholdPixels(3400).setThresholdTotalColorDiff(0),
 
                 /** Another test for node shapes */
@@ -136,7 +136,7 @@ public class MapCSSRendererTest {
                 new TestConfig("way-dashes2")
                         .setThresholdPixels(0).setThresholdTotalColorDiff(0),
                 /** Tests node text placement */
-                new TestConfig("node-text2")
+                new TestConfig("node-text2").usesFont("DejaVu Sans")
                         .setThresholdPixels(1020).setThresholdTotalColorDiff(0),
                 /** Tests relation link selector */
                 new TestConfig("relation-linkselector")
@@ -146,7 +146,7 @@ public class MapCSSRendererTest {
                         .setThresholdPixels(0).setThresholdTotalColorDiff(0),
 
                 /** Tests evaluation of expressions */
-                new TestConfig("eval").setImageWidth(600)
+                new TestConfig("eval").setImageWidth(600).usesFont("DejaVu Sans")
                         .setThresholdPixels(6610).setThresholdTotalColorDiff(0)
 
                 ).map(e -> new Object[] {e, e.testDirectory})
@@ -227,8 +227,8 @@ public class MapCSSRendererTest {
             return;
         }
         final BufferedImage reference = ImageIO.read(referenceImageFile);
-        assertEquals(image.getWidth(), reference.getWidth());
-        assertEquals(image.getHeight(), reference.getHeight());
+        assertEquals(reference.getWidth(), image.getWidth());
+        assertEquals(reference.getHeight(), image.getHeight());
 
         StringBuilder differences = new StringBuilder();
         ArrayList<Point> differencePoints = new ArrayList<>();
