pub struct CellMetrics {
pub width_subpx: u32,
pub height_subpx: u32,
}Expand description
Cell dimensions in sub-pixel units (1/256 px) for deterministic layout.
Both width_subpx and height_subpx must be > 0. Use CellMetrics::new
to validate.
Fields§
§width_subpx: u32Cell width in sub-pixel units (1/256 px).
height_subpx: u32Cell height in sub-pixel units (1/256 px).
Implementations§
Source§impl CellMetrics
impl CellMetrics
Sourcepub const MONOSPACE_DEFAULT: Self
pub const MONOSPACE_DEFAULT: Self
Monospace terminal default: 8x16 px.
Sourcepub fn new(width_subpx: u32, height_subpx: u32) -> Option<Self>
pub fn new(width_subpx: u32, height_subpx: u32) -> Option<Self>
Create cell metrics from sub-pixel values.
Returns None if either dimension is zero.
Trait Implementations§
Source§impl Clone for CellMetrics
impl Clone for CellMetrics
Source§fn clone(&self) -> CellMetrics
fn clone(&self) -> CellMetrics
Returns a duplicate 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 CellMetrics
impl Debug for CellMetrics
Source§impl Default for CellMetrics
impl Default for CellMetrics
Source§impl Display for CellMetrics
impl Display for CellMetrics
Source§impl Hash for CellMetrics
impl Hash for CellMetrics
Source§impl PartialEq for CellMetrics
impl PartialEq for CellMetrics
impl Copy for CellMetrics
impl Eq for CellMetrics
impl StructuralPartialEq for CellMetrics
Auto Trait Implementations§
impl Freeze for CellMetrics
impl RefUnwindSafe for CellMetrics
impl Send for CellMetrics
impl Sync for CellMetrics
impl Unpin for CellMetrics
impl UnsafeUnpin for CellMetrics
impl UnwindSafe for CellMetrics
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