38 releases
0.11.2 | Nov 17, 2024 |
---|---|
0.10.1 | Oct 24, 2024 |
0.9.2 | Jun 27, 2024 |
0.9.0 | Feb 27, 2024 |
0.1.0 | Sep 28, 2020 |
#25 in Graphics APIs
24,765 downloads per month
Used in 34 crates
(17 directly)
395KB
9K
SLoC
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
Run with cargo run --example demo
Breakout
Run with cargo run --example breakout
SVG
Run with cargo run --example svg
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
- Color fonts
Not supported
- Stroke dashing
- Path scissoring
- Custom shaders
- 3D transforms
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT) at your option.
Fonts used in examples:
- Roboto licensed under Apache license
- Entypo licensed under CC BY-SA 4.0.
- Amiri licensed under SIL Open Font License, Version 1.1
Dependencies
~7–44MB
~662K SLoC