pub struct TextMetrics { /* private fields */ }Implementations§
Source§impl TextMetrics
impl TextMetrics
pub fn new(font_bytes: &[u8], bake_size_px: f32) -> Result<Self>
Sourcepub fn measure(&self, text: &str, size_px: f32) -> [f32; 2]
pub fn measure(&self, text: &str, size_px: f32) -> [f32; 2]
Measures advances and full line boxes, including the final line gap.
pub fn bake_size_px(&self) -> f32
Sourcepub fn line_height_px(&self) -> f32
pub fn line_height_px(&self) -> f32
At the bake size.
Auto Trait Implementations§
impl Freeze for TextMetrics
impl RefUnwindSafe for TextMetrics
impl Send for TextMetrics
impl Sync for TextMetrics
impl Unpin for TextMetrics
impl UnsafeUnpin for TextMetrics
impl UnwindSafe for TextMetrics
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