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

Public Member Functions

 DataFontLoader (sk_sp< SkData > *datas, int n)
 
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 sk_sp< SkData > * fDatas
 
const int fNum
 

Detailed Description

Definition at line 45 of file SkFontMgr_custom_embedded.cpp.

Constructor & Destructor Documentation

◆ DataFontLoader()

DataFontLoader::DataFontLoader ( sk_sp< SkData > *  datas,
int  n 
)
inline

Definition at line 47 of file SkFontMgr_custom_embedded.cpp.

47: fDatas(datas), fNum(n) { }
const sk_sp< SkData > * fDatas

Member Function Documentation

◆ loadSystemFonts()

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

Implements SkFontMgr_Custom::SystemFontLoader.

Definition at line 49 of file SkFontMgr_custom_embedded.cpp.

51 {
52 for (int i = 0; i < fNum; ++i) {
53 auto stream = std::make_unique<SkMemoryStream>(fDatas[i]);
54 load_font_from_data(scanner, std::move(stream), i, families);
55 }
56
57 if (families->empty()) {
59 families->push_back().reset(family);
60 family->appendTypeface(sk_make_sp<SkTypeface_Empty>());
61 }
62 }
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

Member Data Documentation

◆ fDatas

const sk_sp<SkData>* DataFontLoader::fDatas

Definition at line 64 of file SkFontMgr_custom_embedded.cpp.

◆ fNum

const int DataFontLoader::fNum

Definition at line 65 of file SkFontMgr_custom_embedded.cpp.


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