Enum FontStyle
pub enum FontStyle {
Normal,
Italic,
Oblique(Option<f32>),
}Expand description
Visual style or ‘slope’ of a font.
The default value is FontStyle::Normal.
In variable fonts, this can be controlled with the ital
and slnt axes for italic and oblique styles, respectively.
This uses an f32 for the Oblique variant so so that it
can represent the same range of values as the slnt axis.
See https://fonts.google.com/knowledge/glossary/style
In CSS, this corresponds to the font-style property.
Variants§
Normal
An upright or “roman” style.
Italic
Generally a slanted style, originally based on semi-cursive forms. This often has a different structure from the normal style.
Oblique(Option<f32>)
Oblique (or slanted) style with an optional angle in degrees, counter-clockwise from the vertical.
Implementations§
§impl FontStyle
impl FontStyle
pub fn from_fontconfig(slant: i32) -> FontStyle
pub fn from_fontconfig(slant: i32) -> FontStyle
Creates a new style attribute with the given value from Fontconfig.
The values are determined based on the fonts.conf documentation.
Trait Implementations§
impl Copy for FontStyle
impl StructuralPartialEq for FontStyle
Auto Trait Implementations§
impl Freeze for FontStyle
impl RefUnwindSafe for FontStyle
impl Send for FontStyle
impl Sync for FontStyle
impl Unpin for FontStyle
impl UnsafeUnpin for FontStyle
impl UnwindSafe for FontStyle
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§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.§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.§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.§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.