Skip to main content

CachedFontTextMeasurer

Struct CachedFontTextMeasurer 

Source
pub struct CachedFontTextMeasurer { /* private fields */ }

Implementations§

Trait Implementations§

Source§

impl TextMeasurer for CachedFontTextMeasurer

Source§

fn measure(&self, text: &AnnotatedString, style: &TextStyle) -> TextMetrics

Source§

fn get_offset_for_position( &self, text: &AnnotatedString, style: &TextStyle, x: f32, _y: f32, ) -> usize

Source§

fn get_cursor_x_for_offset( &self, text: &AnnotatedString, style: &TextStyle, offset: usize, ) -> f32

Source§

fn layout(&self, text: &AnnotatedString, style: &TextStyle) -> TextLayoutResult

Source§

fn choose_auto_hyphen_break( &self, line: &str, style: &TextStyle, segment_start_char: usize, measured_break_char: usize, ) -> Option<usize>

Returns an alternate break boundary for Hyphens::Auto when a greedy break split lands in the middle of a word. Read more
Source§

fn measure_for_node( &self, node_id: Option<usize>, text: &AnnotatedString, style: &TextStyle, ) -> TextMetrics

Source§

fn measure_subsequence( &self, text: &AnnotatedString, range: Range<usize>, style: &TextStyle, ) -> TextMetrics

Source§

fn measure_subsequence_for_node( &self, node_id: Option<usize>, text: &AnnotatedString, range: Range<usize>, style: &TextStyle, ) -> TextMetrics

Source§

fn measure_line_prefix_widths( &self, text: &AnnotatedString, line_range: Range<usize>, style: &TextStyle, ) -> Option<TextLinePrefixWidths>

Source§

fn measure_line_width( &self, text: &AnnotatedString, line_range: Range<usize>, style: &TextStyle, ) -> Option<f32>

Source§

fn line_height(&self, text: &AnnotatedString, style: &TextStyle) -> f32

Source§

fn glyph_line_box(&self, style: &TextStyle) -> Option<(f32, f32)>

The tight glyph box of a text line inside its line_height slot: (top_offset, height) in logical units, where height is the font’s natural ascent+descent extent and top_offset positions it within the slot (glyph rows are vertically centered). Selection chrome — the highlight, the caret and the finger handles — anchors to THIS box, not the full slot: with a paragraph line height above the natural one the reference shows gaps between highlighted lines and handles riding the glyphs. None means the box fills the slot.
Source§

fn line_height_for_node( &self, node_id: Option<usize>, text: &AnnotatedString, style: &TextStyle, ) -> f32

Source§

fn measure_with_options( &self, text: &AnnotatedString, style: &TextStyle, options: TextLayoutOptions, max_width: Option<f32>, ) -> TextMetrics

Source§

fn measure_with_options_for_node( &self, node_id: Option<usize>, text: &AnnotatedString, style: &TextStyle, options: TextLayoutOptions, max_width: Option<f32>, ) -> TextMetrics

Source§

fn prepare_with_options( &self, text: &AnnotatedString, style: &TextStyle, options: TextLayoutOptions, max_width: Option<f32>, ) -> PreparedTextLayout

Source§

fn prepare_with_options_for_node( &self, node_id: Option<usize>, text: &AnnotatedString, style: &TextStyle, options: TextLayoutOptions, max_width: Option<f32>, ) -> PreparedTextLayout

Source§

fn prepare_with_options_fallback( &self, text: &AnnotatedString, style: &TextStyle, options: TextLayoutOptions, max_width: Option<f32>, ) -> PreparedTextLayout

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> 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 = Infallible

The type returned in the event of a conversion error.
Source§

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

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.