Module vizia::vg

source ·
Expand description

Contains types and functions used for custom drawing within views. This is a re-export of femtovg.


  • Overview
  • In graphics code it’s very common to pass width and height along with a Vec of pixels, all as separate arguments. This is tedious, and can lead to errors.
  • Module containing renderer implementations.
  • Basic struct for RGB and RGBA pixels. Packed, with red first, alpha last.



  • Text horizontal alignment: Left (default), Center, Right.
  • Text baseline vertical alignment: Top, Middle, Alphabetic (default), Bottom.
  • Blend factors.
  • Predefined composite oprations.
  • Enum with all possible canvas errors that could occur.
  • The fill rule used when filling paths: EvenOdd, NonZero (default).
  • ImageFilter allows specifying the type of filter to apply to images with crate::Canvas::filter_image.
  • Image source
  • Determines the shape used to draw the end points of lines: Butt (default), Round, Square.
  • Determines the shape used to join two line segments where they meet. Miter (default), Round, Bevel.
  • Image format: Rgb8, Rgba8, Gray8.
  • Used to specify Solid/Hole when adding shapes to a path.
  • A verb describes how to interpret one or more points to continue the countour of a Path.