pub enum DrawStyle {
Fill,
Stroke {
width: f32,
cap: StrokeCap,
join: StrokeJoin,
miter: f32,
path_effect: Option<PathEffect>,
},
FillAndStroke {
width: f32,
cap: StrokeCap,
join: StrokeJoin,
miter: f32,
path_effect: Option<PathEffect>,
},
}Expand description
Draw style for text (fill or stroke).
Variants§
Fill
Stroke
Fields
§
join: StrokeJoinLine join style for stroke segment joins.
§
path_effect: Option<PathEffect>Optional path effect (dash, corner rounding, etc.).
FillAndStroke
Fill plus an outline in the same color. Renders the fill first, then the stroke on top (same layout; stroke width in em-units). Faux-bold for fonts without a bold face: single layout pass, no extra view needed.
Fields
§
join: StrokeJoinLine join style for stroke segment joins.
§
path_effect: Option<PathEffect>Optional path effect (dash, corner rounding, etc.).
Implementations§
Source§impl DrawStyle
impl DrawStyle
Sourcepub const fn stroke(width: f32) -> Self
pub const fn stroke(width: f32) -> Self
Create a Stroke variant with default cap, join, miter, and no path effect.
Sourcepub const fn fill_and_stroke(width: f32) -> Self
pub const fn fill_and_stroke(width: f32) -> Self
Create a FillAndStroke variant with default cap, join, miter,
and no path effect.
Sourcepub const fn stroke_params(
&self,
) -> Option<(f32, StrokeCap, StrokeJoin, f32, &Option<PathEffect>)>
pub const fn stroke_params( &self, ) -> Option<(f32, StrokeCap, StrokeJoin, f32, &Option<PathEffect>)>
Outline parameters when this style draws a stroke, else None.
Sourcepub const fn draws_fill(&self) -> bool
pub const fn draws_fill(&self) -> bool
Whether this style draws the glyph fill.
Trait Implementations§
impl StructuralPartialEq for DrawStyle
Auto Trait Implementations§
impl Freeze for DrawStyle
impl RefUnwindSafe for DrawStyle
impl Send for DrawStyle
impl Sync for DrawStyle
impl Unpin for DrawStyle
impl UnsafeUnpin for DrawStyle
impl UnwindSafe for DrawStyle
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
Mutably borrows from an owned value. Read more