Use case
Reduce the generation of unnecessary FontMgr.
https://github.com/flutter/flutter/blob/main/engine/src/flutter/lib/web_ui/lib/src/engine/canvaskit/fonts.dart#L200C1-L206C1
String? _readActualFamilyName(Uint8List bytes) {
final SkFontMgr tmpFontMgr = canvasKit.FontMgr.FromData(<Uint8List>[bytes])!;
final String? actualFamily = tmpFontMgr.getFamilyName(0);
tmpFontMgr.delete();
return actualFamily;
}
Proposal
Use SkTypeface to read out the actual name of the font instead of creating a new FontMgr object.
Use case
Reduce the generation of unnecessary FontMgr.
https://github.com/flutter/flutter/blob/main/engine/src/flutter/lib/web_ui/lib/src/engine/canvaskit/fonts.dart#L200C1-L206C1
Proposal
Use SkTypeface to read out the actual name of the font instead of creating a new FontMgr object.