#[repr(C)]pub struct GlyphInfo {
pub glyph_id: u32,
pub cluster: u32,
/* private fields */
}
Expand description
A glyph info.
Fields§
§glyph_id: u32
A selected glyph.
Guarantee to be <= u16::MAX
.
cluster: u32
An index to the start of the grapheme cluster in the original string.
Implementations§
source§impl GlyphInfo
impl GlyphInfo
sourcepub fn unsafe_to_break(&self) -> bool
pub fn unsafe_to_break(&self) -> bool
Indicates that if input text is broken at the beginning of the cluster this glyph is part of, then both sides need to be re-shaped, as the result might be different.
On the flip side, it means that when this flag is not present, then it’s safe to break the glyph-run at the beginning of this cluster, and the two sides represent the exact same result one would get if breaking input text at the beginning of this cluster and shaping the two sides separately. This can be used to optimize paragraph layout, by avoiding re-shaping of each line after line-breaking, or limiting the reshaping to a small piece around the breaking point only.
Trait Implementations§
impl Copy for GlyphInfo
impl Pod for GlyphInfo
Auto Trait Implementations§
impl RefUnwindSafe for GlyphInfo
impl Send for GlyphInfo
impl Sync for GlyphInfo
impl Unpin for GlyphInfo
impl UnwindSafe for GlyphInfo
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> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
§type Bits = T
type Bits = T
Self
must have the same layout as the specified Bits
except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern
.source§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
bits
as &Self
.