[][src]Struct directwrite::enums::FontWeight

#[repr(transparent)]
pub struct FontWeight(pub u32);

Represents the density of a typeface, in terms of the lightness or heaviness of the strokes. The enumerated values correspond to the usWeightClass definition in the OpenType specification. The usWeightClass represents an integer value between 1 and 999. Lower values indicate lighter weights; higher values indicate heavier weights.

Weight differences are generally differentiated by an increased stroke or thickness that is associated with a given character in a typeface, as compared to a "normal" character from that same typeface. The following illustration shows an example of Normal and UltraBold weights for the Palatino Linotype typeface.

Font Weight Example

Note Not all weights are available for all typefaces. When a weight is not available for a typeface, the closest matching weight is returned.

Font weight values less than 1 or greater than 999 are considered invalid, and they are rejected by font API functions.

Methods

impl FontWeight[src]

pub const THIN: FontWeight[src]

Predefined font weight : Thin (100).

pub const EXTRA_LIGHT: FontWeight[src]

Predefined font weight : Extra-light (200).

pub const ULTRA_LIGHT: FontWeight[src]

Predefined font weight : Ultra-light (200).

pub const LIGHT: FontWeight[src]

Predefined font weight : Light (300).

pub const SEMI_LIGHT: FontWeight[src]

Predefined font weight : Semi-light (350).

pub const NORMAL: FontWeight[src]

Predefined font weight : Normal (400).

pub const REGULAR: FontWeight[src]

Predefined font weight : Regular (400).

pub const MEDIUM: FontWeight[src]

Predefined font weight : Medium (500).

pub const DEMI_BOLD: FontWeight[src]

Predefined font weight : Demi-bold (600).

pub const SEMI_BOLD: FontWeight[src]

Predefined font weight : Semi-bold (600).

pub const BOLD: FontWeight[src]

Predefined font weight : Bold (700).

pub const EXTRA_BOLD: FontWeight[src]

Predefined font weight : Extra-bold (800).

pub const ULTRA_BOLD: FontWeight[src]

Predefined font weight : Ultra-bold (800).

pub const BLACK: FontWeight[src]

Predefined font weight : Black (900).

pub const HEAVY: FontWeight[src]

Predefined font weight : Heavy (900).

pub const EXTRA_BLACK: FontWeight[src]

Predefined font weight : Extra-black (950).

pub const ULTRA_BLACK: FontWeight[src]

Predefined font weight : Ultra-black (950).

Trait Implementations

impl PartialEq<FontWeight> for FontWeight[src]

impl Ord for FontWeight[src]

fn max(self, other: Self) -> Self
1.21.0
[src]

Compares and returns the maximum of two values. Read more

fn min(self, other: Self) -> Self
1.21.0
[src]

Compares and returns the minimum of two values. Read more

impl Clone for FontWeight[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Eq for FontWeight[src]

impl Copy for FontWeight[src]

impl PartialOrd<FontWeight> for FontWeight[src]

impl Hash for FontWeight[src]

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0
[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl Debug for FontWeight[src]

Auto Trait Implementations

impl Send for FontWeight

impl Sync for FontWeight

Blanket Implementations

impl<T> FontKey for T where
    T: Send + Sync + 'static + ?Sized
[src]

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]