Struct theo::TextLayout
source · pub struct TextLayout(_);
Expand description
The text layout for the system.
Trait Implementations§
source§impl Clone for TextLayout
impl Clone for TextLayout
source§fn clone(&self) -> TextLayout
fn clone(&self) -> TextLayout
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl TextLayout for TextLayout
impl TextLayout for TextLayout
source§fn trailing_whitespace_width(&self) -> f64
fn trailing_whitespace_width(&self) -> f64
The width of this layout, including the width of any trailing whitespace. Read more
source§fn image_bounds(&self) -> Rect
fn image_bounds(&self) -> Rect
Returns a
Rect
representing the bounding box of the glyphs in this layout,
relative to the top-left of the layout object. Read moresource§fn line_text(&self, line_number: usize) -> Option<&str>
fn line_text(&self, line_number: usize) -> Option<&str>
Given a line number, return a reference to that line’s underlying string. Read more
source§fn line_metric(&self, line_number: usize) -> Option<LineMetric>
fn line_metric(&self, line_number: usize) -> Option<LineMetric>
Given a line number, return a reference to that line’s metrics, if the line exists. Read more
source§fn line_count(&self) -> usize
fn line_count(&self) -> usize
Returns total number of lines in the text layout. Read more
source§fn hit_test_point(&self, point: Point) -> HitTestPoint
fn hit_test_point(&self, point: Point) -> HitTestPoint
source§fn hit_test_text_position(&self, idx: usize) -> HitTestPosition
fn hit_test_text_position(&self, idx: usize) -> HitTestPosition
Given a grapheme boundary in the string used to create this
TextLayout
,
return a HitTestPosition
object describing the location of that boundary
within the layout. Read moresource§fn rects_for_range(&self, range: impl RangeBounds<usize>) -> Vec<Rect, Global>
fn rects_for_range(&self, range: impl RangeBounds<usize>) -> Vec<Rect, Global>
Auto Trait Implementations§
impl !RefUnwindSafe for TextLayout
impl !Send for TextLayout
impl !Sync for TextLayout
impl Unpin for TextLayout
impl !UnwindSafe for TextLayout
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere T: Any,
§fn into_any(self: Box<T, Global>) -> Box<dyn Any, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any, Global>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T, Global>) -> Rc<dyn Any, Global>
fn into_any_rc(self: Rc<T, Global>) -> Rc<dyn Any, Global>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T, U> RoundInto<U> for Twhere
U: RoundFrom<T>,
impl<T, U> RoundInto<U> for Twhere U: RoundFrom<T>,
source§fn round_into(self) -> U
fn round_into(self) -> U
Performs the conversion.