#[repr(u8)]pub enum StandardFont {
Show 14 variants
Courier = 0,
CourierBold = 1,
CourierBoldOblique = 2,
CourierOblique = 3,
Helvetica = 4,
HelveticaBold = 5,
HelveticaBoldOblique = 6,
HelveticaOblique = 7,
Times = 8,
TimesBold = 9,
TimesBoldOblique = 10,
TimesOblique = 11,
Symbol = 12,
Dingbats = 13,
}Expand description
One of the fourteen standard fonts.
The discriminants are load-bearing, not cosmetic. Within a family the order
is Regular, Bold, BoldOblique, Oblique — so index % 4 decides the
style and index + 1 / +2 / +3 is how a style is applied to a family
. Changing the order silently changes substitution.
Variants§
Courier = 0
Courier.
CourierBold = 1
Courier-Bold.
CourierBoldOblique = 2
Courier-BoldOblique.
CourierOblique = 3
Courier-Oblique.
Helvetica = 4
Helvetica.
HelveticaBold = 5
Helvetica-Bold.
HelveticaBoldOblique = 6
Helvetica-BoldOblique.
HelveticaOblique = 7
Helvetica-Oblique.
Times = 8
Times-Roman.
TimesBold = 9
Times-Bold.
TimesBoldOblique = 10
Times-BoldItalic. Note the family asymmetry: Courier and Helvetica
say Oblique where Times says Italic.
TimesOblique = 11
Times-Italic.
Symbol = 12
Symbol.
Dingbats = 13
ZapfDingbats.
Implementations§
Source§impl StandardFont
impl StandardFont
Sourcepub fn from_index(i: usize) -> Option<StandardFont>
pub fn from_index(i: usize) -> Option<StandardFont>
Build from an index, for the arithmetic of the former working note step 10.
Sourcepub fn is_symbolic(self) -> bool
pub fn is_symbolic(self) -> bool
Symbol and ZapfDingbats are the two whose glyphs are not Latin text, which changes both their default flags and their default encoding.
Sourcepub fn is_stylable(self) -> bool
pub fn is_stylable(self) -> bool
Can a style be applied to this index by arithmetic? Only the three
family heads can (IsStylableBaseFont).
Trait Implementations§
Source§impl Clone for StandardFont
impl Clone for StandardFont
Source§fn clone(&self) -> StandardFont
fn clone(&self) -> StandardFont
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for StandardFont
Source§impl Debug for StandardFont
impl Debug for StandardFont
impl Eq for StandardFont
Source§impl Hash for StandardFont
impl Hash for StandardFont
Source§impl Ord for StandardFont
impl Ord for StandardFont
Source§fn cmp(&self, other: &StandardFont) -> Ordering
fn cmp(&self, other: &StandardFont) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for StandardFont
impl PartialEq for StandardFont
Source§impl PartialOrd for StandardFont
impl PartialOrd for StandardFont
impl StructuralPartialEq for StandardFont
Auto Trait Implementations§
impl Freeze for StandardFont
impl RefUnwindSafe for StandardFont
impl Send for StandardFont
impl Sync for StandardFont
impl Unpin for StandardFont
impl UnsafeUnpin for StandardFont
impl UnwindSafe for StandardFont
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,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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
key and return true if they are equal.Source§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
Source§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
T, using the provided data to resolve any offsets.