mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Forward font collection APIs to the SkParagraph font collection (#21734)
This commit is contained in:
parent
bcc557f1ba
commit
6fdcdd99cc
19
third_party/txt/src/txt/font_collection.cc
vendored
19
third_party/txt/src/txt/font_collection.cc
vendored
@ -85,6 +85,12 @@ FontCollection::FontCollection() : enable_font_fallback_(true) {}
|
||||
|
||||
FontCollection::~FontCollection() {
|
||||
minikin::Layout::purgeCaches();
|
||||
|
||||
#if FLUTTER_ENABLE_SKSHAPER
|
||||
if (skt_collection_) {
|
||||
skt_collection_->clearCaches();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
size_t FontCollection::GetFontManagersCount() const {
|
||||
@ -127,6 +133,12 @@ std::vector<sk_sp<SkFontMgr>> FontCollection::GetFontManagerOrder() const {
|
||||
|
||||
void FontCollection::DisableFontFallback() {
|
||||
enable_font_fallback_ = false;
|
||||
|
||||
#if FLUTTER_ENABLE_SKSHAPER
|
||||
if (skt_collection_) {
|
||||
skt_collection_->disableFontFallback();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
std::shared_ptr<minikin::FontCollection>
|
||||
@ -346,8 +358,13 @@ FontCollection::GetFallbackFontFamily(const sk_sp<SkFontMgr>& manager,
|
||||
|
||||
void FontCollection::ClearFontFamilyCache() {
|
||||
font_collections_cache_.clear();
|
||||
}
|
||||
|
||||
#if FLUTTER_ENABLE_SKSHAPER
|
||||
if (skt_collection_) {
|
||||
skt_collection_->clearCaches();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#if FLUTTER_ENABLE_SKSHAPER
|
||||
|
||||
sk_sp<skia::textlayout::FontCollection>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user