Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
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 ()
 
- 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:243

◆ 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:416

◆ 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}
void reset(int n)
Definition SkTArray.h:139
const char * name
Definition fuchsia.cc:50

◆ 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)

Friends And Related Symbol 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: