19#include "flutter/fml/logging.h"
31 return family_names_.size();
36 return family_names_[index];
41 const std::string& family_name) {
43 if (found == registered_families_.end()) {
50 if (typeface ==
nullptr) {
57 std::string family_name(sk_family_name.
c_str(), sk_family_name.
size());
63 std::string family_name_alias) {
64 if (family_name_alias.empty()) {
69 auto family_it = registered_families_.find(canonical_name);
70 if (family_it == registered_families_.end()) {
71 family_names_.push_back(family_name_alias);
73 std::make_pair(canonical_name, sk_make_sp<TypefaceFontStyleSet>());
74 family_it = registered_families_.emplace(
value).first;
76 family_it->second->registerTypeface(std::move(typeface));
84 if (typeface ==
nullptr) {
87 typefaces_.emplace_back(std::move(typeface));
91 return typefaces_.size();
97 FML_DCHECK(
static_cast<size_t>(index) < typefaces_.size());
99 *style = typefaces_[index]->fontStyle();
108 if (index >= typefaces_.size()) {
111 return typefaces_[index];
sk_sp< SkTypeface > matchStyleCSS3(const SkFontStyle &pattern)
const char * c_str() const
void getFamilyName(SkString *name) const
static std::string CanonicalFamilyName(std::string family_name)
~TypefaceFontAssetProvider() override
void RegisterTypeface(sk_sp< SkTypeface > typeface)
std::string GetFamilyName(int index) const override
TypefaceFontAssetProvider()
size_t GetFamilyCount() const override
sk_sp< SkFontStyleSet > MatchFamily(const std::string &family_name) override
sk_sp< SkTypeface > matchStyle(const SkFontStyle &pattern) override
~TypefaceFontStyleSet() override
void getStyle(int index, SkFontStyle *style, SkString *name) override
sk_sp< SkTypeface > createTypeface(int index) override
void registerTypeface(sk_sp< SkTypeface > typeface)
#define FML_DCHECK(condition)
DEF_SWITCHES_START aot vmservice shared library name