pub struct Font {
pub offset: Delta<i8>,
pub glyph_offset: Delta<i8>,
pub use_thin_strokes: bool,
normal: FontDescription,
bold: SecondaryFontDescription,
italic: SecondaryFontDescription,
bold_italic: SecondaryFontDescription,
size: Size,
pub builtin_box_drawing: bool,
}Expand description
Font config.
Defaults are provided at the level of this struct per platform, but not per field in this struct. It might be nice in the future to have defaults for each value independently. Alternatively, maybe erroring when the user doesn’t provide complete config is Ok.
Fields§
§offset: Delta<i8>Extra spacing per character.
glyph_offset: Delta<i8>Glyph offset within character cell.
use_thin_strokes: bool§normal: FontDescriptionNormal font face.
bold: SecondaryFontDescriptionBold font face.
italic: SecondaryFontDescriptionItalic font face.
bold_italic: SecondaryFontDescriptionBold italic font face.
size: SizeFont size in points.
builtin_box_drawing: boolWhether to use the built-in font for box drawing characters.
Implementations§
Source§impl Font
impl Font
pub fn size(&self) -> FontSize
Sourcepub fn normal(&self) -> &FontDescription
pub fn normal(&self) -> &FontDescription
Get normal font description.
Sourcepub fn bold(&self) -> FontDescription
pub fn bold(&self) -> FontDescription
Get bold font description.
Sourcepub fn italic(&self) -> FontDescription
pub fn italic(&self) -> FontDescription
Get italic font description.
Sourcepub fn bold_italic(&self) -> FontDescription
pub fn bold_italic(&self) -> FontDescription
Get bold italic font description.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Font
impl<'de> Deserialize<'de> for Font
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<'de> SerdeReplace for Font
impl<'de> SerdeReplace for Font
impl Eq for Font
impl StructuralPartialEq for Font
Auto Trait Implementations§
impl Freeze for Font
impl RefUnwindSafe for Font
impl Send for Font
impl Sync for Font
impl Unpin for Font
impl UnwindSafe for Font
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> 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>
Convert
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>
Convert
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)
Convert
&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)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.