pub struct BaselineGrid {
pub interval_subpx: u32,
pub offset_subpx: u32,
}Expand description
Baseline grid alignment configuration.
When active, line positions are snapped to a regular vertical grid to maintain consistent vertical rhythm. This is essential for multi-column layouts where lines should align across columns.
Fields§
§interval_subpx: u32Grid interval in sub-pixel units.
All line positions are rounded up to the nearest multiple of this value. Typically set to the line height (line_height + leading).
offset_subpx: u32Offset from the top of the text area (sub-pixel units).
Shifts the grid to align with an arbitrary starting position.
Implementations§
Source§impl BaselineGrid
impl BaselineGrid
Sourcepub const fn from_line_height(
line_height_subpx: u32,
leading_subpx: u32,
) -> Self
pub const fn from_line_height( line_height_subpx: u32, leading_subpx: u32, ) -> Self
Create a grid from line height and leading.
Trait Implementations§
Source§impl Clone for BaselineGrid
impl Clone for BaselineGrid
Source§fn clone(&self) -> BaselineGrid
fn clone(&self) -> BaselineGrid
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for BaselineGrid
Source§impl Debug for BaselineGrid
impl Debug for BaselineGrid
Source§impl Default for BaselineGrid
impl Default for BaselineGrid
impl Eq for BaselineGrid
Source§impl Hash for BaselineGrid
impl Hash for BaselineGrid
Source§impl PartialEq for BaselineGrid
impl PartialEq for BaselineGrid
Source§fn eq(&self, other: &BaselineGrid) -> bool
fn eq(&self, other: &BaselineGrid) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for BaselineGrid
Auto Trait Implementations§
impl Freeze for BaselineGrid
impl RefUnwindSafe for BaselineGrid
impl Send for BaselineGrid
impl Sync for BaselineGrid
impl Unpin for BaselineGrid
impl UnsafeUnpin for BaselineGrid
impl UnwindSafe for BaselineGrid
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.