Flutter Engine
The Flutter Engine
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
txt::AssetFontManager Class Reference

#include <asset_font_manager.h>

Inheritance diagram for txt::AssetFontManager:
SkFontMgr SkRefCnt SkRefCntBase txt::DynamicFontManager txt::TestFontManager

Public Member Functions

 AssetFontManager (std::unique_ptr< FontAssetProvider > font_provider)
 
 ~AssetFontManager () override
 
- Public Member Functions inherited from SkFontMgr
int countFamilies () const
 
void getFamilyName (int index, SkString *familyName) const
 
sk_sp< SkFontStyleSetcreateStyleSet (int index) const
 
sk_sp< SkFontStyleSetmatchFamily (const char familyName[]) const
 
sk_sp< SkTypefacematchFamilyStyle (const char familyName[], const SkFontStyle &) const
 
sk_sp< SkTypefacematchFamilyStyleCharacter (const char familyName[], const SkFontStyle &, const char *bcp47[], int bcp47Count, SkUnichar character) const
 
sk_sp< SkTypefacemakeFromData (sk_sp< SkData >, int ttcIndex=0) const
 
sk_sp< SkTypefacemakeFromStream (std::unique_ptr< SkStreamAsset >, int ttcIndex=0) const
 
sk_sp< SkTypefacemakeFromStream (std::unique_ptr< SkStreamAsset >, const SkFontArguments &) const
 
sk_sp< SkTypefacemakeFromFile (const char path[], int ttcIndex=0) const
 
sk_sp< SkTypefacelegacyMakeTypeface (const char familyName[], SkFontStyle style) const
 
- Public Member Functions inherited from SkRefCntBase
 SkRefCntBase ()
 
virtual ~SkRefCntBase ()
 
bool unique () const
 
void ref () const
 
void unref () const
 

Protected Member Functions

sk_sp< SkFontStyleSetonMatchFamily (const char familyName[]) const override
 
virtual int onCountFamilies () const =0
 
virtual void onGetFamilyName (int index, SkString *familyName) const =0
 
virtual sk_sp< SkFontStyleSetonCreateStyleSet (int index) const =0
 
virtual sk_sp< SkFontStyleSetonMatchFamily (const char familyName[]) const =0
 
virtual sk_sp< SkTypefaceonMatchFamilyStyle (const char familyName[], const SkFontStyle &) const =0
 
virtual sk_sp< SkTypefaceonMatchFamilyStyleCharacter (const char familyName[], const SkFontStyle &, const char *bcp47[], int bcp47Count, SkUnichar character) const =0
 
virtual sk_sp< SkTypefaceonMakeFromData (sk_sp< SkData >, int ttcIndex) const =0
 
virtual sk_sp< SkTypefaceonMakeFromStreamIndex (std::unique_ptr< SkStreamAsset >, int ttcIndex) const =0
 
virtual sk_sp< SkTypefaceonMakeFromStreamArgs (std::unique_ptr< SkStreamAsset >, const SkFontArguments &) const =0
 
virtual sk_sp< SkTypefaceonMakeFromFile (const char path[], int ttcIndex) const =0
 
virtual sk_sp< SkTypefaceonLegacyMakeTypeface (const char familyName[], SkFontStyle) const =0
 

Protected Attributes

std::unique_ptr< FontAssetProviderfont_provider_
 

Additional Inherited Members

- Static Public Member Functions inherited from SkFontMgr
static sk_sp< SkFontMgrRefEmpty ()
 

Detailed Description

Definition at line 31 of file asset_font_manager.h.

Constructor & Destructor Documentation

◆ AssetFontManager()

txt::AssetFontManager::AssetFontManager ( std::unique_ptr< FontAssetProvider font_provider)
explicit

Definition at line 27 of file asset_font_manager.cc.

29 : font_provider_(std::move(font_provider)) {
30 FML_DCHECK(font_provider_ != nullptr);
31}
std::unique_ptr< FontAssetProvider > font_provider_
#define FML_DCHECK(condition)
Definition: logging.h:103

◆ ~AssetFontManager()

txt::AssetFontManager::~AssetFontManager ( )
overridedefault

Member Function Documentation

◆ onMatchFamily()

sk_sp< SkFontStyleSet > txt::AssetFontManager::onMatchFamily ( const char  familyName[]) const
overrideprotectedvirtual

May return NULL if the name is not found.

Implements SkFontMgr.

Definition at line 48 of file asset_font_manager.cc.

49 {
50 std::string family_name(family_name_string);
51 return font_provider_->MatchFamily(family_name);
52}

Member Data Documentation

◆ font_provider_

std::unique_ptr<FontAssetProvider> txt::AssetFontManager::font_provider_
protected

Definition at line 41 of file asset_font_manager.h.


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