pub struct StyledRun {
pub glyphs: Vec<ShapedGlyph>,
pub metrics: FontVerticalMetrics,
pub px_size: f32,
pub color: Rgba8,
pub font_data: Arc<[u8]>,
pub vertical_position: VerticalPosition,
}Expand description
A pre-shaped run of glyphs with its own font metrics and pixel size.
Used for mixed-font/size layouts where each run may have a different face.
Each StyledRun carries a shared reference to the font bytes so that the
rasteriser downstream can look up the correct face without re-parsing.
Fields§
§glyphs: Vec<ShapedGlyph>Pre-shaped glyphs for this run.
metrics: FontVerticalMetricsFont vertical metrics for this run’s face.
px_size: f32Font size in pixels for this run.
color: Rgba8Text colour (RGBA). Stored for downstream use; layout does not render.
font_data: Arc<[u8]>Raw font bytes backing the glyphs in this run.
vertical_position: VerticalPositionVertical positioning for subscript/superscript effects.
Defaults to VerticalPosition::Normal.
Auto Trait Implementations§
impl Freeze for StyledRun
impl RefUnwindSafe for StyledRun
impl Send for StyledRun
impl Sync for StyledRun
impl Unpin for StyledRun
impl UnsafeUnpin for StyledRun
impl UnwindSafe for StyledRun
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