pub struct VerticalMetrics {
pub advance: f32,
pub upright: bool,
}Expand description
Vertical-layout metrics for a single glyph.
In vertical text, glyphs advance along the block (Y) axis rather than the
inline (X) axis. The advance field reflects the block-direction advance,
and upright controls whether the glyph is drawn in its natural orientation
or rotated.
Fields§
§advance: f32Block-direction advance in the same units as em_size.
Ideally sourced from the font’s vmtx table; falls back to 1 em.
upright: booltrue → draw upright (CJK-style); false → rotate 90° clockwise.
Implementations§
Source§impl VerticalMetrics
impl VerticalMetrics
Sourcepub fn for_char(c: char, em_size: f32) -> Self
pub fn for_char(c: char, em_size: f32) -> Self
Compute vertical metrics for character c at the given em_size.
The advance defaults to em_size (1 em) when no vmtx data is
available. Use VerticalMetrics::for_glyph when font bytes are
available for accurate vmtx advances.
Auto Trait Implementations§
impl Freeze for VerticalMetrics
impl RefUnwindSafe for VerticalMetrics
impl Send for VerticalMetrics
impl Sync for VerticalMetrics
impl Unpin for VerticalMetrics
impl UnsafeUnpin for VerticalMetrics
impl UnwindSafe for VerticalMetrics
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> 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