https://github.com/alphamodder/svg-path
A simple, dependencyless Rust library for composing SVG path data strings
https://github.com/alphamodder/svg-path
rust svg
Last synced: 11 months ago
JSON representation
A simple, dependencyless Rust library for composing SVG path data strings
- Host: GitHub
- URL: https://github.com/alphamodder/svg-path
- Owner: AlphaModder
- License: mit
- Created: 2020-10-07T01:48:20.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-10-13T01:24:18.000Z (over 5 years ago)
- Last Synced: 2025-02-08T15:28:47.929Z (about 1 year ago)
- Topics: rust, svg
- Language: Rust
- Homepage: https://github.com/AlphaModder/svg-path
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# `svg-path`
`svg-path` is a simple, dependencyless library for composing [SVG path data strings](https://www.w3.org/TR/SVG/paths.html), intended for use in Rust-based frontend frameworks and tools that output SVG. It consists of a single type, `Path`, which supports a simple and type-safe builder-like syntax for appending path commands, and implements `Display` for conversion into the SVG syntax.
`Path` also includes helper methods for producing certain common path shapes that can be nontrivial to express directly (currently just `Path::partial_circle`).
## Future plans
Considerations for the future of this library, depending on demand, include:
- Support for concatenation of `Path` objects
- Support for passing data types other than `f32` for command values
- First-class treatment of commands with a `PathCommand` enum of some sort.
- Support for parsing `Path` objects from strings (likely behind a feature, since this would probably mean introducing dependencies.)
## Alternatives and related projects
- [`svgtypes`](https://github.com/bodoni/svg), a library with parsers and composers for many SVG data types (but not the XML syntax itself).
- [`svg_minimal`](https://github.com/36den/svg_minimal-rs), a similarly minimal path-focused SVG library
- [`svg`](https://github.com/bodoni/svg), a full SVG composer and parser
- [`nsvg`](https://github.com/nickbrowne/nsvg), a Rust wrapper for the NanoSVG C library.
- [`rsvg`](https://crates.io/crates/rsvg), Rust bindings to the `rsvg` library
- [`resvg`](https://github.com/RazrFalcon/resvg), a Rust SVG renderer
- [`lyon_path`](https://github.com/nical/lyon/tree/master/path), a library with an SVG-inspired path data structure