Rustovio

CI docs crates.io

Rust bindings to Verovio. It offer the raw bindings and a limited wrapper.

Limitations

This currrently does not work on Windows, mostly because I don't have one to check how to do the setup.

To use this library, you need to have a C++ runtime available for dynamic linking.

Wrapper

rust let mut tk = VerovioToolkit::new("verovio/data").unwrap(); tk.load_data_from_file(filename); println!("{}", tk.render_to_svg(1).unwrap());

Bindings

```rust let data = fs::readtostring(filename).expect("Something went wrong reading the file"); let cdata = CString::new(data).unwrap();

let resource_folder = CString::new("verovio/data").unwrap();

let svgstr = unsafe { let tk = bindings::vrvToolkitconstructorResourcePath(resourcefolder.asptr()); bindings::vrvToolkitloadData(tk, cdata.asptr()); let svg = bindings::vrvToolkitrenderToSVG(tk, 1, std::ptr::null::()); CStr::fromptr(svg) }; println!("{}", svgstr.tostr().unwrap()); ```