Skip to content

Commit

Permalink
libtxt: cache font families that are remapped to the default font fam…
Browse files Browse the repository at this point in the history
…ily (#4990)
  • Loading branch information
jason-simmons authored Apr 12, 2018
1 parent a530035 commit b7358b3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion third_party/txt/src/txt/font_collection.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit b7358b3

Please sign in to comment.