Do not return a Minikin font collection if the SkFontStyleSet is unable to create any typefaces (flutter/engine#24951)
This commit is contained in:
@@ -117,6 +117,8 @@ SkTypeface* AssetManagerFontStyleSet::createTypeface(int i) {
|
||||
// Ownership of the stream is transferred.
|
||||
asset.typeface = SkTypeface::MakeFromStream(std::move(stream));
|
||||
if (!asset.typeface) {
|
||||
FML_DLOG(ERROR) << "Unable to load font asset for family: "
|
||||
<< family_name_;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -295,6 +295,10 @@ std::shared_ptr<minikin::FontFamily> FontCollection::CreateMinikinFontFamily(
|
||||
}
|
||||
}
|
||||
|
||||
if (skia_typefaces.empty()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
SortSkTypefaces(skia_typefaces);
|
||||
|
||||
std::vector<minikin::Font> minikin_fonts;
|
||||
|
||||
Reference in New Issue
Block a user