pub struct EngineMeasurer<'a>(pub &'a TextEngine);Expand description
Adapts a TextEngine to the core’s TextMeasurer.
Tuple Fields§
§0: &'a TextEngineTrait Implementations§
Source§impl<'a> Clone for EngineMeasurer<'a>
impl<'a> Clone for EngineMeasurer<'a>
impl<'a> Copy for EngineMeasurer<'a>
Source§impl<'a> Debug for EngineMeasurer<'a>
impl<'a> Debug for EngineMeasurer<'a>
Source§impl TextMeasurer for EngineMeasurer<'_>
impl TextMeasurer for EngineMeasurer<'_>
Source§fn ascii_advances(&self, style: FontStyleRef) -> &[f32; 128]
fn ascii_advances(&self, style: FontStyleRef) -> &[f32; 128]
Advance widths of ASCII characters 0..128 at a font size of 1 px.
Source§fn subscript_advances(&self, style: FontStyleRef) -> Option<&[f32; 10]>
fn subscript_advances(&self, style: FontStyleRef) -> Option<&[f32; 10]>
Advance widths of the subscript digits
₀..=₉ (U+2080..=U+2089) at
a font size of 1 px. With a table, text made of ASCII and these digits
(small prices with automatic precision) takes the fast path; None
sends it to measure.Source§fn measure(&self, text: &str, style: FontStyleRef) -> SizePx
fn measure(&self, text: &str, style: FontStyleRef) -> SizePx
Size of arbitrary (non-ASCII) text in physical pixels. Slow path.
Source§fn line_height(&self, style: FontStyleRef) -> f32
fn line_height(&self, style: FontStyleRef) -> f32
Height of a line box (ascent - descent + line gap) in physical pixels.
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for EngineMeasurer<'a>
impl<'a> !UnwindSafe for EngineMeasurer<'a>
impl<'a> Forget for EngineMeasurer<'a>
impl<'a> Freeze for EngineMeasurer<'a>
impl<'a> Move for EngineMeasurer<'a>
impl<'a> Send for EngineMeasurer<'a>
impl<'a> Sync for EngineMeasurer<'a>
impl<'a> Unpin for EngineMeasurer<'a>
impl<'a> UnsafeUnpin for EngineMeasurer<'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