Skip to main content

GenericTextRunProperties

Struct GenericTextRunProperties 

Source
pub struct GenericTextRunProperties { /* private fields */ }
Expand description

Generic implementation of TextRunProperties.

Implementations§

Source§

impl GenericTextRunProperties

Source

pub const DEFAULT_FONT_RENDERING_EM_SIZE: f64 = 12.0

Source

pub fn new(typeface: Typeface) -> Self

Creates properties for a typeface with the default em size (12) and nothing else set.

Source

pub fn with_font_size(typeface: Typeface, font_rendering_em_size: f64) -> Self

Creates properties for a typeface and em size.

Source

pub fn with_all( typeface: Typeface, font_rendering_em_size: f64, text_decorations: Option<TextDecorationCollection>, foreground_brush: Option<Rc<dyn IBrush>>, background_brush: Option<Rc<dyn IBrush>>, baseline_alignment: BaselineAlignment, culture_info: Option<CultureInfo>, font_features: Option<FontFeatureCollection>, ) -> Self

Creates properties with every value specified.

Trait Implementations§

Source§

impl TextRunProperties for GenericTextRunProperties

Source§

fn typeface(&self) -> &Typeface

Run typeface.
Source§

fn font_rendering_em_size(&self) -> f64

Em size of font used to format and display text.
Source§

fn text_decorations(&self) -> Option<&TextDecorationCollection>

Run text decorations.
Source§

fn foreground_brush(&self) -> Option<&Rc<dyn IBrush>>

Brush used to fill text.
Source§

fn background_brush(&self) -> Option<&Rc<dyn IBrush>>

Brush used to paint background of run.
Source§

fn font_features(&self) -> Option<&FontFeatureCollection>

Optional features of used font.
Source§

fn baseline_alignment(&self) -> BaselineAlignment

Run vertical box alignment.
Source§

fn culture_info(&self) -> Option<&CultureInfo>

Run text culture.
Source§

fn cached_glyph_typeface(&self) -> Rc<GlyphTypeface>

The glyph typeface of TextRunProperties::typeface. 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> 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, 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.