pub struct ShapedCluster {
pub text: String,
pub source_cluster_id: GraphemeClusterId,
pub source_content_index: ContentIndex,
pub source_node_id: Option<NodeId>,
pub glyphs: Vec<ShapedGlyph>,
pub advance: f32,
pub direction: BidiDirection,
pub style: Arc<StyleProperties>,
pub marker_position_outside: Option<bool>,
}Expand description
A group of glyphs that corresponds to one or more source characters (a cluster).
Fields§
§text: StringThe original text that this cluster was shaped from. This is crucial for correct hyphenation.
source_cluster_id: GraphemeClusterIdThe ID of the grapheme cluster this glyph cluster represents.
source_content_index: ContentIndexThe source ContentIndex for mapping back to logical items.
source_node_id: Option<NodeId>The DOM NodeId of the Text node this cluster originated from. None for generated content (list markers, ::before/::after, etc.)
glyphs: Vec<ShapedGlyph>The glyphs that make up this cluster.
advance: f32The total advance width (horizontal) or height (vertical) of the cluster.
direction: BidiDirectionThe direction of this cluster, inherited from its VisualItem.
style: Arc<StyleProperties>Font style of this cluster
marker_position_outside: Option<bool>If this cluster is a list marker: whether it should be positioned outside (in the padding gutter) or inside (inline with content). None for non-marker content.
Trait Implementations§
Source§impl Clone for ShapedCluster
impl Clone for ShapedCluster
Source§fn clone(&self) -> ShapedCluster
fn clone(&self) -> ShapedCluster
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for ShapedCluster
impl RefUnwindSafe for ShapedCluster
impl Send for ShapedCluster
impl Sync for ShapedCluster
impl Unpin for ShapedCluster
impl UnwindSafe for ShapedCluster
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§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