From 7db080e684901ae277e25038a5e22b6cecbf74f7 Mon Sep 17 00:00:00 2001 From: Liu Date: Thu, 19 Nov 2026 22:49:34 +0800 Subject: [PATCH] test: use the logical monospace font in layout fixtures Ubuntu Mono and Consola did not exist on Windows (Consola is a typo), so the fixtures fell back to Microsoft YaHei, a proportional font. Use the monospace alias so both platforms select their system monospace font, and unify the flex title height expectation now that Windows also wraps. --- tests/fixtures/test_block_layout.css | 2 +- tests/fixtures/test_flex_layout.css | 2 +- tests/fixtures/test_flex_layout_percentage_wrap.css | 2 +- tests/integration/test_flex_layout.c | 12 ++---------- 4 files changed, 5 insertions(+), 13 deletions(-) diff --git a/tests/fixtures/test_block_layout.css b/tests/fixtures/test_block_layout.css index 6dbbccb4..a27a21ec 100644 --- a/tests/fixtures/test_block_layout.css +++ b/tests/fixtures/test_block_layout.css @@ -2,7 +2,7 @@ text, body { font-size: 14px; line-height: 1.6; - font-family: "Ubuntu Mono", "Consola"; + font-family: monospace; } body { diff --git a/tests/fixtures/test_flex_layout.css b/tests/fixtures/test_flex_layout.css index b3b60565..fddd7be4 100644 --- a/tests/fixtures/test_flex_layout.css +++ b/tests/fixtures/test_flex_layout.css @@ -2,7 +2,7 @@ text, body { font-size: 14px; line-height: 1.6; - font-family: "Ubuntu Mono", "Consola"; + font-family: monospace; } scrollarea-content { diff --git a/tests/fixtures/test_flex_layout_percentage_wrap.css b/tests/fixtures/test_flex_layout_percentage_wrap.css index bafa7fd6..40182b97 100644 --- a/tests/fixtures/test_flex_layout_percentage_wrap.css +++ b/tests/fixtures/test_flex_layout_percentage_wrap.css @@ -2,7 +2,7 @@ text, body { font-size: 14px; line-height: 1.6; - font-family: "Ubuntu Mono", "Consola"; + font-family: monospace; } scrollarea-content { diff --git a/tests/integration/test_flex_layout.c b/tests/integration/test_flex_layout.c index 1421557a..76677b6e 100644 --- a/tests/integration/test_flex_layout.c +++ b/tests/integration/test_flex_layout.c @@ -604,12 +604,8 @@ static void test_flex_layout_320(void) &rect); rect.y += rect.height + 10; -#ifdef _WIN32 - rect.height = 354; -#else - /* Ubuntu Mono wraps this title to an extra line on Linux. */ + /* monospace wraps this title to an extra line. */ rect.height = 376; -#endif w = ui_widget_get_child(container, 10); ctest_equal_ui_rect("$('.example')[10].border_box", &w->border_box, &rect); @@ -621,12 +617,8 @@ static void test_flex_layout_320(void) &rect); rect.y += rect.height + 10; -#ifdef _WIN32 - rect.height = 354; -#else - /* Ubuntu Mono wraps this title to an extra line on Linux. */ + /* monospace wraps this title to an extra line. */ rect.height = 376; -#endif w = ui_widget_get_child(container, 12); ctest_equal_ui_rect("$('.example')[12].border_box", &w->border_box, &rect);