Skip to main content

TextLayoutOptions

Struct TextLayoutOptions 

Source
pub struct TextLayoutOptions {
Show 15 fields pub font_size: f64, pub foreground: Option<Rc<dyn IBrush>>, pub text_alignment: TextAlignment, pub text_wrapping: TextWrapping, pub text_trimming: Option<Rc<dyn TextTrimming>>, pub text_decorations: Option<TextDecorationCollection>, pub flow_direction: FlowDirection, pub max_width: f64, pub max_height: f64, pub line_height: f64, pub letter_spacing: f64, pub max_lines: i32, pub font_features: Option<FontFeatureCollection>, pub text_style_overrides: Option<Rc<[ValueSpan<Rc<dyn TextRunProperties>>]>>, pub text_run_cache: Option<Rc<TextRunCache>>,
}
Expand description

The optional parameters of TextLayout::new. Default gives upstream’s parameter defaults.

Fields§

§font_size: f64

Size of the font.

§foreground: Option<Rc<dyn IBrush>>

The foreground.

§text_alignment: TextAlignment

The text alignment.

§text_wrapping: TextWrapping

The text wrapping.

§text_trimming: Option<Rc<dyn TextTrimming>>

The text trimming (None means no trimming).

§text_decorations: Option<TextDecorationCollection>

The text decorations.

§flow_direction: FlowDirection

The text flow direction.

§max_width: f64

The maximum width.

§max_height: f64

The maximum height.

§line_height: f64

The height of each line of text.

§letter_spacing: f64

The letter spacing that is applied to rendered glyphs.

§max_lines: i32

The maximum number of text lines.

§font_features: Option<FontFeatureCollection>

Optional list of turned on/off features.

§text_style_overrides: Option<Rc<[ValueSpan<Rc<dyn TextRunProperties>>]>>

The text style overrides.

§text_run_cache: Option<Rc<TextRunCache>>

An optional cache for shaped text runs to avoid redundant shaping.

Trait Implementations§

Source§

impl Clone for TextLayoutOptions

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 Default for TextLayoutOptions

Source§

fn default() -> Self

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

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> ClassDefaults for T
where T: ?Sized,

Source§

fn static_constructor()

The static constructor of a type: work done once per thread, after the properties of the type are registered and before its first instance exists (class handlers, affects_render, metadata overrides). 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 = !

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.