Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
SkFontStyleSet_Fuchsia Class Reference
Inheritance diagram for SkFontStyleSet_Fuchsia:
SkFontStyleSet SkRefCnt SkRefCntBase

Public Member Functions

 SkFontStyleSet_Fuchsia (sk_sp< SkFontMgr_Fuchsia > font_manager, std::string familyName, std::vector< SkFontStyle > styles)
 
 ~SkFontStyleSet_Fuchsia () override=default
 
int count () override
 
void getStyle (int index, SkFontStyle *style, SkString *styleName) override
 
sk_sp< SkTypefacecreateTypeface (int index) override
 
sk_sp< SkTypefacematchStyle (const SkFontStyle &pattern) override
 
virtual int count ()=0
 
virtual void getStyle (int index, SkFontStyle *, SkString *style)=0
 
virtual sk_sp< SkTypefacecreateTypeface (int index)=0
 
virtual sk_sp< SkTypefacematchStyle (const SkFontStyle &pattern)=0
 
- Public Member Functions inherited from SkRefCntBase
 SkRefCntBase ()
 
virtual ~SkRefCntBase ()
 
bool unique () const
 
void ref () const
 
void unref () const
 

Additional Inherited Members

- Static Public Member Functions inherited from SkFontStyleSet
static sk_sp< SkFontStyleSetCreateEmpty ()
 
- Protected Member Functions inherited from SkFontStyleSet
sk_sp< SkTypefacematchStyleCSS3 (const SkFontStyle &pattern)
 

Detailed Description

Definition at line 321 of file SkFontMgr_fuchsia.cpp.

Constructor & Destructor Documentation

◆ SkFontStyleSet_Fuchsia()

SkFontStyleSet_Fuchsia::SkFontStyleSet_Fuchsia ( sk_sp< SkFontMgr_Fuchsia font_manager,
std::string  familyName,
std::vector< SkFontStyle styles 
)
inline

Definition at line 323 of file SkFontMgr_fuchsia.cpp.

325 : fFontManager(font_manager), fFamilyName(familyName), fStyles(styles) {}

◆ ~SkFontStyleSet_Fuchsia()

SkFontStyleSet_Fuchsia::~SkFontStyleSet_Fuchsia ( )
overridedefault

Member Function Documentation

◆ count()

int SkFontStyleSet_Fuchsia::count ( )
inlineoverridevirtual

Implements SkFontStyleSet.

Definition at line 329 of file SkFontMgr_fuchsia.cpp.

329{ return fStyles.size(); }

◆ createTypeface()

sk_sp< SkTypeface > SkFontStyleSet_Fuchsia::createTypeface ( int  index)
inlineoverridevirtual

Implements SkFontStyleSet.

Definition at line 339 of file SkFontMgr_fuchsia.cpp.

339 {
340 SkASSERT(index >= 0 && index < static_cast<int>(fStyles.size()));
341
342 if (fTypefaces.empty()) fTypefaces.resize(fStyles.size());
343
344 if (!fTypefaces[index]) {
345 fTypefaces[index] = fFontManager->FetchTypeface(
346 fFamilyName.c_str(), fStyles[index], /*bcp47=*/nullptr,
347 /*bcp47Count=*/0, /*character=*/0,
348 /*allow_fallback=*/false, /*exact_style_match=*/true);
349 }
350
351 return fTypefaces[index];
352 }
#define SkASSERT(cond)
Definition: SkAssert.h:116

◆ getStyle()

void SkFontStyleSet_Fuchsia::getStyle ( int  index,
SkFontStyle style,
SkString styleName 
)
inlineoverridevirtual

Implements SkFontStyleSet.

Definition at line 331 of file SkFontMgr_fuchsia.cpp.

331 {
332 SkASSERT(index >= 0 && index < static_cast<int>(fStyles.size()));
333 if (style) *style = fStyles[index];
334
335 // We don't have style names. Return an empty name.
336 if (styleName) styleName->reset();
337 }
void reset()
Definition: SkString.cpp:358

◆ matchStyle()

sk_sp< SkTypeface > SkFontStyleSet_Fuchsia::matchStyle ( const SkFontStyle pattern)
inlineoverridevirtual

Implements SkFontStyleSet.

Definition at line 354 of file SkFontMgr_fuchsia.cpp.

354 {
355 return matchStyleCSS3(pattern);
356 }
sk_sp< SkTypeface > matchStyleCSS3(const SkFontStyle &pattern)
Definition: SkFontMgr.cpp:184

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