pub struct TextMetrics {
pub min_width: Dim,
pub max_width: Dim,
pub height: Dim,
pub ascent: Dim,
pub descent: Dim,
pub lines: u32,
}
Expand description
Metrics of a text layout object.
Fields§
§min_width: Dim
Minimum width, is a width of the widest word (non-breakable sequence) in the text.
max_width: Dim
Maximum width, is the width of the text without wrapping.
If the text contains new line sequences then function returns width of widest string.
height: Dim
Computed height of the Text object and box height.
ascent: Dim
§descent: Dim
§lines: u32
Mumber of lines in text layout.
To get meaningful values you should set width of the text layout object
(with Text.set_box
, for example).
Trait Implementations§
Source§impl Debug for TextMetrics
impl Debug for TextMetrics
Source§impl Default for TextMetrics
impl Default for TextMetrics
Source§fn default() -> TextMetrics
fn default() -> TextMetrics
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for TextMetrics
impl RefUnwindSafe for TextMetrics
impl Send for TextMetrics
impl Sync for TextMetrics
impl Unpin 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