9#include "flutter/fml/logging.h"
15 : typeface_mapping_(
std::move(typeface_mapping)),
16 font_info_(
std::make_unique<stbtt_fontinfo>()) {
18 auto offset = stbtt_GetFontOffsetForIndex(typeface_mapping_->GetMapping(), 0);
19 if (stbtt_InitFont(font_info_.get(), typeface_mapping_->GetMapping(),
21 FML_LOG(
ERROR) <<
"Failed to initialize stb font from binary data.";
37 return reinterpret_cast<size_t>(typeface_mapping_->GetMapping());
41 auto stb_other =
reinterpret_cast<const TypefaceSTB*
>(&other);
46 return typeface_mapping_->GetMapping();
50 return font_info_.get();
bool IsValid() const override
const stbtt_fontinfo * GetFontInfo() const
std::size_t GetHash() const override
TypefaceSTB(std::unique_ptr< fml::Mapping > typeface_mapping)
bool IsEqual(const Typeface &other) const override
const uint8_t * GetTypefaceFile() const
A typeface, usually obtained from a font-file, on disk describes the intrinsic properties of the font...
#define FML_LOG(severity)