Skip to main content

LayoutCtx

Struct LayoutCtx 

Source
pub struct LayoutCtx<'a> { /* private fields */ }

Implementations§

Source§

impl<'a> LayoutCtx<'a>

Source

pub fn new(text: &'a mut TextSystem) -> Self

Source

pub fn text_width(&mut self, text: &str, size: f32) -> f32

Source

pub fn text_width_weighted( &mut self, text: &str, size: f32, weight: FontWeight, ) -> f32

Source

pub fn text_width_spaced( &mut self, text: &str, size: f32, spacing: LetterSpacing, ) -> f32

Source

pub fn text_width_weighted_spaced( &mut self, text: &str, size: f32, weight: FontWeight, spacing: LetterSpacing, ) -> f32

Source

pub fn text_width_styled_spaced( &mut self, text: &str, size: f32, weight: FontWeight, spacing: LetterSpacing, family: Option<&str>, style: FontStyle, ) -> f32

Source

pub fn caret_positions( &mut self, text: &str, size: f32, weight: FontWeight, ) -> Vec<f32>

Source

pub fn caret_positions_spaced( &mut self, text: &str, size: f32, weight: FontWeight, spacing: LetterSpacing, ) -> Vec<f32>

Source

pub fn text_wrapped_size( &mut self, text: &str, size: f32, weight: FontWeight, width: f32, mode: WrapMode, ) -> Size

Source

pub fn text_wrapped_size_spaced( &mut self, text: &str, size: f32, weight: FontWeight, width: f32, mode: WrapMode, spacing: LetterSpacing, ) -> Size

Source

pub fn text_wrapped_size_styled_spaced( &mut self, text: &str, size: f32, weight: FontWeight, width: f32, mode: WrapMode, spacing: LetterSpacing, family: Option<&str>, style: FontStyle, ) -> Size

Source

pub fn text_elided_size( &mut self, text: &str, size: f32, weight: FontWeight, max_width: f32, mode: ElideMode, ) -> Size

Source

pub fn text_elided_size_spaced( &mut self, text: &str, size: f32, weight: FontWeight, max_width: f32, mode: ElideMode, spacing: LetterSpacing, ) -> Size

Source

pub fn text_elided_size_styled_spaced( &mut self, text: &str, size: f32, weight: FontWeight, max_width: f32, mode: ElideMode, spacing: LetterSpacing, family: Option<&str>, style: FontStyle, ) -> Size

Source

pub fn text_line_height(size: f32) -> f32

Source

pub fn rich_size( &mut self, spans: &[TextSpan], size: f32, width: f32, mode: WrapMode, spacing: LetterSpacing, align: RichAlign, ) -> Size

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for LayoutCtx<'a>

§

impl<'a> !Send for LayoutCtx<'a>

§

impl<'a> !Sync for LayoutCtx<'a>

§

impl<'a> !UnwindSafe for LayoutCtx<'a>

§

impl<'a> Freeze for LayoutCtx<'a>

§

impl<'a> Unpin for LayoutCtx<'a>

§

impl<'a> UnsafeUnpin for LayoutCtx<'a>

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> 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.