pub struct ShapingSpan<'a> {
pub range: Range<usize>,
pub font: FontRequest<'a>,
pub size: f32,
pub features: &'a [FontFeature],
pub language: Option<&'a str>,
pub letter_spacing: Option<f32>,
pub baseline_shift: f32,
}Expand description
A stretch of a paragraph with one font, size and set of shaping settings: a style span of the text. Spans that differ only in what does not change shaping, such as color, are one span, since a ligature such as Arabic lam-alef forms only inside one span.
Fields§
§range: Range<usize>The byte range in the text.
font: FontRequest<'a>The family, weight and style. The weight and style also set the axes of a variable font read without a declaration.
size: f32The font size in pixels.
features: &'a [FontFeature]The OpenType features to turn on or off.
language: Option<&'a str>A BCP 47 language tag such as ja or sr-Latn, which picks the
font’s language-specific forms.
letter_spacing: Option<f32>Extra space after each character in pixels: Compose’s
letterSpacing; None takes the font’s default tracking from its
trak table, as Apple’s system fonts space their letters by size.
Scripts whose letters join take none, as on Android.
baseline_shift: f32How far above the line’s baseline the span’s baseline sits, in
pixels: Compose’s baselineShift times the span’s ascent.