Skip to main content

SystemFontSource

Struct SystemFontSource 

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

The engine’s font manager: the platform’s installed fonts through a FontManager, and the two family names Flutter’s engine defines for the platform’s own user-interface font.

CupertinoSystemText is that font at text sizes and CupertinoSystemDisplay at display sizes, each answered with every weight the platform has, as the engine registers them (txt/platform_mac.mm: the display face at its 29-point breakpoint, the text face by the default fallback). Every other family, and character fallback, goes to the manager.

Implementations§

Source§

impl SystemFontSource

Source

pub fn new(manager: Box<dyn FontManager>) -> SystemFontSource

Over manager: a host’s own lookup, or one that answers across a boundary.

Source

pub fn platform() -> SystemFontSource

Over this platform’s own font manager.

Source

pub fn set_locales(&mut self, locales: Vec<String>)

The languages character fallback prefers, BCP 47, most preferred first (Flutter’s PlatformDispatcher.locales).

Trait Implementations§

Source§

impl FontSource for SystemFontSource

Source§

fn family(&mut self, name: &str) -> Vec<Font>

family returns every available face matching a family name.
Source§

fn face_for_codepoint( &mut self, codepoint: char, attrs: FontAttrs, ) -> Option<Font>

face_for_codepoint returns a covering face nearest to attrs.

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<T> WasmNotSend for T
where T: Send,