Bundled SMuFL fonts and resources for verovioxide.
This crate embeds the SMuFL fonts and related resources from the Verovio project for use at runtime. The data includes glyph definitions, bounding boxes, and optional CSS files with embedded WOFF2 fonts for web output.
Font Features
By default, only the Leipzig font is included. Additional fonts can be enabled via feature flags:
font-leipzig(default) - Leipzig SMuFL fontfont-bravura- Bravura SMuFL fontfont-gootville- Gootville SMuFL fontfont-leland- Leland SMuFL fontfont-petaluma- Petaluma SMuFL fontall-fonts- Enable all fonts
Note: Bravura is always included as baseline because it's used to build the glyph name table in Verovio.
Example
use verovioxide_data::{resource_dir, extract_resources};
// Access embedded resources directly (in-memory)
let dir = resource_dir();
if let Some(bravura) = dir.get_file("Bravura.xml") {
let contents = bravura.contents_utf8().unwrap();
println!("Bravura bounding boxes loaded: {} bytes", contents.len());
}
// Or extract to a temporary directory for file-based access
let temp_dir = extract_resources().expect("Failed to extract resources");
let path = temp_dir.path().join("Bravura.xml");
assert!(path.exists());