pub enum FontSize {
Pt(f32),
Px(f32),
}Expand description
A font size with an explicit unit.
In TOML presets, this appears as either size_pt (typographic points)
or size_px (logical pixels). Serde mapping is handled by the parent
struct (FontSpec, TextScaleEntry) — FontSize itself has no
Serialize/Deserialize impl.
During validation, all FontSize values are converted to logical pixels
via FontSize::to_px(dpi), producing a plain f32 for the resolved model.
Variants§
Pt(f32)
Typographic points (1/72 inch). Used by platform presets where the OS
reports font sizes in points (KDE, GNOME, Windows).
Converted to px during validation: px = pt * dpi / 72.
Px(f32)
Logical pixels. Used by community/non-platform presets where font sizes are hand-authored in pixels.
Implementations§
Source§impl FontSize
impl FontSize
Trait Implementations§
impl Copy for FontSize
impl StructuralPartialEq for FontSize
Auto Trait Implementations§
impl Freeze for FontSize
impl RefUnwindSafe for FontSize
impl Send for FontSize
impl Sync for FontSize
impl Unpin for FontSize
impl UnsafeUnpin for FontSize
impl UnwindSafe for FontSize
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