Skip to main content

TestFontSource

Struct TestFontSource 

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

Flutter’s engine TestFontManager as FontCollection::RegisterTestFonts installs it: every family answers with FlutterTest, and font fallback is off.

The engine asks it after the fonts an application registers, as a collection asks its sources after its registered faces, and before the OS’s, which it leaves unreached by answering every name.

Implementations§

Source§

impl TestFontSource

Source

pub fn new() -> TestFontSource

Over FlutterTest, registered under that family as the engine’s TypefaceFontAssetProvider::RegisterTypeface names it; the file’s own family is the generator’s FreeType hinting name.

Trait Implementations§

Source§

impl Default for TestFontSource

Source§

fn default() -> TestFontSource

Returns the “default value” for a type. Read more
Source§

impl FontSource for TestFontSource

Source§

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

Flutter TestFontManager::onMatchFamily: the requested test family, else the first, FlutterTest. FlutterTest is the only one here, so every name answers with it.

Source§

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

RegisterTestFonts disables font fallback: a character FlutterTest has no glyph for draws FlutterTest’s .notdef, a box an em wide.

Source§

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 more

Auto Trait Implementations§

§

impl !RefUnwindSafe for TestFontSource

§

impl !UnwindSafe for TestFontSource

§

impl Forget for TestFontSource

§

impl Freeze for TestFontSource
where *const ArcInner<SharedFace> is !null: Freeze, PhantomData<ArcInner<SharedFace>>: Freeze, *const u8 is !null: Freeze, PhantomData<([u8; 4], f32)>: Freeze, PhantomData<F2Dot14>: Freeze, *const F2Dot14 is !null: Freeze, PhantomData<u8>: Freeze, PhantomData<String>: Freeze,

§

impl Move for TestFontSource

§

impl Send for TestFontSource
where Arc<SharedFace>: Send, RawVecInner: Send, SmallVec<[F2Dot14; 11]>: Send,

§

impl Sync for TestFontSource
where Arc<SharedFace>: Sync, RawVecInner: Sync, SmallVecData<[F2Dot14; 11]>: Sync,

§

impl Unpin for TestFontSource
where Arc<SharedFace>: Unpin, *const u8 is !null: Unpin, *const F2Dot14 is !null: Unpin,

§

impl UnsafeUnpin for TestFontSource

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,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,