Files
effectcraft/crates/text/tests/it/system_font_menu.rs
T
aiongg 0173abde8c CI: dev-profile gate, one test binary per crate, nextest, line tables only (#2235)
* Dev profile: line tables only for workspace crates, no debug info for dependencies

* xtask ci: dev-profile gate, nextest, tests without examples, wasm --keep-going

* One integration-test binary per crate

* xtask ci: run effectcraft-gpu's shared-device tests in one cargo test process

* xtask ci: run every stage and report all failures

* xtask ci: name the stage type (clippy type_complexity)

* xtask ci: run every test pass and report all failures

* cargo fmt
2026-10-23 12:59:51 -04:00

20 lines
1.0 KiB
Rust

//! The font menus list the installed fonts (issue: on Windows the Properties panel's font menu
//! offered only Inter, JetBrains Mono and Noto Serif). Its own test binary, so the system font
//! scan has not run yet when it starts.
use effectcraft_text::fonts::{DirectorySource, FontSource, families, system_scanned};
#[test]
fn families_include_installed_fonts_without_a_prior_scan() {
assert!(!system_scanned(), "nothing has scanned yet in this process");
let listed: Vec<String> = families().into_iter().map(|(f, _)| f).collect();
assert!(system_scanned() || cfg!(target_arch = "wasm32"), "listing the families scans the system fonts");
for b in ["Inter", "JetBrains Mono", "Noto Serif"] {
assert!(listed.iter().any(|f| f == b), "bundled {b} listed");
}
// Every family found in the platform's font folders is in the menu.
for face in DirectorySource::system().faces() {
assert!(listed.iter().any(|f| f.eq_ignore_ascii_case(&face.family)), "installed family {} missing from {listed:?}", face.family);
}
}