Git Product home page Git Product logo

rustovio's Introduction

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

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

Bindings

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

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

let svg_str = unsafe {
    let tk = bindings::vrvToolkit_constructorResourcePath(resource_folder.as_ptr());
    bindings::vrvToolkit_loadData(tk, cdata.as_ptr());
    let svg = bindings::vrvToolkit_renderToSVG(tk, 1, std::ptr::null::<i8>());
    CStr::from_ptr(svg)
};
println!("{}", svg_str.to_str().unwrap());

rustovio's People

Contributors

mockersf avatar

Stargazers

 avatar

Watchers

 avatar  avatar

rustovio's Issues

make verovio build not touch FS

  • verovio/tools/get_git_commit.sh should not change FS
  • verovio/src/vrv.cpp should not include header #include "git_commit.h"

this blocks docs.rs builds and clean releases

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.