未验证 提交 16b3a593 编写于 作者: J Jason Simmons 提交者: GitHub

Do not return a Minikin font collection if the SkFontStyleSet is unable to...

Do not return a Minikin font collection if the SkFontStyleSet is unable to create any typefaces (#24951)
上级 d6e8f2d5
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册