Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
F

femtovg

> 编程语言
Open source

Antialiased 2D vector drawing library written in Rust

931 stars0 likes0 views
WebsiteGitHub

About

Antialiased 2D vector drawing library written in Rust

femtovg

GPU Antialiased 2D vector drawing library written in Rust.

  • Cargo crate
  • Book
  • Join the femtovg Discord channel

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, radial (including two-point / focal), and conic, with multi-stop colors and gradient transforms
  • 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..)
  • Image filters - gaussian blur and color matrices (the CSS filter functions), chained in a single call
  • Layers - group capture with declared opacity and layer filters (Canvas 2D beginLayer/endLayer, SVG group effects)
  • Layer masks - luminance and alpha (SVG mask / mask-type)
  • 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
  • WGPU backend
  • Color fonts

Not supported

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

Ecosystem

FemtoVG is used by these projects:

  • pn-editor : view, edit, and simulate petri nets
  • Slint : A declarative GUI toolkit to build native user interfaces for embedded, desktop, and mobile application
  • inlottie : lib/tool in Rust for Lottie (Bodymovin) Animation
  • Mapvas : A map canvas showing OSM tiles with drawing functionality

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

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Rust

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言