Skip to main content

CaptionStyle

Struct CaptionStyle 

Source
pub struct CaptionStyle {
    pub foreground_color: Option<CaptionSetting<Color>>,
    pub foreground_opacity: Option<CaptionSetting<f64>>,
    pub background_color: Option<CaptionSetting<Color>>,
    pub background_opacity: Option<CaptionSetting<f64>>,
    pub window_color: Option<CaptionSetting<Color>>,
    pub window_opacity: Option<CaptionSetting<f64>>,
    pub window_corner_radius: Option<CaptionSetting<f64>>,
    pub edge: Option<CaptionSetting<CueTextEdge>>,
    pub edge_color: Option<CaptionSetting<Color>>,
    pub typeface: Option<CaptionSetting<CaptionTypeface>>,
    pub text_scale: Option<CaptionSetting<f64>>,
}
Expand description

What the system’s settings say of how subtitles and captions look.

Fields§

§foreground_color: Option<CaptionSetting<Color>>

The text’s colour, opaque: Apple’s foreground colour, Android’s foregroundColor, Windows’ FontColor.

§foreground_opacity: Option<CaptionSetting<f64>>

The text’s opacity, from 0.0 to 1.0: Apple’s foreground opacity, the alpha of Android’s foregroundColor, Windows’ FontOpacity.

§background_color: Option<CaptionSetting<Color>>

The colour behind each character, opaque: Apple’s background colour, Android’s backgroundColor, Windows’ BackgroundColor.

§background_opacity: Option<CaptionSetting<f64>>

The opacity behind each character: Apple’s background opacity, the alpha of Android’s backgroundColor, Windows’ BackgroundOpacity.

§window_color: Option<CaptionSetting<Color>>

The colour of the box behind a whole cue, opaque: Apple’s window colour, Android’s windowColor, Windows’ RegionColor.

§window_opacity: Option<CaptionSetting<f64>>

The opacity of the box behind a whole cue: Apple’s window opacity, the alpha of Android’s windowColor, Windows’ RegionOpacity.

§window_corner_radius: Option<CaptionSetting<f64>>

The radius the box’s corners are rounded by, in logical pixels: Apple’s window rounded corner radius, which Chromium and WebKit read as the cue’s border-radius.

§edge: Option<CaptionSetting<CueTextEdge>>

What is drawn round the characters: Apple’s text edge style, Android’s edgeType, Windows’ FontEffect.

§edge_color: Option<CaptionSetting<Color>>

The colour of the edge, with its opacity: Android’s edgeColor. Apple and Windows give none.

§typeface: Option<CaptionSetting<CaptionTypeface>>

The font: Apple’s font for its default style, Android’s typeface, Windows’ FontStyle.

§text_scale: Option<CaptionSetting<f64>>

How many times its own size text is drawn at: Apple’s relative character size, Android’s getFontScale, Windows’ FontSize as a fraction.

Trait Implementations§

Source§

impl Clone for CaptionStyle

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for CaptionStyle

Source§

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

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

impl Default for CaptionStyle

Source§

fn default() -> Self

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

impl PartialEq for CaptionStyle

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for CaptionStyle

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Downcast<T> for T

Source§

fn downcast(&self) -> &T

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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 = !

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

fn try_from(value: U) -> Result<T, !>

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> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,