mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Track fallback font names as a vector instead of a set. (#12426)
This commit is contained in:
parent
013ae3e5b9
commit
075c5b0f61
5
third_party/txt/src/txt/font_collection.cc
vendored
5
third_party/txt/src/txt/font_collection.cc
vendored
@ -273,7 +273,10 @@ const std::shared_ptr<minikin::FontFamily>& FontCollection::DoMatchFallbackFont(
|
||||
typeface->getFamilyName(&sk_family_name);
|
||||
std::string family_name(sk_family_name.c_str());
|
||||
|
||||
fallback_fonts_for_locale_[locale].insert(family_name);
|
||||
if (std::find(fallback_fonts_for_locale_[locale].begin(),
|
||||
fallback_fonts_for_locale_[locale].end(),
|
||||
family_name) == fallback_fonts_for_locale_[locale].end())
|
||||
fallback_fonts_for_locale_[locale].push_back(family_name);
|
||||
|
||||
return GetFallbackFontFamily(manager, family_name);
|
||||
}
|
||||
|
||||
2
third_party/txt/src/txt/font_collection.h
vendored
2
third_party/txt/src/txt/font_collection.h
vendored
@ -103,7 +103,7 @@ class FontCollection : public std::enable_shared_from_this<FontCollection> {
|
||||
fallback_match_cache_;
|
||||
std::unordered_map<std::string, std::shared_ptr<minikin::FontFamily>>
|
||||
fallback_fonts_;
|
||||
std::unordered_map<std::string, std::set<std::string>>
|
||||
std::unordered_map<std::string, std::vector<std::string>>
|
||||
fallback_fonts_for_locale_;
|
||||
bool enable_font_fallback_;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user