Flutter Engine
The Flutter Engine
Public Member Functions | Public Attributes | List of all members
EmbeddedSystemFontLoader Class Reference
Inheritance diagram for EmbeddedSystemFontLoader:
SkFontMgr_Custom::SystemFontLoader

Public Member Functions

 EmbeddedSystemFontLoader (const SkEmbeddedResourceHeader *header)
 
void loadSystemFonts (const SkFontScanner *scanner, SkFontMgr_Custom::Families *families) const override
 
- Public Member Functions inherited from SkFontMgr_Custom::SystemFontLoader
virtual ~SystemFontLoader ()
 
virtual void loadSystemFonts (const SkFontScanner *, Families *) const =0
 

Public Attributes

const SkEmbeddedResourceHeaderfHeader
 

Detailed Description

Definition at line 22 of file SkFontMgr_custom_embedded.cpp.

Constructor & Destructor Documentation

◆ EmbeddedSystemFontLoader()

EmbeddedSystemFontLoader::EmbeddedSystemFontLoader ( const SkEmbeddedResourceHeader header)
inline

Definition at line 24 of file SkFontMgr_custom_embedded.cpp.

24: fHeader(header) { }
const SkEmbeddedResourceHeader * fHeader
static const char header[]
Definition: skpbench.cpp:88

Member Function Documentation

◆ loadSystemFonts()

void EmbeddedSystemFontLoader::loadSystemFonts ( const SkFontScanner scanner,
SkFontMgr_Custom::Families families 
) const
inlineoverridevirtual

Implements SkFontMgr_Custom::SystemFontLoader.

Definition at line 26 of file SkFontMgr_custom_embedded.cpp.

28 {
29 for (int i = 0; i < fHeader->count; ++i) {
30 const SkEmbeddedResource& fontEntry = fHeader->entries[i];
31 auto stream = std::make_unique<SkMemoryStream>(fontEntry.data, fontEntry.size, false);
32 load_font_from_data(scanner, std::move(stream), i, families);
33 }
34
35 if (families->empty()) {
37 families->push_back().reset(family);
38 family->appendTypeface(sk_make_sp<SkTypeface_Empty>());
39 }
40 }
static void load_font_from_data(const SkFontScanner *scanner, std::unique_ptr< SkMemoryStream > stream, int index, SkFontMgr_Custom::Families *families)
void appendTypeface(sk_sp< SkTypeface > typeface)
void reset(T *ptr=nullptr)
Definition: SkRefCnt.h:310
bool empty() const
Definition: SkTArray.h:199
const SkEmbeddedResource * entries

Member Data Documentation

◆ fHeader

const SkEmbeddedResourceHeader* EmbeddedSystemFontLoader::fHeader

Definition at line 42 of file SkFontMgr_custom_embedded.cpp.


The documentation for this class was generated from the following file: