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
impl TestFontSource
Sourcepub fn new() -> TestFontSource
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
impl Default for TestFontSource
Source§fn default() -> TestFontSource
fn default() -> TestFontSource
Source§impl FontSource for TestFontSource
impl FontSource for TestFontSource
Source§fn family(&mut self, _name: &str) -> Vec<Font>
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>
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>
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