pub struct GlyphStore { /* private fields */ }Expand description
Stores the glyph data belonging to a text run.
Simple glyphs are stored inline in the entry_buffer, detailed glyphs are
stored as pointers into the detail_store.
+- GlyphStore --------------------------------+
| +---+---+---+---+---+---+---+ |
| entry_buffer: | | s | | s | | s | s | | d = detailed
| +-|-+---+-|-+---+-|-+---+---+ | s = simple
| | | | |
| | +---+-------+ |
| | | |
| +-V-+-V-+ |
| detail_store: | d | d | |
| +---+---+ |
+---------------------------------------------+Implementations§
Source§impl GlyphStore
impl GlyphStore
pub fn total_advance(&self) -> Au
Sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
Return the number of glyphs stored in this GlyphStore.
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Whether or not this GlyphStore has any glyphs.
Sourcepub fn character_count(&self) -> usize
pub fn character_count(&self) -> usize
The number of characters (char) from the original string that produced this
GlyphStore.
Sourcepub fn is_whitespace(&self) -> bool
pub fn is_whitespace(&self) -> bool
Whether or not this GlyphStore is entirely whitepsace.
Sourcepub fn is_single_preserved_newline(&self) -> bool
pub fn is_single_preserved_newline(&self) -> bool
Whether or not this GlyphStore is a single preserved newline.
Sourcepub fn ends_with_whitespace(&self) -> bool
pub fn ends_with_whitespace(&self) -> bool
Whether or not this GlyphStore ends with whitespace.
Sourcepub fn total_word_separators(&self) -> usize
pub fn total_word_separators(&self) -> usize
The number of word separators in this GlyphStore.
Sourcepub fn total_characters(&self) -> usize
pub fn total_characters(&self) -> usize
The number of characters that were consumed to produce this GlyphStore. Some
characters correpond to more than one glyph and some glyphs correspond to more than
one character.
pub fn glyphs(&self) -> impl Iterator<Item = GlyphInfo<'_>> + use<'_>
Trait Implementations§
Source§impl Clone for GlyphStore
impl Clone for GlyphStore
Source§fn clone(&self) -> GlyphStore
fn clone(&self) -> GlyphStore
Returns a duplicate of the value. Read more
1.0.0 · 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 GlyphStore
impl Debug for GlyphStore
Source§impl<'de> Deserialize<'de> for GlyphStore
impl<'de> Deserialize<'de> for GlyphStore
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl MallocSizeOf for GlyphStore
impl MallocSizeOf for GlyphStore
Source§fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
Measure the heap usage of all descendant heap-allocated structures, but
not the space taken up by the value itself.
Auto Trait Implementations§
impl Freeze for GlyphStore
impl RefUnwindSafe for GlyphStore
impl Send for GlyphStore
impl Sync for GlyphStore
impl Unpin for GlyphStore
impl UnsafeUnpin for GlyphStore
impl UnwindSafe for GlyphStore
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> 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