Struct fonts::glyph::GlyphEntry
source · pub struct GlyphEntry {
value: u32,
}
Expand description
GlyphEntry is a port of Gecko’s CompressedGlyph scheme for storing glyph data compactly.
In the common case (reasonable glyph advances, no offsets from the font em-box, and one glyph per character), we pack glyph advance, glyph id, and some flags into a single u32.
In the uncommon case (multiple glyphs per unicode character, large glyph index/advance, or glyph offsets), we pack the glyph count into GlyphEntry, and store the other glyph information in DetailedGlyphStore.
Fields§
§value: u32
Implementations§
source§impl GlyphEntry
impl GlyphEntry
fn new(value: u32) -> GlyphEntry
fn initial() -> GlyphEntry
fn simple(id: GlyphId, advance: Au) -> GlyphEntry
fn complex( starts_cluster: bool, starts_ligature: bool, glyph_count: usize, ) -> GlyphEntry
fn is_initial(&self) -> bool
source§impl GlyphEntry
impl GlyphEntry
fn advance(&self) -> Au
fn id(&self) -> GlyphId
sourcefn char_is_word_separator(&self) -> bool
fn char_is_word_separator(&self) -> bool
True if the original character was a word separator. These include spaces (U+0020), non-breaking spaces (U+00A0), and a few other characters non-exhaustively listed in the specification. Other characters may map to the same glyphs, but this function does not take mapping into account.
fn set_char_is_word_separator(&mut self)
fn glyph_count(&self) -> u16
fn is_simple(&self) -> bool
fn has_flag(&self, flag: u32) -> bool
Trait Implementations§
source§impl Clone for GlyphEntry
impl Clone for GlyphEntry
source§fn clone(&self) -> GlyphEntry
fn clone(&self) -> GlyphEntry
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for GlyphEntry
impl Debug for GlyphEntry
source§impl<'de> Deserialize<'de> for GlyphEntry
impl<'de> Deserialize<'de> for GlyphEntry
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>,
source§impl MallocSizeOf for GlyphEntry
impl MallocSizeOf for GlyphEntry
source§fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
source§impl PartialEq for GlyphEntry
impl PartialEq for GlyphEntry
source§fn eq(&self, other: &GlyphEntry) -> bool
fn eq(&self, other: &GlyphEntry) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for GlyphEntry
impl Serialize for GlyphEntry
impl Copy for GlyphEntry
impl StructuralPartialEq for GlyphEntry
Auto Trait Implementations§
impl Freeze for GlyphEntry
impl RefUnwindSafe for GlyphEntry
impl Send for GlyphEntry
impl Sync for GlyphEntry
impl Unpin for GlyphEntry
impl UnwindSafe for GlyphEntry
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
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>
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>
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