LoadFontData method
Load font data for further use
Implementation
List<GlyphInfoD> LoadFontData(
Uint8List fileData,
num fontSize,
Int32List? codepoints,
num? codepointCount,
FontType type,
) => run(
() => _debugLabels.LoadFontData(fileData, fontSize, codepoints, codepointCount, type),
() {
final glyphCount = $.Int$.Ref1();
final glyphs = _flat.LoadFontData(
$.UnsignedChar$.Array(fileData),
fileData.length,
fontSize.toInt(),
codepoints == null ? MemoryPointer.nullptr() : $.Int$.Array(codepoints).cast(),
codepointCount?.toInt() ?? codepoints?.length ?? 0,
type.value,
glyphCount,
);
final requestedCount = (codepointCount == null || codepointCount == 0)
? codepoints?.length ?? glyphCount.value
: codepointCount.toInt();
return glyphs.readArray(requestedCount);
},
);