15 SkASSERT(index < fRegisteredFamilies.count());
16 familyName->
set(fFamilyNames[index]);
20 auto found = fRegisteredFamilies.find(
SkString(familyName));
21 return found ? *found :
nullptr;
25 SkASSERT(index < fRegisteredFamilies.count());
26 auto found = fRegisteredFamilies.find(fFamilyNames[index]);
27 return found ? *found :
nullptr;
40 if (typeface ==
nullptr) {
51 if (familyName.
size() == 0) {
55 auto found = fRegisteredFamilies.find(familyName);
56 if (found ==
nullptr) {
57 found = fRegisteredFamilies.set(familyName, sk_make_sp<TypefaceFontStyleSet>(familyName));
61 (*found)->appendTypeface(std::move(typeface));
70 if (matchedByFamily) {
71 return matchedByFamily;
85 : fFamilyName(familyName) {}
92 *style = fStyles[index]->fontStyle();
101 return fStyles[index];
109 if (typeface.
get() !=
nullptr) {
sk_sp< SkFontStyleSet > createStyleSet(int index) const
sk_sp< SkFontStyleSet > matchFamily(const char familyName[]) const
int countFamilies() const
sk_sp< SkTypeface > matchFamilyStyle(const char familyName[], const SkFontStyle &) const
sk_sp< SkTypeface > matchStyleCSS3(const SkFontStyle &pattern)
virtual sk_sp< SkTypeface > matchStyle(const SkFontStyle &pattern)=0
void set(const SkString &src)
void getFamilyName(SkString *name) const
void onGetFamilyName(int index, SkString *familyName) const override
sk_sp< SkFontStyleSet > onCreateStyleSet(int) const override
sk_sp< SkTypeface > onLegacyMakeTypeface(const char[], SkFontStyle) const override
size_t registerTypeface(sk_sp< SkTypeface > typeface)
int onCountFamilies() const override
sk_sp< SkFontStyleSet > onMatchFamily(const char familyName[]) const override
sk_sp< SkTypeface > onMatchFamilyStyle(const char familyName[], const SkFontStyle &pattern) const override
sk_sp< SkTypeface > createTypeface(int index) override
void getStyle(int index, SkFontStyle *, SkString *name) override
TypefaceFontStyleSet(const SkString &familyName)
sk_sp< SkTypeface > matchStyle(const SkFontStyle &pattern) override
void appendTypeface(sk_sp< SkTypeface > typeface)
T & emplace_back(Args &&... args)
DEF_SWITCHES_START aot vmservice shared library name