Flutter Engine
txt::TypefaceFontStyleSet Class Reference

#include <typeface_font_asset_provider.h>

Inheritance diagram for txt::TypefaceFontStyleSet:

Public Member Functions

 TypefaceFontStyleSet ()
 
 ~TypefaceFontStyleSet () override
 
void registerTypeface (sk_sp< SkTypeface > typeface)
 
int count () override
 
void getStyle (int index, SkFontStyle *style, SkString *name) override
 
SkTypeface * createTypeface (int index) override
 
SkTypeface * matchStyle (const SkFontStyle &pattern) override
 

Detailed Description

Definition at line 30 of file typeface_font_asset_provider.h.

Constructor & Destructor Documentation

◆ TypefaceFontStyleSet()

txt::TypefaceFontStyleSet::TypefaceFontStyleSet ( )
default

◆ ~TypefaceFontStyleSet()

txt::TypefaceFontStyleSet::~TypefaceFontStyleSet ( )
overridedefault

Member Function Documentation

◆ count()

int txt::TypefaceFontStyleSet::count ( )
override

Definition at line 91 of file typeface_font_asset_provider.cc.

91  {
92  return typefaces_.size();
93 }

◆ createTypeface()

SkTypeface * txt::TypefaceFontStyleSet::createTypeface ( int  index)
override

Definition at line 107 of file typeface_font_asset_provider.cc.

107  {
108  size_t index = i;
109  if (index >= typefaces_.size()) {
110  return nullptr;
111  }
112  return SkRef(typefaces_[index].get());
113 }

◆ getStyle()

void txt::TypefaceFontStyleSet::getStyle ( int  index,
SkFontStyle *  style,
SkString *  name 
)
override

Definition at line 95 of file typeface_font_asset_provider.cc.

References FML_DCHECK.

97  {
98  FML_DCHECK(static_cast<size_t>(index) < typefaces_.size());
99  if (style) {
100  *style = typefaces_[index]->fontStyle();
101  }
102  if (name) {
103  name->reset();
104  }
105 }
#define FML_DCHECK(condition)
Definition: logging.h:86
const char * name
Definition: fuchsia.cc:50

◆ matchStyle()

SkTypeface * txt::TypefaceFontStyleSet::matchStyle ( const SkFontStyle &  pattern)
override

Definition at line 115 of file typeface_font_asset_provider.cc.

115  {
116  return matchStyleCSS3(pattern);
117 }

◆ registerTypeface()

void txt::TypefaceFontStyleSet::registerTypeface ( sk_sp< SkTypeface >  typeface)

Definition at line 84 of file typeface_font_asset_provider.cc.

84  {
85  if (typeface == nullptr) {
86  return;
87  }
88  typefaces_.emplace_back(std::move(typeface));
89 }

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