mirror of
https://github.com/encounter/engine.git
synced 2026-03-30 11:09:55 -07:00
Do not assume that createTypeface is called before getStyle in the AssetManagerFontStyleSet (#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