pub struct LaidOutLine {
pub text_range: Range<usize>,
pub width: f32,
pub ascent: f32,
pub descent: f32,
pub baseline_y: f32,
}Expand description
Metrics for one laid-out line.
Distances are logical pixels. text_range is a half-open UTF-8 byte range
in the original string. descent follows Parley’s metric convention and is
normally non-negative.
§Examples
use ailloli_ui_text::LaidOutLine;
let line = LaidOutLine {
text_range: 0..5,
width: 40.0,
ascent: 12.0,
descent: 4.0,
baseline_y: 12.0,
};
assert_eq!(line.text_range, 0..5);Fields§
§text_range: Range<usize>Half-open UTF-8 byte range covered by the line.
width: f32Advance excluding trailing whitespace, in logical pixels.
ascent: f32Distance above the baseline, in logical pixels.
descent: f32Distance below the baseline, in logical pixels.
baseline_y: f32Baseline Y coordinate relative to the layout origin, in logical pixels.
Trait Implementations§
Source§impl Clone for LaidOutLine
impl Clone for LaidOutLine
Source§fn clone(&self) -> LaidOutLine
fn clone(&self) -> LaidOutLine
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LaidOutLine
impl Debug for LaidOutLine
Source§impl PartialEq for LaidOutLine
impl PartialEq for LaidOutLine
impl StructuralPartialEq for LaidOutLine
Auto Trait Implementations§
impl Freeze for LaidOutLine
impl RefUnwindSafe for LaidOutLine
impl Send for LaidOutLine
impl Sync for LaidOutLine
impl Unpin for LaidOutLine
impl UnwindSafe for LaidOutLine
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