mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
libtxt: cache font families that are remapped to the default font family (#4990)
This commit is contained in:
parent
a530035bb2
commit
b7358b33db
5
third_party/txt/src/txt/font_collection.cc
vendored
5
third_party/txt/src/txt/font_collection.cc
vendored
@ -156,7 +156,10 @@ FontCollection::GetMinikinFontCollectionForFamily(const std::string& family) {
|
||||
|
||||
const auto default_font_family = GetDefaultFontFamily();
|
||||
if (family != default_font_family) {
|
||||
return GetMinikinFontCollectionForFamily(default_font_family);
|
||||
std::shared_ptr<minikin::FontCollection> default_collection =
|
||||
GetMinikinFontCollectionForFamily(default_font_family);
|
||||
font_collections_cache_[family] = default_collection;
|
||||
return default_collection;
|
||||
}
|
||||
|
||||
// No match found in any of our font managers.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user