Skip to content

[Bug]: Test a_report_measures_each_layout_page_with_its_own_page_number fails on Windows: Segoe UI fits the two-digit page numbers in two lines #3417

Done

Description

@dwarburg

Before you start

  • I searched the existing issues and did not find a duplicate.
  • This is a bug report, not a usage question (questions belong in Discussions).

What happened?

tests::layout_report_text::a_report_measures_each_layout_page_with_its_own_page_number
(crates/engine/src/tests/layout_report_text.rs, added in #3215) fails on Windows on every run,
including alone:

assertion `left == right` failed
  left: []
 right: ["The report, layout \"Sheet\": Text is cut off in 1 layout element(s): Text (7); resize or move the text, or reduce its size"]

The test puts {page} eight times in an 18 × 6 mm box at 10 pt, which holds two lines, and expects
page 10's two-digit numbers to wrap to three lines. Whether they do depends on the font: layout text
is measured with the installed font (crates/render/src/fonts.rs), which is Segoe UI on Windows.
Measured with rustgis_render::layout::wrapped_lines(text, 18.0, 10.0, …):

Font Page 9 Page 10
Segoe UI (C:\Windows\Fonts\segoeui.ttf) 2 lines 2 lines: 10 10 10 10 / 10 10 10 10 (fits, no notice)
Built-in Ubuntu Light (RUSTGIS_BUILTIN_FONTS=1) 2 lines 3 lines (cut off, as the test expects)

With RUSTGIS_BUILTIN_FONTS=1 the test passes on the same machine. (The other layout_report_text tests pass with both fonts. A whole-workspace run with the built-in font isn't a clean alternative: render and ui-egui tests that expect an installed font then fail.)

It may also be why main's Windows test jobs went red: test / Test (windows-latest) passed on
9fbbdd4 (2026-11-28 10:17 UTC) and has failed on every finished main run since #3215 landed
(c3ccc31, 11:16 UTC), while Linux passes. macOS was failing before #3215, so that's something else.

Steps to reproduce

On Windows 11 with Segoe UI installed (the default):

cargo test -p rustgis-engine --lib -- tests::layout_report_text::a_report_measures_each_layout_page_with_its_own_page_number

Then the same with RUSTGIS_BUILTIN_FONTS=1 set: it passes.

Expected behavior

The test passes whatever font is installed. One way: choose the box width from the font's own
measures (with wrapped_lines), so that one-digit page numbers fit in two lines and two-digit ones
need a third, rather than relying on a fixed 18 mm.

How are you running RustGIS?

Desktop app (built from source)

Version

713d33a

Operating system, browser and graphics

Windows 11 + AMD Radeon 8060S Graphics

Sample data

No response

Screenshots or logs

No response

Activity

  1. added
    unconfirmed possible issue
    on Nov 30, 2026
  2. dwarburg commented on Nov 30, 2026

    @dwarburg
    ContributorAuthor

    This was already fixed by #3397 (6668f9e), which merged about two hours before I filed this.
    The test now runs in a child process with RUSTGIS_BUILTIN_FONTS=1. On current main (f551803)
    it passes on Windows 11 with Segoe UI installed, along with the other layout_report_text tests.
    I filed this from a checkout that predated the fix, so I'm closing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    unconfirmed possible issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions