pub struct TextStyle {Show 19 fields
pub family: String,
pub size: f64,
pub weight: String,
pub style: String,
pub align: TextAlign,
pub vertical_align: TextVerticalAlign,
pub line_height: f64,
pub wrap: bool,
pub overflow: TextOverflow,
pub color: Color,
pub background: Option<Color>,
pub padding: (f64, f64, f64, f64),
pub border_width: f64,
pub border_color: Option<Color>,
pub border_radius: f64,
pub rotate: f64,
pub stroke_width: f64,
pub stroke_color: Option<Color>,
pub rich: Vec<(String, RichTextStyle)>,
}Expand description
A text style, covering the font, the alignment, and the wrapping behaviour of a label.
Fields§
§family: StringThe font family list, as a CSS font-family value.
size: f64The font size, in pixels.
weight: StringThe font weight, as a CSS font-weight value.
style: StringThe font style, as a CSS font-style value.
align: TextAlignThe horizontal alignment of the text relative to its anchor point.
vertical_align: TextVerticalAlignThe vertical alignment of the text relative to its anchor point.
line_height: f64The line height, as a multiple of the font size.
wrap: boolWhether the text wraps when it exceeds its box.
overflow: TextOverflowWhat happens to text that does not fit.
color: ColorThe colour of the text.
background: Option<Color>The colour painted behind the text, if any.
padding: (f64, f64, f64, f64)The padding between the text and its background, in pixels.
border_width: f64The border width drawn around the text, in pixels.
border_color: Option<Color>The colour of the border drawn around the text.
border_radius: f64The radius of the background’s rounded corners, in pixels.
rotate: f64The rotation of the text, in degrees, around its anchor point.
stroke_width: f64The stroke width of the text outline.
stroke_color: Option<Color>The colour of the text outline.
rich: Vec<(String, RichTextStyle)>The per-run style overrides, keyed by the name used in the text’s
{name|…} markup.
Implementations§
Source§impl TextStyle
Inherent implementation of TextStyle.
impl TextStyle
Inherent implementation of TextStyle.