diff --git a/solitaire_engine/src/assets/svg_loader.rs b/solitaire_engine/src/assets/svg_loader.rs index fa1ed7e..97c7db0 100644 --- a/solitaire_engine/src/assets/svg_loader.rs +++ b/solitaire_engine/src/assets/svg_loader.rs @@ -153,13 +153,28 @@ pub fn rasterize_svg(svg_bytes: &[u8], target: UVec2) -> Result Arc { DB.get_or_init(|| { let mut db = fontdb::Database::new(); db.load_system_fonts(); + // The bundled FiraMono lives at the workspace root, so the + // include_bytes! path goes up three levels from this source + // file (assets → src → solitaire_engine → workspace root). + db.load_font_data(include_bytes!("../../../assets/fonts/main.ttf").to_vec()); + // Pin the CSS generics to the bundled face as the resolution + // target. Named-family lookups (Bitstream Vera Sans, Arial) + // still try the system db first; only when those miss does + // the resolver fall through to SansSerif / Serif, and now + // those are guaranteed to land on FiraMono. + db.set_sans_serif_family("Fira Mono"); + db.set_serif_family("Fira Mono"); + db.set_monospace_family("Fira Mono"); + db.set_cursive_family("Fira Mono"); + db.set_fantasy_family("Fira Mono"); Arc::new(db) }) .clone()