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: FontDescription
Normal font face.
bold: SecondaryFontDescription
Bold font face.
italic: SecondaryFontDescription
Italic font face.
bold_italic: SecondaryFontDescription
Bold italic font face.
size: Size
Font size in points.
builtin_box_drawing: bool
Whether 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 PartialEq for Font
impl PartialEq for Font
source§impl<'de> SerdeReplace for Font
impl<'de> SerdeReplace for Font
impl Eq for Font
impl StructuralEq for Font
impl StructuralPartialEq for Font
Auto Trait Implementations§
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> 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<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.