Struct swash::shape::cluster::GlyphCluster
source · pub struct GlyphCluster<'a> {
pub source: SourceRange,
pub info: ClusterInfo,
pub glyphs: &'a [Glyph],
pub components: &'a [SourceRange],
pub data: UserData,
}
Expand description
Collection of glyphs and associated metadata corresponding to one or more source clusters.
Fields§
§source: SourceRange
Full source range of the cluster in original units supplied to the shaper.
info: ClusterInfo
Information about the textual content of the cluster.
glyphs: &'a [Glyph]
Sequence of glyphs for the cluster. May be empty for clusters whose source consisted entirely of control characters.
components: &'a [SourceRange]
If the cluster is a ligature, this contains the source range of each ligature component. Empty otherwise.
data: UserData
Arbitrary user data– taken from the initial character of the cluster.
Implementations§
source§impl<'a> GlyphCluster<'a>
impl<'a> GlyphCluster<'a>
sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Returns true if the cluster is empty. Empty clusters still represent characters in the source text, but contain no glyphs. This will be true, for example, with newline sequences (\n or \r\n) as well as other control characters.
sourcepub fn is_simple(&self) -> bool
pub fn is_simple(&self) -> bool
Returns true if the cluster contains a single glyph. Note that a simple cluster can also be a ligature.
sourcepub fn is_ligature(&self) -> bool
pub fn is_ligature(&self) -> bool
Returns true if the cluster corresponds to multiple source clusters. Note that a ligature cluster can also be complex.
sourcepub fn is_complex(&self) -> bool
pub fn is_complex(&self) -> bool
Returns true if the cluster is complex– that is if it contains more than one glyph. This will be true for clusters containing marks and is also commonly true for syllabic languages such as those in the Indic family.
Trait Implementations§
source§impl<'a> Clone for GlyphCluster<'a>
impl<'a> Clone for GlyphCluster<'a>
source§fn clone(&self) -> GlyphCluster<'a>
fn clone(&self) -> GlyphCluster<'a>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl<'a> Debug for GlyphCluster<'a>
impl<'a> Debug for GlyphCluster<'a>
impl<'a> Copy for GlyphCluster<'a>
Auto Trait Implementations§
impl<'a> Freeze for GlyphCluster<'a>
impl<'a> RefUnwindSafe for GlyphCluster<'a>
impl<'a> Send for GlyphCluster<'a>
impl<'a> Sync for GlyphCluster<'a>
impl<'a> Unpin for GlyphCluster<'a>
impl<'a> UnwindSafe for GlyphCluster<'a>
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)