pub enum VerticalPosition {
Normal,
Superscript {
size_ratio: f32,
baseline_rise: f32,
},
Subscript {
size_ratio: f32,
baseline_drop: f32,
},
}Expand description
Vertical text positioning for subscript/superscript effects.
Variants§
Normal
Normal baseline.
Superscript
Superscript: smaller text raised above the baseline.
Fields
Subscript
Subscript: smaller text lowered below the baseline.
Implementations§
Source§impl VerticalPosition
impl VerticalPosition
Sourcepub fn effective_size(&self, base_px: f32) -> f32
pub fn effective_size(&self, base_px: f32) -> f32
Compute the actual font size for this position given a base size.
Sourcepub fn baseline_adjustment(&self, _base_px: f32) -> f32
pub fn baseline_adjustment(&self, _base_px: f32) -> f32
Compute the Y baseline adjustment in pixels (positive = upward).
Trait Implementations§
Source§impl Clone for VerticalPosition
impl Clone for VerticalPosition
Source§fn clone(&self) -> VerticalPosition
fn clone(&self) -> VerticalPosition
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 moreSource§impl Debug for VerticalPosition
impl Debug for VerticalPosition
Source§impl Default for VerticalPosition
impl Default for VerticalPosition
Source§fn default() -> VerticalPosition
fn default() -> VerticalPosition
Returns the “default value” for a type. Read more
Source§impl PartialEq for VerticalPosition
impl PartialEq for VerticalPosition
Source§fn eq(&self, other: &VerticalPosition) -> bool
fn eq(&self, other: &VerticalPosition) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for VerticalPosition
impl StructuralPartialEq for VerticalPosition
Auto Trait Implementations§
impl Freeze for VerticalPosition
impl RefUnwindSafe for VerticalPosition
impl Send for VerticalPosition
impl Sync for VerticalPosition
impl Unpin for VerticalPosition
impl UnsafeUnpin for VerticalPosition
impl UnwindSafe for VerticalPosition
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,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more