LoadFontData method

List<GlyphInfoD> LoadFontData(
  1. List<int> fileData,
  2. num fontSize,
  3. List<int>? codepoints,
  4. num? codepointCount,
  5. FontType type,
)

Implementation

List<GlyphInfoD> LoadFontData(
  List<int> fileData,
  num fontSize,
  List<int>? codepoints,
  num? codepointCount,
  FontType type,
) => run(
  () => 'LoadFontData(fileData: ${fileData.length}, $fontSize, codepoints: ${codepoints?.length}, $type)',
  () {
    // final glyphCount = _int1();
    final glyphs = rl.Core.LoadFontData(
      refListUChars(fileData),
      fileData.length,
      fontSize.toInt(),
      codepoints == null ? nullptr : refListInt(codepoints),
      codepointCount?.toInt() ?? codepoints?.length ?? 0,
      type.value,
      // glyphCount,
    );
    final requestedCount = (codepointCount == null || codepointCount == 0)
      // ? codepoints?.length ?? glyphCount.value
      ? codepoints?.length ?? 95
      : codepointCount.toInt();
    return List.generate(requestedCount, (i) => (glyphs + i).toD());
  },
);