pub struct TerminalCellMetrics {
pub cell_width: f32,
pub cell_height: f32,
pub baseline: f32,
}Expand description
Measured monospace cell geometry in logical pixels.
Values are not validated by Self::new. Runtime measurement clamps cell
width/height and baseline fallbacks to at least 1.0.
§Examples
use ailloli_ui_widgets::controls::TerminalCellMetrics;
let metrics = TerminalCellMetrics::new(8.0, 19.0, 14.0);
assert_eq!((metrics.cell_width, metrics.cell_height, metrics.baseline), (8.0, 19.0, 14.0));Fields§
§cell_width: f32Width of one terminal column in logical pixels.
cell_height: f32Height of one terminal row in logical pixels.
baseline: f32Baseline offset from the row top in logical pixels.
Implementations§
Source§impl TerminalCellMetrics
impl TerminalCellMetrics
Sourcepub const fn new(cell_width: f32, cell_height: f32, baseline: f32) -> Self
pub const fn new(cell_width: f32, cell_height: f32, baseline: f32) -> Self
Stores cell metrics unchanged, including zero or non-finite values.
§Examples
use ailloli_ui_widgets::controls::TerminalCellMetrics;
let metrics = TerminalCellMetrics::new(7.5, 18.0, 13.0);
assert_eq!(metrics.cell_width, 7.5);Trait Implementations§
Source§impl Clone for TerminalCellMetrics
impl Clone for TerminalCellMetrics
Source§fn clone(&self) -> TerminalCellMetrics
fn clone(&self) -> TerminalCellMetrics
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 TerminalCellMetrics
impl Debug for TerminalCellMetrics
Source§impl PartialEq for TerminalCellMetrics
impl PartialEq for TerminalCellMetrics
impl Copy for TerminalCellMetrics
impl StructuralPartialEq for TerminalCellMetrics
Auto Trait Implementations§
impl Freeze for TerminalCellMetrics
impl RefUnwindSafe for TerminalCellMetrics
impl Send for TerminalCellMetrics
impl Sync for TerminalCellMetrics
impl Unpin for TerminalCellMetrics
impl UnwindSafe for TerminalCellMetrics
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<A> IntoClickAction<A> for Awhere
A: Clone + 'static,
impl<A> IntoClickAction<A> for Awhere
A: Clone + 'static,
§fn into_click_action(self) -> ClickAction<A>
fn into_click_action(self) -> ClickAction<A>
Implements the into_click_action helper used by this module.