[rust-dev] [ANN] Rust binding for NanoVG vector-graphics library

Kevin Kelley kevin at kelleysoft.com
Sun Jul 6 16:34:57 PDT 2014

I'd like to announce a binding to NanoVG - a small vector-graphics library
written in C that runs on OpenGL backends.


I'm using this project as a way to familiarize with Rust, and so am happy to
learn whatever I can.  Comments and suggestions are very welcome.


The project is at https://github.com/KevinKelley/nanovg-rs



NanoVG (https://github.com/memononen/nanovg) gives you a low-level vector
graphics context, from which you can compose shapes, gradients, beziers, and
so on; all generated through OpenGL primitives (I think there's a Direct3D
port too).  Image-loading is from stb-image; and truetype fonts are
supported as well.  


It's a small library; it doesn't have the extent of cairo-graphics but it's


I have implemented the complete API in rust starting with rust-bindgen, and
directly translated the example demo to Rust.  At the moment that's the only
sort of documentation I've done - you'll have to look into the source to see
how it works.  The original NanoVG headers are pretty well documented, and
I'll move that text into my wrapper so that rust-doc can find it. shortly.


Development is done on linux, using the OpenGL3 backend.  I'll be testing on
Windows at some point, but haven't yet; Mac is not in my budget.


It might be worthwhile at some point to port the library to Rust, rather
than wrapping it; on the other hand that would mean more difficulty tracking
updates to the original project.  


Anyway.  It's here, and it runs; it's early days so expect some warts.  But
it's something that I definitely needed, so maybe it's useful to others as


License on the NanoVG project is zlib; I'm putting this bindings project
under MIT.



Kevin Kelley


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/rust-dev/attachments/20140706/cf1d35b2/attachment.html>

More information about the Rust-dev mailing list