Skip to main content

SystemFontCollection

Struct SystemFontCollection 

Source
pub struct SystemFontCollection { /* private fields */ }
Expand description

The collection of the fonts installed in the system, backed by the font manager backend.

Implementations§

Source§

impl SystemFontCollection

Source

pub fn new(platform_impl: Rc<dyn IFontManagerImpl>) -> Self

Trait Implementations§

Source§

impl FontCollectionBaseImpl for SystemFontCollection

Source§

fn base(this: &Self) -> &FontCollectionBase

The base class state of the collection.
Source§

fn key(_this: &Self) -> Uri

Gets the unique identifier for the font collection.
Source§

fn try_get_glyph_typeface( this: &Self, family_name: &str, style: FontStyle, weight: FontWeight, stretch: FontStretch, ) -> Option<Rc<GlyphTypeface>>

Try to get a glyph typeface for given parameters.
Source§

fn try_get_family_typefaces( this: &Self, family_name: &str, ) -> Option<Vec<Typeface>>

Tries to get a list of typefaces for the specified family name.
Source§

fn try_match_character( this: &Self, codepoint: i32, style: FontStyle, weight: FontWeight, stretch: FontStretch, family_name: Option<&str>, culture: Option<&CultureInfo>, ) -> Option<Typeface>

Tries to match a specified character to a Typeface that supports specified font properties.
Source§

fn try_match_character_from_platform( this: &Self, codepoint: i32, key: FontCollectionKey, family_name: Option<&str>, culture: Option<&CultureInfo>, ) -> Option<Rc<GlyphTypeface>>

Hook for platform-backed collections (e.g. the system font collection) to consult the underlying font manager for a fallback typeface. Invoked at most once per (script-bucket, culture) pair from FontCollectionBase::try_match_character.
Source§

fn try_create_synthetic_glyph_typeface( this: &Self, glyph_typeface: &Rc<GlyphTypeface>, style: FontStyle, weight: FontWeight, stretch: FontStretch, ) -> Option<Rc<GlyphTypeface>>

Try to get a synthetic glyph typeface for given parameters.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> ClassDefaults for T
where T: ?Sized,

Source§

fn static_constructor()

The static constructor of a type: work done once per thread, after the properties of the type are registered and before its first instance exists (class handlers, affects_render, metadata overrides). Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> IFontCollection for T

Source§

fn key(&self) -> Uri

Gets the unique identifier for the font collection.
Source§

fn count(&self) -> usize

The number of font families in the collection.
Source§

fn get(&self, index: usize) -> FontFamily

The font family at index. Read more
Source§

fn font_families(&self) -> Vec<FontFamily>

A snapshot of the font families of the collection, in order.
Source§

fn try_get_glyph_typeface( &self, family_name: &str, style: FontStyle, weight: FontWeight, stretch: FontStretch, ) -> Option<Rc<GlyphTypeface>>

Try to get a glyph typeface for given parameters.
Source§

fn try_match_character( &self, codepoint: i32, font_style: FontStyle, font_weight: FontWeight, font_stretch: FontStretch, family_name: Option<&str>, culture: Option<&CultureInfo>, ) -> Option<Typeface>

Tries to match a specified character to a Typeface that supports specified font properties. Read more
Source§

fn try_get_family_typefaces(&self, family_name: &str) -> Option<Vec<Typeface>>

Tries to get a list of typefaces for the specified family name.
Source§

fn try_create_synthetic_glyph_typeface( &self, glyph_typeface: &Rc<GlyphTypeface>, style: FontStyle, weight: FontWeight, stretch: FontStretch, ) -> Option<Rc<GlyphTypeface>>

Try to get a synthetic glyph typeface for given parameters.
Source§

fn try_get_nearest_match( &self, family_name: &str, style: FontStyle, weight: FontWeight, stretch: FontStretch, ) -> Option<Rc<GlyphTypeface>>

Attempts to retrieve the glyph typeface that most closely matches the specified font family name, style, weight, and stretch. Read more
Source§

fn dispose(&self)

Releases the glyph typefaces held by the collection (C# IDisposable.Dispose).
Source§

fn as_font_collection_base( &self, ) -> Option<&(dyn IFontCollectionBase + 'static)>

The collection viewed as a FontCollectionBase derived collection, if it is one (C# collection is FontCollectionBase).
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Lets callers recover the concrete collection type.
Source§

impl<T> IFontCollectionBase for T

Source§

fn base(&self) -> &FontCollectionBase

The base class state of the collection.
Source§

fn try_match_character_from_platform( &self, codepoint: i32, key: FontCollectionKey, family_name: Option<&str>, culture: Option<&CultureInfo>, ) -> Option<Rc<GlyphTypeface>>

Calls the collection’s try_match_character_from_platform.
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.