pub struct ShapedCluster {
pub text: String,
pub source_cluster_id: GraphemeClusterId,
pub source_content_index: ContentIndex,
pub source_node_id: Option<NodeId>,
pub glyphs: ShapedGlyphVec,
pub advance: f32,
pub direction: BidiDirection,
pub style: Arc<StyleProperties>,
pub marker_position_outside: Option<bool>,
pub is_first_fragment: bool,
pub is_last_fragment: 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: ShapedGlyphVecThe glyphs that make up this cluster. SmallVec<[T; 1]> — inline
single-glyph clusters (the common case for Latin text), spill to
heap only for ligatures / combining marks.
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.
is_first_fragment: boolTrue if this is the first visual fragment of its inline box.
Used for box-decoration-break and split inline border/padding.
When an inline element wraps across lines, only the first fragment
gets the start-edge border/padding.
is_last_fragment: boolTrue if this is the last visual fragment of its inline box. Only the last fragment gets the end-edge border/padding.
Trait Implementations§
Source§impl Clone for ShapedCluster
impl Clone for ShapedCluster
Source§fn clone(&self) -> ShapedCluster
fn clone(&self) -> ShapedCluster
1.0.0 (const: unstable) · 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 UnsafeUnpin 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