[][src]Struct kas::text::fonts::FontSelector

pub struct FontSelector { /* fields omitted */ }

A font face selection tool

This tool selects a font according to the given criteria from available system fonts. Selection criteria are based on CSS.

Implementations

impl FontSelector[src]

pub fn new() -> FontSelector[src]

Synonym for default

Without further parametrisation, this will select a generic sans-serif font which should be suitable for most uses.

pub fn assign(&mut self, rhs: &FontSelector)[src]

Set self to rhs

This may save a reallocation over direct assignment.

pub fn set_families(&mut self, names: Vec<FamilyName, Global>)[src]

Set family name(s)

If multiple names are passed, the first to successfully resolve a font is used. Glyph-level fallback (missing glyph substitution) is not currently supported.

pub fn set_style(&mut self, style: Style)[src]

Set style

pub fn set_weight(&mut self, weight: Weight)[src]

Set weight

pub fn set_stretch(&mut self, stretch: Stretch)[src]

Set stretch

pub fn hash(&self) -> u64[src]

Hash self

This struct does not implement Hash since it doesn't precisely match the expected semantics: values may compare equal despite having different hashes. For our purposes this is acceptable.

Trait Implementations

impl Clone for FontSelector[src]

impl Debug for FontSelector[src]

impl Default for FontSelector[src]

impl PartialEq<FontSelector> for FontSelector[src]

impl StructuralPartialEq for FontSelector[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

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

type Owned = T

The resulting type after obtaining ownership.

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.