Crate femtovg

Crate femtovg 

Source
Expand description

The femtovg API is (like NanoVG) loosely modeled on the HTML5 Canvas API.

The coordinate system’s origin is the top-left corner, with positive X rightwards, positive Y downwards.

Re-exports§

pub use renderer::RenderTarget;
pub use renderer::Renderer;
pub use ::image as img;image-loading
pub use imgref;
pub use rgb;

Modules§

renderer
Module containing renderer implementations.

Structs§

Atlas
Represents an atlas for packing rectangles.
Canvas
Main 2D drawing context.
Color
Struct representing a color with red, green, blue, and alpha components.
CompositeOperationState
Determines how a new (“source”) data is displayed against an existing (“destination”) data.
DrawCommand
Represents a command to draw an image with a set of quads.
FontId
A font handle.
FontMetrics
Information about a font.
GlyphDrawCommands
Represents the drawing commands for glyphs, separated into alpha and color glyphs.
ImageFlags
Represents a set of flags that modify the behavior of an image.
ImageId
An image handle.
ImageInfo
Information about an image.
Paint
Struct controlling how graphical shapes are rendered.
Path
A collection of verbs (move_to(), line_to(), bezier_to(), etc.) describing one or more contours.
PathIter
An iterator over the verbs and coordinates of a path.
PositionedGlyph
This struct holds the parameter needs to draw a single glyph using the low-level fill_glyphs and stroke_glyphs API.
Quad
Represents a quad with position and texture coordinates.
TextContext
TextContext provides functionality for text processing in femtovg.
TextMetricstextlayout
Represents the result of a text shaping run.
Transform2D
2×3 matrix (2 rows, 3 columns) used for 2D linear transformations. It can represent transformations such as translation, rotation, or scaling.

Enums§

Align
Represents the horizontal alignment of text.
Baseline
Represents the vertical alignment of a text baseline.
BlendFactor
Blend factors.
CompositeOperation
Predefined composite oprations.
ErrorKind
Enum representing different types of errors that can occur in the canvas.
FillRule
Determines the fill rule used when filling paths.
ImageFilter
Specifies the type of filter to apply to images with crate::Canvas::filter_image.
ImageSource
Represents the source of an image.
LineCap
Determines the shape used to draw the end points of lines.
LineJoin
Determines the shape used to join two line segments where they meet.
PixelFormat
Specifies the format of an image’s pixels.
RenderMode
Represents the rendering mode for a path.
Solidity
Specifies whether a shape is solid or a hole when adding it to a path.
Verb
A verb describes how to interpret one or more points to continue the countour of a Path.