pub(crate) struct ShapedGlyph {
pub glyph_id: u32,
pub string_byte_offset: usize,
pub advance: Au,
pub offset: Option<Point2D<Au>>,
}Fields§
§glyph_id: u32The actual glyph to render for this ShapedGlyph.
string_byte_offset: usizeThe original byte offset in the input buffer of the character that this glyph belongs to. More than one glyph can share the same character and one character can produce multiple glyphs.
advance: AuThe advance the direction of the writing mode that this glyph needs.
offset: Option<Point2D<Au>>An offset that should be applied when rendering this glyph.
Implementations§
Source§impl ShapedGlyph
impl ShapedGlyph
fn can_be_simple_glyph(&self) -> bool
Sourcefn adjust_for_character(
&mut self,
character: char,
shaping_options: &ShapingOptions,
font: &Font,
)
fn adjust_for_character( &mut self, character: char, shaping_options: &ShapingOptions, font: &Font, )
After shaping is complete, some glyphs need their spacing adjusted to take into
account letter-spacing, word-spacing and tabs.
TODO: This should all likely move to layout. In particular, proper tab stops are context sensitive and be based on the size of the space character in the inline formatting context.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ShapedGlyph
impl RefUnwindSafe for ShapedGlyph
impl Send for ShapedGlyph
impl Sync for ShapedGlyph
impl Unpin for ShapedGlyph
impl UnwindSafe for ShapedGlyph
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 moreSource§impl<T> MaybeBoxed<Box<T>> for T
impl<T> MaybeBoxed<Box<T>> for T
Source§fn maybe_boxed(self) -> Box<T>
fn maybe_boxed(self) -> Box<T>
Convert
Source§impl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
Source§fn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
Convert