pub struct StyleBuilder { /* private fields */ }Expand description
Builder for creating ASS styles with fluent API
Implementations§
Source§impl StyleBuilder
impl StyleBuilder
Sourcepub fn default_style() -> Self
pub fn default_style() -> Self
Create a style builder with default values
Sourcepub fn secondary_color(self, color: &str) -> Self
pub fn secondary_color(self, color: &str) -> Self
Set secondary color (for collision effects)
Sourcepub fn outline_color(self, color: &str) -> Self
pub fn outline_color(self, color: &str) -> Self
Set outline color
Sourcepub fn back_color(self, color: &str) -> Self
pub fn back_color(self, color: &str) -> Self
Set shadow/background color
Sourcepub fn border_style(self, style: u32) -> Self
pub fn border_style(self, style: u32) -> Self
Set border style (1=outline+shadow, 3=opaque box)
Sourcepub fn margin_left(self, margin: u32) -> Self
pub fn margin_left(self, margin: u32) -> Self
Set left margin in pixels
Sourcepub fn margin_right(self, margin: u32) -> Self
pub fn margin_right(self, margin: u32) -> Self
Set right margin in pixels
Sourcepub fn margin_vertical(self, margin: u32) -> Self
pub fn margin_vertical(self, margin: u32) -> Self
Set vertical margin in pixels
Sourcepub fn margin_top(self, margin: u32) -> Self
pub fn margin_top(self, margin: u32) -> Self
Set top margin in pixels (V4++)
Sourcepub fn margin_bottom(self, margin: u32) -> Self
pub fn margin_bottom(self, margin: u32) -> Self
Set bottom margin in pixels (V4++)
Sourcepub fn alpha_level(self, alpha: u32) -> Self
pub fn alpha_level(self, alpha: u32) -> Self
Set alpha level (SSA v4) - transparency from 0-255 (0=opaque, 255=transparent)
Sourcepub fn relative_to(self, relative: &str) -> Self
pub fn relative_to(self, relative: &str) -> Self
Set positioning context (V4++)
Sourcepub fn build_with_version(self, version: ScriptVersion) -> Result<String>
pub fn build_with_version(self, version: ScriptVersion) -> Result<String>
Build the style with a specific version format
Sourcepub fn build_with_format(&self, format: &[&str]) -> Result<String>
pub fn build_with_format(&self, format: &[&str]) -> Result<String>
Build the style with a specific format line The format parameter should contain field names like [“Name”, “Fontname”, “Fontsize”, …]
Trait Implementations§
Source§impl Clone for StyleBuilder
impl Clone for StyleBuilder
Source§fn clone(&self) -> StyleBuilder
fn clone(&self) -> StyleBuilder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for StyleBuilder
impl Debug for StyleBuilder
Source§impl Default for StyleBuilder
impl Default for StyleBuilder
Source§fn default() -> StyleBuilder
fn default() -> StyleBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for StyleBuilder
impl RefUnwindSafe for StyleBuilder
impl Send for StyleBuilder
impl Sync for StyleBuilder
impl Unpin for StyleBuilder
impl UnwindSafe for StyleBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more