Struct SSAStyle

Source
pub struct SSAStyle {
Show 23 fields pub name: String, pub fontname: String, pub fontsize: f32, pub primary_color: Option<Color>, pub secondary_color: Option<Color>, pub outline_color: Option<Color>, pub back_color: Option<Color>, pub bold: bool, pub italic: bool, pub underline: bool, pub strikeout: bool, pub scale_x: f32, pub scale_y: f32, pub spacing: f32, pub angle: f32, pub border_style: u8, pub outline: f32, pub shadow: f32, pub alignment: Alignment, pub margin_l: f32, pub margin_r: f32, pub margin_v: f32, pub encoding: f32,
}
Expand description

SSAStyle describes each part of the Format: side of a .ssa or .ass subtitle.

Currently only supports .ass, more precisely ScriptType: V4.00+ and [V4+ Styles]

Fields§

§name: String

Name of the style. Case-sensitive. Cannot include commas.

§fontname: String

Fontname as used by Windows. Case-sensitive.

§fontsize: f32

Fontsize.

§primary_color: Option<Color>

The color that a subtitle will normally appear in.

§secondary_color: Option<Color>

This color may be used instead of the Primary colour when a subtitle is automatically shifted to prevent an onscreen collision, to distinguish the different subtitles.

§outline_color: Option<Color>

This color may be used instead of the Primary or Secondary colour when a subtitle is automatically shifted to prevent an onscreen collision, to distinguish the different subtitles.

§back_color: Option<Color>

The color of the subtitle outline or shadow.

§bold: bool

Defines whether text is bold or not.

§italic: bool

Defines whether text is italic or not.

§underline: bool

Defines whether text is underlined or not.

§strikeout: bool

Defines whether text is strikeout or not.

§scale_x: f32

Modifies the width of the font. Value is percentage.

§scale_y: f32

Modifies the height of the font. Value is percentage.

§spacing: f32

Extra space between characters (in pixels).

§angle: f32

Origin of the rotation is defined by the alignment (as degrees).

§border_style: u8

Border style. Allowed values are:

  • 1: Outline + drop shadow
  • 3: Opaque box
§outline: f32

If SSAStyle::border_style is 1, then this specifies the width of the outline around the text (in pixels). Values may be 0, 1, 2, 3 or 4.

§shadow: f32

If SSAStyle::border_style is 1, then this specifies the depth of the drop shadow behind the text (in pixels). Values may be 0, 1, 2, 3 or 4. Drop shadow is always used in addition to an outline - SSA will force an outline of 1 pixel if no outline width is given.

§alignment: Alignment

Sets how text is “justified” within the Left/Right onscreen margins, and also the vertical placing.

§margin_l: f32

Defines the Left Margin in pixels.

§margin_r: f32

Defines the Right Margin in pixels.

§margin_v: f32

Defines the Vertical Left Margin in pixels.

§encoding: f32

Specifies the font character set or encoding and on multilingual Windows installations it provides access to characters used in multiple than one language. It is usually 0 (zero) for English (Western, ANSI) Windows.

Trait Implementations§

Source§

impl Clone for SSAStyle

Source§

fn clone(&self) -> SSAStyle

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SSAStyle

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for SSAStyle

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for SSAStyle

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for SSAStyle

Source§

fn eq(&self, other: &SSAStyle) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for SSAStyle

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Eq for SSAStyle

Source§

impl StructuralPartialEq for SSAStyle

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,