1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
//! Shared harness for headless (`iced_test::Simulator`) UI tests — Task 108
//! Amendment A1 §1.
//!
//! `Simulator::new`'s own default `Settings` leaves two gaps versus the
//! real application (`main.rs`): it falls back to `Font::with_name("Fira
//! Sans")` whenever `default_font` is left at `Font::DEFAULT`
//! (`iced_test`'s own `Simulator::with_size`), while `main.rs` never sets
//! one either and so draws with whatever the system resolves
//! `Font::DEFAULT` (`Family::SansSerif`) to; and it never loads knotra's
//! icon font (`main.rs`'s own `.font(knotra_ui::widget::icon::
//! FONT_BYTES)`), so an icon glyph measures as whatever the fallback
//! font's missing-glyph box is, not the icon's own advance width. Either
//! gap makes every width this harness measures the wrong font's.
//!
//! "Noto Sans" is this machine's actual system sans-serif (confirmed with
//! `fc-match sans-serif`, via the `fonts-noto-core` package) and CI's
//! Linux test job installs the same package (Task 108 A1 §4) — so every
//! headless test measures the same widths this machine's, and CI's, real
//! window would. Japanese text falls back by script, through the
//! renderer's own font database, to whichever CJK face is installed —
//! `fonts-noto-cjk` on CI, confirmed locally to resolve to "Noto Sans CJK
//! JP" (see the CJK snapshot, `headless_probe.rs`).
//!
//! `#[cfg(test)]`-only: this module never compiles into the shipped
//! binary.
pub
/// A real window's *logical* area at `zoom_percent`, derived from its
/// *physical* size — the same arithmetic `main.rs`'s own
/// `.scale_factor(|state| zoom_percent / 100)` hook applies, and the same
/// one `headless_probe.rs`'s own `zoom_is_simulated_by_a_smaller_logical_
/// size` test first demonstrated inline. Centralised here so every caller
/// that needs a zoomed logical size (the label-overflow guard's own
/// matrix included) derives it the same way, from the same physical size,
/// rather than re-deriving the formula at each call site.
pub