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-loadingpub 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.
- Composite
Operation State - Determines how a new (“source”) data is displayed against an existing (“destination”) data.
- Draw
Command - Represents a command to draw an image with a set of quads.
- FontId
- A font handle.
- Font
Metrics - Information about a font.
- Glyph
Draw Commands - Represents the drawing commands for glyphs, separated into alpha and color glyphs.
- Image
Flags - Represents a set of flags that modify the behavior of an image.
- ImageId
- An image handle.
- Image
Info - 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. - Path
Iter - An iterator over the verbs and coordinates of a path.
- Positioned
Glyph - 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.
- Text
Context TextContextprovides functionality for text processing in femtovg.- Text
Metrics textlayout - 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.
- Blend
Factor - Blend factors.
- Composite
Operation - Predefined composite oprations.
- Error
Kind - Enum representing different types of errors that can occur in the canvas.
- Fill
Rule - Determines the fill rule used when filling paths.
- Image
Filter - Specifies the type of filter to apply to images with
crate::Canvas::filter_image. - Image
Source - Represents the source of an image.
- LineCap
- Determines the shape used to draw the end points of lines.
- Line
Join - Determines the shape used to join two line segments where they meet.
- Pixel
Format - Specifies the format of an image’s pixels.
- Render
Mode - 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.