Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
txt::FontCollection Class Reference

#include <font_collection.h>

Inheritance diagram for txt::FontCollection:

Public Member Functions

 FontCollection ()
 
 ~FontCollection ()
 
size_t GetFontManagersCount () const
 
void SetupDefaultFontManager (uint32_t font_initialization_data)
 
void SetDefaultFontManager (sk_sp< SkFontMgr > font_manager)
 
void SetAssetFontManager (sk_sp< SkFontMgr > font_manager)
 
void SetDynamicFontManager (sk_sp< SkFontMgr > font_manager)
 
void SetTestFontManager (sk_sp< SkFontMgr > font_manager)
 
void DisableFontFallback ()
 
void ClearFontFamilyCache ()
 
sk_sp< skia::textlayout::FontCollectionCreateSktFontCollection ()
 

Detailed Description

Definition at line 35 of file font_collection.h.

Constructor & Destructor Documentation

◆ FontCollection()

txt::FontCollection::FontCollection ( )

◆ ~FontCollection()

txt::FontCollection::~FontCollection ( )

Member Function Documentation

◆ ClearFontFamilyCache()

void txt::FontCollection::ClearFontFamilyCache ( )

Definition at line 93 of file font_collection.cc.

93 {
94 if (skt_collection_) {
95 skt_collection_->clearCaches();
96 }
97}

◆ CreateSktFontCollection()

sk_sp< skia::textlayout::FontCollection > txt::FontCollection::CreateSktFontCollection ( )

Definition at line 100 of file font_collection.cc.

100 {
101 if (!skt_collection_) {
102 skt_collection_ = sk_make_sp<skia::textlayout::FontCollection>();
103
104 std::vector<SkString> default_font_families;
105 for (const std::string& family : GetDefaultFontFamilies()) {
106 default_font_families.emplace_back(family);
107 }
108 skt_collection_->setDefaultFontManager(default_font_manager_,
109 default_font_families);
110 skt_collection_->setAssetFontManager(asset_font_manager_);
111 skt_collection_->setDynamicFontManager(dynamic_font_manager_);
112 skt_collection_->setTestFontManager(test_font_manager_);
113 if (!enable_font_fallback_) {
114 skt_collection_->disableFontFallback();
115 }
116 }
117
118 return skt_collection_;
119}
void setDefaultFontManager(sk_sp< SkFontMgr > fontManager)
void setAssetFontManager(sk_sp< SkFontMgr > fontManager)
void setDynamicFontManager(sk_sp< SkFontMgr > fontManager)
void setTestFontManager(sk_sp< SkFontMgr > fontManager)
std::vector< std::string > GetDefaultFontFamilies()
Definition: platform.cc:13

◆ DisableFontFallback()

void txt::FontCollection::DisableFontFallback ( )

Definition at line 86 of file font_collection.cc.

86 {
87 enable_font_fallback_ = false;
88 if (skt_collection_) {
89 skt_collection_->disableFontFallback();
90 }
91}

◆ GetFontManagersCount()

size_t txt::FontCollection::GetFontManagersCount ( ) const

Definition at line 42 of file font_collection.cc.

42 {
43 return GetFontManagerOrder().size();
44}

◆ SetAssetFontManager()

void txt::FontCollection::SetAssetFontManager ( sk_sp< SkFontMgr font_manager)

Definition at line 57 of file font_collection.cc.

57 {
58 asset_font_manager_ = font_manager;
59 skt_collection_.reset();
60}
void reset(T *ptr=nullptr)
Definition: SkRefCnt.h:310

◆ SetDefaultFontManager()

void txt::FontCollection::SetDefaultFontManager ( sk_sp< SkFontMgr font_manager)

Definition at line 52 of file font_collection.cc.

52 {
53 default_font_manager_ = font_manager;
54 skt_collection_.reset();
55}

◆ SetDynamicFontManager()

void txt::FontCollection::SetDynamicFontManager ( sk_sp< SkFontMgr font_manager)

Definition at line 62 of file font_collection.cc.

62 {
63 dynamic_font_manager_ = font_manager;
64 skt_collection_.reset();
65}

◆ SetTestFontManager()

void txt::FontCollection::SetTestFontManager ( sk_sp< SkFontMgr font_manager)

Definition at line 67 of file font_collection.cc.

67 {
68 test_font_manager_ = font_manager;
69 skt_collection_.reset();
70}

◆ SetupDefaultFontManager()

void txt::FontCollection::SetupDefaultFontManager ( uint32_t  font_initialization_data)

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