pub struct ParagraphStyle {
pub font_id: u16,
pub size: f32,
pub line_height: f32,
pub letter_spacing: f32,
pub caps: FontVariantCaps,
pub features: Vec<FeatureSetting>,
pub transform: TextTransform,
pub color: Color,
pub decoration: TextDecoration,
}Expand description
Everything one paragraph’s layout depends on, and the colour its runs are painted in. The style tree compiles down to this.
Fields§
§font_id: u16Face id from the font registry.
size: f32Font size in points.
line_height: f32Line height as a unitless multiple of size, as in CSS
line-height: <number>.
letter_spacing: f32Extra advance between glyphs, in points, from
letter-spacing. A line ends at its last glyph’s own edge, so
nothing is added after it.
caps: FontVariantCapsWhich capitals the text is drawn with.
features: Vec<FeatureSetting>The features the text is shaped with, beyond the ones the shaper turns on for every run.
transform: TextTransformWhat the text is transformed to before it is shaped.
color: ColorWhat the run is painted in. Nothing measures it: a run carries it from here to the display structure.
decoration: TextDecorationWhat is drawn across the run. Nothing measures it either: the rules are painted over the advance the glyphs already took.
Trait Implementations§
Source§impl Clone for ParagraphStyle
impl Clone for ParagraphStyle
Source§fn clone(&self) -> ParagraphStyle
fn clone(&self) -> ParagraphStyle
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 ParagraphStyle
impl RefUnwindSafe for ParagraphStyle
impl Send for ParagraphStyle
impl Sync for ParagraphStyle
impl Unpin for ParagraphStyle
impl UnsafeUnpin for ParagraphStyle
impl UnwindSafe for ParagraphStyle
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,
impl<T> ErasedDestructor for Twhere
T: 'static,
§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
T, using the provided data to resolve any offsets.