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: String
Text to render.
Newline characters ("\n") cause the text to wrap.
halign: HAlign
Horizontal alignment of the caption within the template rectangle.
Default is HAlign::Center.
valign: VAlign
Vertical alignment of the caption within the template rectangle.
font: String
Name of the font to render the caption with. Defaults to `"Impact".
color: Color
Text color, defaults to white.
outline: Option<Color>
Text of the color outline, if any. Defaults to black.
Pass None to draw the text without outline.
Methods
impl Caption[src]
fn at(valign: VAlign) -> Self
Create an empty Caption at the particular vertical alignment.
fn text_at<S: Into<String>>(valign: VAlign, s: S) -> Self
Create a Caption with a text at the particular vertical alignment.
Trait Implementations
impl<'de> Deserialize<'de> for Caption[src]
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Clone for Caption[src]
fn clone(&self) -> Caption
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0
Performs copy-assignment from source. Read more
impl PartialEq for Caption[src]
fn eq(&self, __arg_0: &Caption) -> bool
This method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, __arg_0: &Caption) -> bool
This method tests for !=.