//! Native CLI tests explicitly supply real font resources; runtime lookup has //! no installed-distribution or bundled-font fallback. use std::{path::PathBuf, process::Command, sync::OnceLock}; pub fn command() -> Command { static MAP: OnceLock = OnceLock::new(); let root = PathBuf::from(env!("CARGO_MANIFEST_DIR")); let map = MAP.get_or_init(|| { let r = Command::new("kpsewhich") .arg("pdftex.map") .output() .expect("reference font map required"); assert!(r.status.success()); PathBuf::from(String::from_utf8(r.stdout).unwrap().trim()) .parent() .unwrap() .to_owned() }); let mut c = Command::new(env!("CARGO_BIN_EXE_texrra")); c.env("TFMFONTS", root.join("crates/texrra-tex-core/assets")); c.env("T1FONTS", root.join("assets/fonts")); c.env("TEXFONTMAPS", map); c }