5#ifndef FLUTTER_LIB_UI_TEXT_ASSET_MANAGER_FONT_PROVIDER_H_
6#define FLUTTER_LIB_UI_TEXT_ASSET_MANAGER_FONT_PROVIDER_H_
10#include <unordered_map>
13#include "flutter/assets/asset_manager.h"
14#include "flutter/fml/macros.h"
24 std::string family_name);
38 decltype(std::declval<SkFontStyleSet>().createTypeface(0));
42 using MatchStyleRet =
decltype(std::declval<SkFontStyleSet>().matchStyle(
43 std::declval<SkFontStyle>()));
47 std::shared_ptr<AssetManager> asset_manager_;
48 std::string family_name_;
50 struct TypefaceAsset {
51 explicit TypefaceAsset(std::string
a);
53 TypefaceAsset(
const TypefaceAsset& other);
60 std::vector<TypefaceAsset> assets_;
68 std::shared_ptr<AssetManager> asset_manager);
72 void RegisterAsset(
const std::string& family_name,
const std::string& asset);
84 std::shared_ptr<AssetManager> asset_manager_;
85 std::unordered_map<std::string, sk_sp<AssetManagerFontStyleSet>>
87 std::vector<std::string> family_names_;
std::string GetFamilyName(int index) const override
void RegisterAsset(const std::string &family_name, const std::string &asset)
~AssetManagerFontProvider() override
sk_sp< SkFontStyleSet > MatchFamily(const std::string &family_name) override
size_t GetFamilyCount() const override
AssetManagerFontProvider(std::shared_ptr< AssetManager > asset_manager)
MatchStyleRet matchStyle(const SkFontStyle &pattern) override
decltype(std::declval< SkFontStyleSet >().matchStyle(std::declval< SkFontStyle >())) MatchStyleRet
decltype(std::declval< SkFontStyleSet >().createTypeface(0)) CreateTypefaceRet
~AssetManagerFontStyleSet() override
void registerAsset(const std::string &asset)
void getStyle(int index, SkFontStyle *, SkString *style) override
CreateTypefaceRet createTypeface(int index) override
AssetManagerFontStyleSet(std::shared_ptr< AssetManager > asset_manager, std::string family_name)