Do not assume that createTypeface is called before getStyle in the AssetManagerFontStyleSet (flutter/engine#14343)
This commit is contained in:
@@ -84,7 +84,10 @@ void AssetManagerFontStyleSet::getStyle(int index,
|
||||
SkString* name) {
|
||||
FML_DCHECK(index < static_cast<int>(assets_.size()));
|
||||
if (style) {
|
||||
*style = assets_[index].typeface->fontStyle();
|
||||
sk_sp<SkTypeface> typeface(createTypeface(index));
|
||||
if (typeface) {
|
||||
*style = typeface->fontStyle();
|
||||
}
|
||||
}
|
||||
if (name) {
|
||||
*name = family_name_.c_str();
|
||||
|
||||
Reference in New Issue
Block a user