Flutter Engine
txt::FontAssetProvider Class Referenceabstract

#include <font_asset_provider.h>

Inheritance diagram for txt::FontAssetProvider:
flutter::AssetManagerFontProvider txt::TypefaceFontAssetProvider

Public Member Functions

virtual ~FontAssetProvider ()=default
 
virtual size_t GetFamilyCount () const =0
 
virtual std::string GetFamilyName (int index) const =0
 
virtual SkFontStyleSet * MatchFamily (const std::string &family_name)=0
 

Static Protected Member Functions

static std::string CanonicalFamilyName (std::string family_name)
 

Detailed Description

Definition at line 26 of file font_asset_provider.h.

Constructor & Destructor Documentation

◆ ~FontAssetProvider()

virtual txt::FontAssetProvider::~FontAssetProvider ( )
virtualdefault

Member Function Documentation

◆ CanonicalFamilyName()

std::string txt::FontAssetProvider::CanonicalFamilyName ( std::string  family_name)
staticprotected

Definition at line 26 of file font_asset_provider.cc.

References flutter::transform.

Referenced by txt::TypefaceFontAssetProvider::MatchFamily(), flutter::AssetManagerFontProvider::MatchFamily(), flutter::AssetManagerFontProvider::RegisterAsset(), and txt::TypefaceFontAssetProvider::RegisterTypeface().

26  {
27  std::string result(family_name.length(), 0);
28 
29  // Convert ASCII characters to lower case.
30  std::transform(family_name.begin(), family_name.end(), result.begin(),
31  [](char c) { return (c & 0x80) ? c : ::tolower(c); });
32 
33  return result;
34 }

◆ GetFamilyCount()

virtual size_t txt::FontAssetProvider::GetFamilyCount ( ) const
pure virtual

◆ GetFamilyName()

virtual std::string txt::FontAssetProvider::GetFamilyName ( int  index) const
pure virtual

◆ MatchFamily()

virtual SkFontStyleSet* txt::FontAssetProvider::MatchFamily ( const std::string &  family_name)
pure virtual

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