#include <typography_context.h>
Definition at line 17 of file typography_context.h.
◆ TypographyContext() [1/2]
impeller::interop::TypographyContext::TypographyContext |
( |
| ) |
|
Definition at line 16 of file typography_context.cc.
17 : collection_(std::make_shared<txt::FontCollection>()) {
18 static std::once_flag sICUInitOnceFlag;
19 std::call_once(sICUInitOnceFlag, []() {
20 auto icu_data = std::make_unique<fml::NonOwnedMapping>(
21 impeller_embedded_icu_data_data, impeller_embedded_icu_data_length);
22 fml::icu::InitializeICUFromMapping(std::move(icu_data));
25 collection_->SetupDefaultFontManager(0u);
28 asset_font_manager_ = sk_make_sp<skia::textlayout::TypefaceFontProvider>();
29 collection_->SetAssetFontManager(asset_font_manager_);
◆ ~TypographyContext()
impeller::interop::TypographyContext::~TypographyContext |
( |
| ) |
|
|
overridedefault |
◆ TypographyContext() [2/2]
impeller::interop::TypographyContext::TypographyContext |
( |
const TypographyContext & |
| ) |
|
|
delete |
◆ GetFontCollection()
const std::shared_ptr< txt::FontCollection > & impeller::interop::TypographyContext::GetFontCollection |
( |
| ) |
const |
◆ IsValid()
bool impeller::interop::TypographyContext::IsValid |
( |
| ) |
const |
◆ operator=()
◆ RegisterFont()
bool impeller::interop::TypographyContext::RegisterFont |
( |
std::unique_ptr< fml::Mapping > |
font_data, |
|
|
const char * |
family_name_alias |
|
) |
| |
Registers custom font data. If an alias for the family name is provided, subsequent lookups will need to use that same alias. If not, the family name will be read from the font data.
- Parameters
-
[in] | font_data | The font data |
[in] | family_name_alias | The family name alias |
- Returns
- If the font data could be successfully registered.
Definition at line 68 of file typography_context.cc.
71 if (typeface ==
nullptr) {
75 if (family_name_alias ==
nullptr) {
76 result = asset_font_manager_->registerTypeface(std::move(typeface));
78 result = asset_font_manager_->registerTypeface(std::move(typeface),
79 SkString{family_name_alias});
static sk_sp< SkTypeface > CreateTypefaceFromFontData(std::unique_ptr< fml::Mapping > font_data)
References impeller::interop::CreateTypefaceFromFontData().
The documentation for this class was generated from the following files: