pub struct ResolvedStyle {Show 26 fields
pub family: Option<String>,
pub weight: u16,
pub italic: bool,
pub width: f32,
pub size_pt: f64,
pub color: Option<ThemeColor>,
pub tracking: f32,
pub underline: bool,
pub strikethrough: bool,
pub baseline_pt: f64,
pub text_stroke: Option<ThemeColor>,
pub text_stroke_width_pt: f64,
pub features: Vec<FontFeatureSetting>,
pub lineheight: LineHeightSpec,
pub align: Option<HAlign>,
pub text_direction: Option<Direction>,
pub indent_pt: f64,
pub hanging_pt: f64,
pub margin_pt: [f64; 4],
pub padding_pt: [f64; 4],
pub background: Option<ThemeColor>,
pub border_color: Option<ThemeColor>,
pub border_width_pt: [f64; 4],
pub border_radius_pt: f64,
pub border_type: Option<Arc<[LinetypeStep]>>,
pub bullet: Option<Vec<String>>,
}Expand description
A style with every length already in points and every flag decided. One of these rides on each inline run and each block the reducer emits, so the shaping pass reads concrete numbers.
Fields§
§family: Option<String>Font family override. None keeps the base style’s chain.
weight: u16CSS-style font weight.
italic: boolItalic flag.
width: f32CSS font-width ratio.
size_pt: f64Font size in points.
color: Option<ThemeColor>Text colour, still palette-relative until draw time.
tracking: f32Letter spacing in 1/1000 em.
underline: boolUnderline flag.
strikethrough: boolStrikethrough flag.
baseline_pt: f64Accumulated baseline shift in points (positive = up).
text_stroke: Option<ThemeColor>Glyph outline colour. None = fill only.
text_stroke_width_pt: f64Glyph outline width in points.
features: Vec<FontFeatureSetting>OpenType features in effect.
lineheight: LineHeightSpecLine height.
align: Option<HAlign>Horizontal alignment, None = defer to the caller.
text_direction: Option<Direction>Block-axis direction, None = read back from parley.
indent_pt: f64First-line indent in points.
hanging_pt: f64Continuation-line indent in points.
margin_pt: [f64; 4]Outer spacing in points, [top, right, bottom, left].
padding_pt: [f64; 4]Inner spacing in points, [top, right, bottom, left].
background: Option<ThemeColor>Block background colour.
border_color: Option<ThemeColor>Block border colour.
border_width_pt: [f64; 4]Block border widths in points, [top, right, bottom, left].
border_radius_pt: f64Block border corner radius in points.
border_type: Option<Arc<[LinetypeStep]>>Block border dash pattern.
bullet: Option<Vec<String>>Per-nesting-depth bullet markers.
Implementations§
Source§impl ResolvedStyle
impl ResolvedStyle
Sourcepub fn from_base(base: &TextStyle) -> Self
pub fn from_base(base: &TextStyle) -> Self
The root of the cascade: everything the base TextStyle
dictates, with no box spacing and no decorations.
Sourcepub fn apply(
&self,
delta: &StyleDelta,
grandparent: &ResolvedStyle,
base_size_pt: f64,
) -> ResolvedStyle
pub fn apply( &self, delta: &StyleDelta, grandparent: &ResolvedStyle, base_size_pt: f64, ) -> ResolvedStyle
Apply delta on top of self, producing the child’s resolved
style.
grandparent supplies the inherited value for any field named
in delta.skip_inherit; base_size_pt anchors Rem. size
resolves first so every other Em length measures against the
child’s own size rather than the parent’s.
Sourcepub fn for_inline(&self) -> ResolvedStyle
pub fn for_inline(&self) -> ResolvedStyle
Copy with every box-level field reset.
Used when a block’s resolved style seeds the inline cascade for
its own content: the block already draws its background, border
and spacing itself, so a descendant span must not inherit them
and paint a second chip. Marquee gets the same rendered result
from its classic_style() carrying explicit resets on every
inline tag.
Trait Implementations§
Source§impl Clone for ResolvedStyle
impl Clone for ResolvedStyle
Source§fn clone(&self) -> ResolvedStyle
fn clone(&self) -> ResolvedStyle
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ResolvedStyle
impl Debug for ResolvedStyle
Source§impl PartialEq for ResolvedStyle
impl PartialEq for ResolvedStyle
impl StructuralPartialEq for ResolvedStyle
Auto Trait Implementations§
impl Freeze for ResolvedStyle
impl RefUnwindSafe for ResolvedStyle
impl Send for ResolvedStyle
impl Sync for ResolvedStyle
impl Unpin for ResolvedStyle
impl UnsafeUnpin for ResolvedStyle
impl UnwindSafe for ResolvedStyle
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.