mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Do not assume that createTypeface is called before getStyle in the AssetManagerFontStyleSet (flutter/engine#14343)
This commit is contained in:
parent
879d79695a
commit
4dc714b8a4
@ -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();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user