Struct piet_web::WebTextLayout

source ·
pub struct WebTextLayout { /* private fields */ }

Trait Implementations§

source§

impl Clone for WebTextLayout

source§

fn clone(&self) -> WebTextLayout

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for WebTextLayout

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl TextLayout for WebTextLayout

source§

fn size(&self) -> Size

The total size of this TextLayout. Read more
source§

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

Returns a Rect representing the bounding box of the glyphs in this layout, relative to the top-left of the layout object. Read more
source§

fn text(&self) -> &str

The text used to create this layout.
source§

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>

Given a line number, return a reference to that line’s metrics, if the line exists. Read more
source§

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

Given a Point, return a HitTestPoint describing the corresponding text position. Read more
source§

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 more
source§

fn rects_for_range(&self, range: impl RangeBounds<usize>) -> Vec<Rect, Global>

Returns a vector of Rects that cover the region of the text indicated by range. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere
    T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere
    T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere
    T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere
    U: From<T>,

const: unstable · 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> RoundFrom<T> for T

source§

fn round_from(x: T) -> T

Performs the conversion.
source§

impl<T, U> RoundInto<U> for Twhere
    U: RoundFrom<T>,

source§

fn round_into(self) -> U

Performs the conversion.
source§

impl<T> ToOwned for Twhere
    T: Clone,

§

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 Twhere
    U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere
    U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.