/**
   * Loads SVG data from the given SVG text contents.
   *
   * # Arguments
   * - `svg_str` - Text contents of the SVG you want to load
   * - `units` - The length unit identifier, you probably just want `nsvg::Units::Pixel`
   * - `dpi` - Probably just want `96.0`.
   */
Loads SVG data from the given SVG text contents.
Loads SVG data from the given SVG text contents .
pub fn parse_str(svg_str: &str, units: Units, dpi: f32) -> Result<SvgImage, Error> {
    let svg_c_string = CString::new(svg_str)?.into_raw();
    let image = unsafe {
      let image = bindings::nsvgParse(svg_c_string, units.as_c_str(), dpi);
      CString::from_raw(svg_c_string);
      image
    };
    if image.is_null() {
      Err(Error::ParseError)
    } else {
      Ok(SvgImage { image })
    }
  }
pub fn parse_str ( svg_str : & str , units : Units , dpi : f32 ) -> Result < SvgImage , Error > { let svg_c_string = CString :: new ( svg_str ) ? . into_raw ( ) ; let image = unsafe { let image = bindings :: nsvgParse ( svg_c_string , units . as_c_str ( ) , dpi ) ; CString :: from_raw ( svg_c_string ) ; image } ; if image . is_null ( ) { Err ( Error :: ParseError ) } else { Ok ( SvgImage { image } ) } }
Loads SVG data from the given SVG text contents.
Loads SVG data from the given SVG text contents .
svg_str
&str
<not_specific>
units
Units
<not_specific>
dpi
f32
<not_specific>