pub struct TextSpan {
pub bytes: Range<usize>,
pub font_family: Option<String>,
pub font_weight: u16,
pub font_style: FontStyle,
pub font_size: f32,
pub letter_spacing: f32,
pub fill: TextFill,
pub strokes: Vec<TextStroke>,
pub background_color: Option<[u8; 4]>,
pub underline: bool,
pub line_through: bool,
}Expand description
A byte range of a request’s text with its own face, size, spacing, paint and decorations.
A change of family, weight, style, size or letter spacing shapes the span apart, with its neighbours’ text as shaping context; a change of paint or decoration only does not. A grapheme cluster spanning two spans takes the values of the one holding its first byte.
Fields§
§bytes: Range<usize>Byte range in TextRasterRequest::text, on character boundaries.
font_family: Option<String>Preferred family, as TextRasterRequest::font_family.
font_weight: u16Weight in [1, 1000], as TextRasterRequest::font_weight.
font_style: FontStyleFace style; a face that is neither italic nor oblique is sheared when one is asked.
font_size: f32Size in pixels. Each line is as tall as the largest size on it, at least the request’s.
letter_spacing: f32Space after each cluster in pixels, in [-0.5, 1] of font_size.
fill: TextFillGlyph paint; gradient positions are in the whole text’s layout box.
strokes: Vec<TextStroke>Bands around the span’s glyphs, as TextRasterRequest::strokes.
background_color: Option<[u8; 4]>Straight sRGB RGBA of a box behind the span on each line, its advances wide and its em box tall.
underline: boolA line under the span, placed and sized by its first face.
line_through: boolA line through the span, placed and sized by its first face.