Expand description
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());Enums§
- Data
Error - Errors that can occur when working with verovioxide data resources.
Functions§
- available_
fonts - Lists all available SMuFL font names based on enabled features.
- default_
font - Returns the default font name.
- extract_
resources - Extracts all embedded resources to a temporary directory.
- has_
bravura - Returns
trueif the Bravura font is available. - has_
gootville - Returns
trueif the Gootville font is available. - has_
leipzig - Returns
trueif the Leipzig font is available. - has_
leland - Returns
trueif the Leland font is available. - has_
petaluma - Returns
trueif the Petaluma font is available. - resource_
dir - Returns a reference to the embedded verovio data directory.