pub struct LineStyle {
thickness: Mm,
color: Color,
}Expand description
A style for a line, used in styling borders and shapes.
The style consists of:
- the line thickness in millimeters (defaults to 0.1)
- the color of the line, see
Color(defaults to black)
Note that a line thickness of 0.0 does not make the line disappear, but rather makes it appear 1px wide across all devices and resolutions.
Fields§
§thickness: Mm§color: ColorImplementations§
Source§impl LineStyle
impl LineStyle
Sourcepub fn set_thickness(&mut self, thickness: impl Into<Mm>)
pub fn set_thickness(&mut self, thickness: impl Into<Mm>)
Sets the line thickness.
Setting this to 0.0 will not hide the line, rather it’s a special value that tells PDF viewers to render the line as 1px regardless of the display size and zoom.
Sourcepub fn with_thickness(self, thickness: impl Into<Mm>) -> Self
pub fn with_thickness(self, thickness: impl Into<Mm>) -> Self
Sets the line thickness and returns the line style.
Setting this to 0.0 will not hide the line, rather it’s a special value that tells PDF viewers to render the line as 1px regardless of the display size and zoom.
Sourcepub fn with_color(self, color: Color) -> Self
pub fn with_color(self, color: Color) -> Self
Sets the line color and returns the line style.
Trait Implementations§
impl Copy for LineStyle
impl StructuralPartialEq for LineStyle
Auto Trait Implementations§
impl Freeze for LineStyle
impl RefUnwindSafe for LineStyle
impl Send for LineStyle
impl Sync for LineStyle
impl Unpin for LineStyle
impl UnwindSafe for LineStyle
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
§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
Convert this type into
T, using the provided data to resolve any offsets.