Struct font_kit::properties::Properties
source · pub struct Properties {
pub style: Style,
pub weight: Weight,
pub stretch: Stretch,
}
Expand description
Properties that specify which font in a family to use: e.g. style, weight, and stretchiness.
This object supports a method chaining style for idiomatic initialization; e.g.
println!("{:?}", Properties::new().style(Style::Italic));
Fields§
§style: Style
The font style, as defined in CSS.
weight: Weight
The font weight, as defined in CSS.
stretch: Stretch
The font stretchiness, as defined in CSS.
Implementations§
source§impl Properties
impl Properties
sourcepub fn new() -> Properties
pub fn new() -> Properties
Initializes a property set to its default values: normal style, normal weight, and normal stretchiness.
sourcepub fn style(&mut self, style: Style) -> &mut Properties
pub fn style(&mut self, style: Style) -> &mut Properties
Sets the value of the style property and returns this property set for method chaining.
sourcepub fn weight(&mut self, weight: Weight) -> &mut Properties
pub fn weight(&mut self, weight: Weight) -> &mut Properties
Sets the value of the weight property and returns this property set for method chaining.
sourcepub fn stretch(&mut self, stretch: Stretch) -> &mut Properties
pub fn stretch(&mut self, stretch: Stretch) -> &mut Properties
Sets the value of the stretch property and returns this property set for method chaining.
Trait Implementations§
source§impl Clone for Properties
impl Clone for Properties
source§fn clone(&self) -> Properties
fn clone(&self) -> Properties
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for Properties
impl Debug for Properties
source§impl Default for Properties
impl Default for Properties
source§fn default() -> Properties
fn default() -> Properties
Returns the “default value” for a type. Read more
source§impl PartialEq for Properties
impl PartialEq for Properties
source§fn eq(&self, other: &Properties) -> bool
fn eq(&self, other: &Properties) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Copy for Properties
impl StructuralPartialEq for Properties
Auto Trait Implementations§
impl Freeze for Properties
impl RefUnwindSafe for Properties
impl Send for Properties
impl Sync for Properties
impl Unpin for Properties
impl UnwindSafe for Properties
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