pub struct ClusterInfo {
pub bytes: Range<usize>,
pub line: u32,
pub word: Option<u32>,
pub is_space: bool,
pub x: f32,
pub advance: f32,
pub baseline: f32,
pub font_size: f32,
pub ink: Option<[f32; 4]>,
pub ellipsis: bool,
}Expand description
One cluster of a TextLayout.
Fields§
§bytes: Range<usize>Byte range in the request’s text.
line: u32Line index.
word: Option<u32>Index of its UAX #29 word, counting only words with a letter or digit; None for spaces
and punctuation between words.
is_space: boolWhether it holds only white space.
x: f32Start of its advance in pixels from the layout box’s left edge.
advance: f32Advance in pixels; zero for a space hanging at a line end.
baseline: f32Line baseline in pixels from the layout box’s top.
font_size: f32Font size in pixels: its span’s, else the request’s.
ink: Option<[f32; 4]>The bounds of what it draws, strokes and a rim pixel included, when
TextRasterizer::layout_with_ink reports it; None for a cluster that draws nothing
and from TextRasterizer::layout.
ellipsis: boolWhether it is the ellipsis a crate::TextClamp ends a cut line with. Its byte range
is empty, at the cut, and it is in no word.