Struct rofl::Caption [] [src]

pub struct Caption {
    pub text: String,
    pub halign: HAlign,
    pub valign: VAlign,
    pub font: String,
    pub color: Color,
    pub outline: Option<Color>,
}

Describes a single piece of text rendered on the image macro.

Use the provided Caption::text_at method to create it with most of the fields set to default values.

Fields

Text to render.

Newline characters ("\n") cause the text to wrap.

Horizontal alignment of the caption within the template rectangle. Default is HAlign::Center.

Vertical alignment of the caption within the template rectangle.

Name of the font to render the caption with. Defaults to `"Impact".

Text color, defaults to white.

Text of the color outline, if any. Defaults to black. Pass None to draw the text without outline.

Methods

impl Caption
[src]

Create an empty Caption at the particular vertical alignment.

Create a Caption with a text at the particular vertical alignment.

Trait Implementations

impl<'de> Deserialize<'de> for Caption
[src]

Deserialize this value from the given Serde deserializer. Read more

impl Clone for Caption
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl PartialEq for Caption
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Debug for Caption
[src]

Formats the value using the given formatter.