pub struct LineBox {
pub height: f32,
pub baseline: f32,
pub trim_top: f32,
pub trim_bottom: f32,
}Expand description
A resolved line box: how far apart a paragraph’s baselines are, where the baseline sits in each line, and what the paragraph’s first and last lines give back at its edges. All measured down from the top of a line.
Fields§
§height: f32Baseline-to-baseline advance: the height of every line before the paragraph’s edges are trimmed.
baseline: f32Distance from the top of a line down to its baseline.
trim_top: f32What the first line gives back above its glyphs.
trim_bottom: f32What the last line gives back below its glyphs.
Implementations§
Source§impl LineBox
impl LineBox
Sourcepub fn untrimmed(height: f32, baseline: f32) -> Self
pub fn untrimmed(height: f32, baseline: f32) -> Self
A box with nothing trimmed: height apart, baseline baseline down.
Sourcepub fn block_height(self, lines: usize) -> f32
pub fn block_height(self, lines: usize) -> f32
The height of a paragraph of lines lines: every line’s advance, less
what the first line’s top and the last line’s bottom give back.
Sourcepub fn first_baseline(self) -> f32
pub fn first_baseline(self) -> f32
The first line’s baseline, measured down from the paragraph’s top.
Trait Implementations§
impl Copy for LineBox
impl StructuralPartialEq for LineBox
Auto Trait Implementations§
impl Freeze for LineBox
impl RefUnwindSafe for LineBox
impl Send for LineBox
impl Sync for LineBox
impl Unpin for LineBox
impl UnsafeUnpin for LineBox
impl UnwindSafe for LineBox
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