pub struct LayoutCtx<'a> { /* private fields */ }Implementations§
Source§impl<'a> LayoutCtx<'a>
impl<'a> LayoutCtx<'a>
pub fn new(text: &'a mut TextSystem) -> Self
pub fn text_width(&mut self, text: &str, size: f32) -> f32
pub fn text_width_weighted( &mut self, text: &str, size: f32, weight: FontWeight, ) -> f32
pub fn text_width_spaced( &mut self, text: &str, size: f32, spacing: LetterSpacing, ) -> f32
pub fn text_width_weighted_spaced( &mut self, text: &str, size: f32, weight: FontWeight, spacing: LetterSpacing, ) -> f32
pub fn text_width_styled_spaced( &mut self, text: &str, size: f32, weight: FontWeight, spacing: LetterSpacing, family: Option<&str>, style: FontStyle, ) -> f32
pub fn caret_positions( &mut self, text: &str, size: f32, weight: FontWeight, ) -> Vec<f32>
pub fn caret_positions_spaced( &mut self, text: &str, size: f32, weight: FontWeight, spacing: LetterSpacing, ) -> Vec<f32>
pub fn text_wrapped_size( &mut self, text: &str, size: f32, weight: FontWeight, width: f32, mode: WrapMode, ) -> Size
pub fn text_wrapped_size_spaced( &mut self, text: &str, size: f32, weight: FontWeight, width: f32, mode: WrapMode, spacing: LetterSpacing, ) -> Size
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
pub fn text_elided_size( &mut self, text: &str, size: f32, weight: FontWeight, max_width: f32, mode: ElideMode, ) -> Size
pub fn text_elided_size_spaced( &mut self, text: &str, size: f32, weight: FontWeight, max_width: f32, mode: ElideMode, spacing: LetterSpacing, ) -> Size
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
pub fn text_line_height(size: f32) -> f32
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more