pub enum Generator {
Fill {
paint: Paint,
},
Shapes {
items: Vec<ShapeItem>,
},
Text {
text: String,
style: TextStyle,
},
}Expand description
The picture of a generated source.
A generated picture has the canvas’s size and aspect, like a source that
fills the frame at scale 1. Positions are in its normalized space, (0, 0)
top-left to (1, 1) bottom-right; lengths (radii, stroke widths) are
fractions of its shorter side, so the picture is the same at any render
resolution. A fill or text does not change over time (a clip animates it
with its transform, effects, and masks); shapes may.
Variants§
Fill
Paint over the whole picture.
Shapes
Shapes drawn from an ordered content tree, as an After Effects shape layer or a Lottie shape layer draws them. Unlike the other generators, its picture changes over time: every value in the tree may be keyframed, in the picture’s time.
Text
Text on a transparent picture, laid out and placed by its style as a
caption track’s cues are: its size and wrapping width fractions of
the canvas, its anchor at style.position. The engine draws it with
the fonts its host registered.
Fields
text: StringThe text; \n starts a line. Non-empty, at most
MAX_TEXT_CONTENT_BYTES bytes.
style: TextStyleHow it looks and where it lies. The font size is at most
MAX_TEXT_GENERATOR_FONT_SIZE.