diff --git a/engine/src/flutter/lib/ui/text/asset_manager_font_provider.cc b/engine/src/flutter/lib/ui/text/asset_manager_font_provider.cc index c1ae48e137..b07472f7e7 100644 --- a/engine/src/flutter/lib/ui/text/asset_manager_font_provider.cc +++ b/engine/src/flutter/lib/ui/text/asset_manager_font_provider.cc @@ -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; } } diff --git a/engine/src/flutter/third_party/txt/src/txt/font_collection.cc b/engine/src/flutter/third_party/txt/src/txt/font_collection.cc index d9b00807a3..7c0e4e4830 100644 --- a/engine/src/flutter/third_party/txt/src/txt/font_collection.cc +++ b/engine/src/flutter/third_party/txt/src/txt/font_collection.cc @@ -295,6 +295,10 @@ std::shared_ptr FontCollection::CreateMinikinFontFamily( } } + if (skia_typefaces.empty()) { + return nullptr; + } + SortSkTypefaces(skia_typefaces); std::vector minikin_fonts;