Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit bdd4e4d

Browse files
Do not assume that createTypeface is called before getStyle in the AssetManagerFontStyleSet (#14343)
1 parent 1377ef6 commit bdd4e4d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/ui/text/asset_manager_font_provider.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,10 @@ void AssetManagerFontStyleSet::getStyle(int index,
8484
SkString* name) {
8585
FML_DCHECK(index < static_cast<int>(assets_.size()));
8686
if (style) {
87-
*style = assets_[index].typeface->fontStyle();
87+
sk_sp<SkTypeface> typeface(createTypeface(index));
88+
if (typeface) {
89+
*style = typeface->fontStyle();
90+
}
8891
}
8992
if (name) {
9093
*name = family_name_.c_str();

0 commit comments

Comments
 (0)