Skip to content

DioxusLabs/anyrender

Repository files navigation

AnyRender

A Rust 2D drawing abstraction.

Linebender Zulip, #kurbo channel dependency status Apache 2.0 or MIT license. Crates.io Docs

AnyRender is a 2D drawing abstaction that allows applications/frameworks to support many rendering backends through a unified API.

Discussion of AnyRender development happens in the Linebender Zulip at https://xi.zulipchat.com/.

Crates

anyrender

The core anyrender crate is a lightweight type/trait-only crate that defines three abstractions:

  • The PaintScene trait accepts drawing commands. Applications and libraries draw by pushing commands into a PaintScene. Backends generally execute those commands to produce an output (although they may do other things like store them for later use).
  • The WindowRenderer trait abstracts over types that can render to a window
  • The ImageRenderer trait abstracts over types that can render to a Vec<u8> image buffer

Backends

Currently existing backends are:

Contributions for other backends (tiny-skia, femtovg, etc) would be very welcome.

Content renderers

These crates sit on top of the the AnyRender abstraction, and allow you render content through it:

  • anyrender_svg allows you to render SVGs with AnyRender. usvg is used to parse the SVGs.
  • blitz-paint can be used to HTML/CSS (and markdown) that has been parsed, styled, and layouted by blitz-dom using AnyRender.
  • polymorpher implements Material Design 3 shape morphing, and can be used with AnyRender by enabling the kurbo feature.

Utility crates

Minimum supported Rust Version (MSRV)

This version of AnyRender has been verified to compile with Rust 1.86 and later.

Future versions of AnyRender might increase the Rust version requirement. It will not be treated as a breaking change and as such can even happen with small patch releases.

License

Licensed under either of

at your option.

Contribution

Contributions are welcome by pull request. The Rust code of conduct applies.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be licensed as above, without any additional terms or conditions.

About

Rust 2D drawing abstraction

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages