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
impl SystemFontSource
Sourcepub fn new(manager: Box<dyn FontManager>) -> SystemFontSource
pub fn new(manager: Box<dyn FontManager>) -> SystemFontSource
Over manager: a host’s own lookup, or one that answers across a boundary.
Sourcepub fn set_locales(&mut self, locales: Vec<String>)
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
impl FontSource for SystemFontSource
Source§fn family(&mut self, name: &str) -> Vec<Font>
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>
fn face_for_codepoint( &mut self, codepoint: char, attrs: FontAttrs, ) -> Option<Font>
face_for_codepoint returns a covering face nearest to attrs.Source§fn default_face(&mut self, attrs: FontAttrs) -> Option<Font>
fn default_face(&mut self, attrs: FontAttrs) -> Option<Font>
default_face returns the source’s default face nearest to attrs, the face text
is set in when no family it asks for has one: Skia’s
SkFontMgr::legacyMakeTypeface(nullptr, style). A collection asks for it only while
it has no face at all. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for SystemFontSource
impl !UnwindSafe for SystemFontSource
impl Forget for SystemFontSource
impl Freeze for SystemFontSourcewhere
*const dyn FontManager is !null: Freeze,
PhantomData<dyn FontManager>: Freeze,
*const u8 is !null: Freeze,
PhantomData<String>: Freeze,
impl Move for SystemFontSource
impl Send for SystemFontSource
impl Sync for SystemFontSource
impl Unpin for SystemFontSource
impl UnsafeUnpin for SystemFontSourcewhere
*const dyn FontManager is !null: UnsafeUnpin,
PhantomData<dyn FontManager>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
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
Mutably borrows from an owned value. Read more