Expand description
A friendly Rust wrapper around the excellent NanoSVG C library. Offering simple SVG parsing and rasterizing.
§Example
extern crate nsvg;
use std::path::Path;
fn main() {
let path = Path::new("examples/example.svg");
// Load and parse the svg
let svg = nsvg::parse_file(path, nsvg::Units::Pixel, 96.0).unwrap();
// Create a scaled raster
let scale = 2.0;
let image = svg.rasterize(scale);
}
Re-exports§
pub extern crate image;
Structs§
Enums§
Functions§
- parse_
file - Loads SVG data from a file at the given
Path
. - parse_
str - Loads SVG data from the given SVG text contents.