pub struct SubtitleStyle {Show 16 fields
pub name: String,
pub font_family: Option<String>,
pub font_size: Option<f32>,
pub primary_color: Option<(u8, u8, u8, u8)>,
pub outline_color: Option<(u8, u8, u8, u8)>,
pub back_color: Option<(u8, u8, u8, u8)>,
pub bold: bool,
pub italic: bool,
pub underline: bool,
pub strike: bool,
pub align: TextAlign,
pub margin_l: Option<i32>,
pub margin_r: Option<i32>,
pub margin_v: Option<i32>,
pub outline: Option<f32>,
pub shadow: Option<f32>,
}Expand description
A named style definition — reusable across many cues.
Fields§
§name: StringStyle name that cues reference via SubtitleCue::style_ref
(ASS Style: name or WebVTT cue class).
font_family: Option<String>Font family name. None → renderer default.
font_size: Option<f32>Font size in the source format’s units (ASS Fontsize points).
None → renderer default.
primary_color: Option<(u8, u8, u8, u8)>Main text fill color as (r, g, b, a), each channel 0..=255.
None → renderer default.
outline_color: Option<(u8, u8, u8, u8)>Text outline (border) color as (r, g, b, a). None → default.
back_color: Option<(u8, u8, u8, u8)>Background / shadow color as (r, g, b, a) (ASS BackColour).
None → default.
bold: boolBold text.
italic: boolItalic text.
underline: boolUnderlined text.
strike: boolStrikethrough text.
align: TextAlignHorizontal text alignment.
margin_l: Option<i32>Left margin in pixels (ASS MarginL). None → default.
margin_r: Option<i32>Right margin in pixels (ASS MarginR). None → default.
margin_v: Option<i32>Vertical margin in pixels (ASS MarginV). None → default.
outline: Option<f32>Outline (border) thickness in pixels (ASS Outline).
None → default.
shadow: Option<f32>Drop-shadow offset in pixels (ASS Shadow). None → default.
Implementations§
Source§impl SubtitleStyle
impl SubtitleStyle
Sourcepub fn new(name: impl Into<String>) -> Self
pub fn new(name: impl Into<String>) -> Self
Build a style with the given name and every other field at its
default (None / false / TextAlign::Start).