Flutter Engine
The Flutter Engine
Public Member Functions | Friends | List of all members
SkFontStyleSet_Custom Class Reference

#include <SkFontMgr_custom.h>

Inheritance diagram for SkFontStyleSet_Custom:
SkFontStyleSet SkRefCnt SkRefCntBase

Public Member Functions

 SkFontStyleSet_Custom (SkString familyName)
 
void appendTypeface (sk_sp< SkTypeface > typeface)
 
int count () override
 
void getStyle (int index, SkFontStyle *style, SkString *name) override
 
sk_sp< SkTypefacecreateTypeface (int index) override
 
sk_sp< SkTypefacematchStyle (const SkFontStyle &pattern) override
 
SkString getFamilyName ()
 
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
 

Friends

class SkFontMgr_Custom
 

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

SkFontStyleSet_Custom

This class is used by SkFontMgr_Custom to hold SkTypeface_Custom families.

Definition at line 84 of file SkFontMgr_custom.h.

Constructor & Destructor Documentation

◆ SkFontStyleSet_Custom()

SkFontStyleSet_Custom::SkFontStyleSet_Custom ( SkString  familyName)
explicit

Definition at line 96 of file SkFontMgr_custom.cpp.

97 : fFamilyName(std::move(familyName)) {}

Member Function Documentation

◆ appendTypeface()

void SkFontStyleSet_Custom::appendTypeface ( sk_sp< SkTypeface typeface)

Should only be called during the initial build phase.

Definition at line 99 of file SkFontMgr_custom.cpp.

99 {
100 fStyles.emplace_back(std::move(typeface));
101}
T & emplace_back(Args &&... args)
Definition: SkTArray.h:248

◆ count()

int SkFontStyleSet_Custom::count ( )
overridevirtual

Implements SkFontStyleSet.

Definition at line 103 of file SkFontMgr_custom.cpp.

103 {
104 return fStyles.size();
105}
int size() const
Definition: SkTArray.h:421

◆ createTypeface()

sk_sp< SkTypeface > SkFontStyleSet_Custom::createTypeface ( int  index)
overridevirtual

Implements SkFontStyleSet.

Definition at line 117 of file SkFontMgr_custom.cpp.

117 {
118 SkASSERT(index < fStyles.size());
119 return fStyles[index];
120}
#define SkASSERT(cond)
Definition: SkAssert.h:116

◆ getFamilyName()

SkString SkFontStyleSet_Custom::getFamilyName ( )

Definition at line 126 of file SkFontMgr_custom.cpp.

126{ return fFamilyName; }

◆ getStyle()

void SkFontStyleSet_Custom::getStyle ( int  index,
SkFontStyle style,
SkString name 
)
overridevirtual

Implements SkFontStyleSet.

Definition at line 107 of file SkFontMgr_custom.cpp.

107 {
108 SkASSERT(index < fStyles.size());
109 if (style) {
110 *style = fStyles[index]->fontStyle();
111 }
112 if (name) {
113 name->reset();
114 }
115}
DEF_SWITCHES_START aot vmservice shared library name
Definition: switches.h:32

◆ matchStyle()

sk_sp< SkTypeface > SkFontStyleSet_Custom::matchStyle ( const SkFontStyle pattern)
overridevirtual

Implements SkFontStyleSet.

Definition at line 122 of file SkFontMgr_custom.cpp.

122 {
123 return this->matchStyleCSS3(pattern);
124}
sk_sp< SkTypeface > matchStyleCSS3(const SkFontStyle &pattern)
Definition: SkFontMgr.cpp:184

Friends And Related Function Documentation

◆ SkFontMgr_Custom

friend class SkFontMgr_Custom
friend

Definition at line 100 of file SkFontMgr_custom.h.


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