Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | List of all members
skia::textlayout::TypefaceFontStyleSet Class Reference

#include <TypefaceFontProvider.h>

Inheritance diagram for skia::textlayout::TypefaceFontStyleSet:
SkFontStyleSet SkRefCnt SkRefCntBase

Public Member Functions

 TypefaceFontStyleSet (const SkString &familyName)
 
int count () override
 
void getStyle (int index, SkFontStyle *, SkString *name) override
 
sk_sp< SkTypefacecreateTypeface (int index) override
 
sk_sp< SkTypefacematchStyle (const SkFontStyle &pattern) override
 
SkString getFamilyName () const
 
SkString getAlias () const
 
void appendTypeface (sk_sp< SkTypeface > typeface)
 
- 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 19 of file TypefaceFontProvider.h.

Constructor & Destructor Documentation

◆ TypefaceFontStyleSet()

skia::textlayout::TypefaceFontStyleSet::TypefaceFontStyleSet ( const SkString familyName)
explicit

Definition at line 84 of file TypefaceFontProvider.cpp.

85 : fFamilyName(familyName) {}

Member Function Documentation

◆ appendTypeface()

void skia::textlayout::TypefaceFontStyleSet::appendTypeface ( sk_sp< SkTypeface typeface)

Definition at line 108 of file TypefaceFontProvider.cpp.

108 {
109 if (typeface.get() != nullptr) {
110 fStyles.emplace_back(std::move(typeface));
111 }
112}
T * get() const
Definition SkRefCnt.h:303
T & emplace_back(Args &&... args)
Definition SkTArray.h:243

◆ count()

int skia::textlayout::TypefaceFontStyleSet::count ( )
overridevirtual

Implements SkFontStyleSet.

Definition at line 87 of file TypefaceFontProvider.cpp.

87{ return fStyles.size(); }
int size() const
Definition SkTArray.h:416

◆ createTypeface()

sk_sp< SkTypeface > skia::textlayout::TypefaceFontStyleSet::createTypeface ( int  index)
overridevirtual

Implements SkFontStyleSet.

Definition at line 99 of file TypefaceFontProvider.cpp.

99 {
100 SkASSERT(index < fStyles.size());
101 return fStyles[index];
102}
#define SkASSERT(cond)
Definition SkAssert.h:116

◆ getAlias()

SkString skia::textlayout::TypefaceFontStyleSet::getAlias ( ) const
inline

Definition at line 29 of file TypefaceFontProvider.h.

29{ return fAlias; }

◆ getFamilyName()

SkString skia::textlayout::TypefaceFontStyleSet::getFamilyName ( ) const
inline

Definition at line 28 of file TypefaceFontProvider.h.

28{ return fFamilyName; }

◆ getStyle()

void skia::textlayout::TypefaceFontStyleSet::getStyle ( int  index,
SkFontStyle style,
SkString name 
)
overridevirtual

Implements SkFontStyleSet.

Definition at line 89 of file TypefaceFontProvider.cpp.

89 {
90 SkASSERT(index < fStyles.size());
91 if (style) {
92 *style = fStyles[index]->fontStyle();
93 }
94 if (name) {
95 *name = fFamilyName;
96 }
97}
const char * name
Definition fuchsia.cc:50

◆ matchStyle()

sk_sp< SkTypeface > skia::textlayout::TypefaceFontStyleSet::matchStyle ( const SkFontStyle pattern)
overridevirtual

Implements SkFontStyleSet.

Definition at line 104 of file TypefaceFontProvider.cpp.

104 {
105 return this->matchStyleCSS3(pattern);
106}
sk_sp< SkTypeface > matchStyleCSS3(const SkFontStyle &pattern)

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