pub enum Font {
Show 13 variants
Helvetica,
HelveticaBold,
HelveticaOblique,
HelveticaBoldOblique,
TimesRoman,
TimesBold,
TimesItalic,
TimesBoldItalic,
Courier,
CourierBold,
CourierOblique,
CourierBoldOblique,
Symbol,
}Expand description
The standard 14 fonts minus ZapfDingbats.
Variants§
Helvetica
HelveticaBold
HelveticaOblique
HelveticaBoldOblique
TimesRoman
TimesBold
TimesItalic
TimesBoldItalic
Courier
CourierBold
CourierOblique
CourierBoldOblique
Symbol
Greek letters and mathematical symbols, in the font’s own encoding.
Implementations§
Source§impl Font
impl Font
pub const ALL: [Font; 13]
Sourcepub fn styled(family: Family, bold: bool, italic: bool) -> Font
pub fn styled(family: Family, bold: bool, italic: bool) -> Font
The face of family with the given weight and slant.
Sourcepub fn family_for(name: &str) -> Family
pub fn family_for(name: &str) -> Family
Picks a standard family for a font name: serif faces map to Times, monospaced ones to Courier, everything else to Helvetica.
Sourcepub fn can_encode(self, c: char) -> bool
pub fn can_encode(self, c: char) -> bool
Whether this font can show c by itself (in its own encoding; for the text faces,
without the CID fallback).
Sourcepub fn char_width(self, c: char) -> u16
pub fn char_width(self, c: char) -> u16
Advance width of a character in 1/1000 em.
Trait Implementations§
impl Copy for Font
impl Eq for Font
Source§impl Ord for Font
impl Ord for Font
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for Font
impl PartialOrd 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 UnsafeUnpin 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,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.