femtovg

Crates.iofemtovg
lib.rsfemtovg
version0.9.1
sourcesrc
created_at2020-09-28 16:31:11.843694
updated_at2024-04-12 09:15:23.101735
descriptionAntialiased 2D vector drawing library
homepage
repositoryhttps://github.com/femtovg/femtovg
max_upload_size
id293756
size553,191
Simon Hausmann (tronical)

documentation

README

Crates.io API dependency status rust: 1.66 Discord

femtovg

GPU Antialiased 2D vector drawing library written in Rust.


Ported from https://github.com/memononen/nanovg

Most of the implementation is the same as the original C code with some bug fixes, some features added and several parts have been made more Rust-y. Rendering is done via one OpenGl (ES) 3.0+ backend.

Screenshots

Demo

demo Run with cargo run --example demo

Breakout

breakout Run with cargo run --example breakout

SVG

svg Run with cargo run --example svg

Text

text Run with cargo run --example text

Features

  • Anti-aliasing
  • B├ęzier paths filling and stroking
  • Solid color and image pattern fills and strokes
  • Gradients - box, linear and radial
  • Stroke width and miterlimit
  • Stroke caps: butt, round and square
  • Stroke joins: miter, round and bevel
  • Fill rules - EvenOdd/NonZero
  • Rectangle scissoring
  • Composition modes (SourceOver, SourceIn, SourceOut, Atop, etc..)
  • Global alpha
  • Text filling and stroking
  • Text shaping
  • Text alignment: (left center right), (top, middle, alphabetic, bottom)
  • Nearest font matching
  • Path hit testing
  • OpenGl ES2 backend

In progress

Not supported

  • Stroke dashing
  • Path scissoring
  • Custom shaders
  • 3D transforms
  • Color fonts

License

Licensed under either of

Fonts used in examples:

Commit count: 736

cargo fmt