pub struct TextMetrics {
pub normal: [f32; 95],
pub medium: [f32; 95],
pub serif: [[f32; 95]; 2],
pub monospace: [[f32; 95]; 2],
pub system_font: SystemFont,
pub normal_baseline_offset: f32,
pub medium_baseline_offset: f32,
}Expand description
Backend-supplied normalized ASCII advances. Fixed storage; no per-frame font queries.
Fields§
§normal: [f32; 95]§medium: [f32; 95]§serif: [[f32; 95]; 2]§monospace: [[f32; 95]; 2]§system_font: SystemFont§normal_baseline_offset: f32Baseline displacement from the center of a text line, in em units.
medium_baseline_offset: f32Implementations§
Source§impl TextMetrics
impl TextMetrics
Sourcepub fn set_family_advance(
&mut self,
family: u32,
code: u32,
normal: f32,
medium: f32,
)
pub fn set_family_advance( &mut self, family: u32, code: u32, normal: f32, medium: f32, )
Set browser-calibrated ASCII advances for a family and two weight groups.
pub fn lines( &self, text: &str, max_width: f32, style: TextStyle, line: impl FnMut(&str), ) -> usize
pub fn width(&self, text: &str, style: TextStyle) -> f32
Trait Implementations§
Source§impl Clone for TextMetrics
impl Clone for TextMetrics
impl Copy for TextMetrics
Source§impl Debug for TextMetrics
impl Debug for TextMetrics
Source§impl Default for TextMetrics
impl Default for TextMetrics
Source§impl PartialEq for TextMetrics
impl PartialEq for TextMetrics
impl StructuralPartialEq for TextMetrics
Auto Trait Implementations§
impl Forget for TextMetrics
impl Freeze for TextMetrics
impl Move 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