loadFontBufferAsync method

Future<void> loadFontBufferAsync(
  1. Uint8List buffer,
  2. int idx
)

async version of loadFontBuffer

Implementation

Future<void> loadFontBufferAsync(Uint8List buffer, int idx) async {
  final cbuffer = malloc<ffi.Uint8>(buffer.length);
  cbuffer.asTypedList(buffer.length).setAll(0, buffer);
  await cvRunAsync0(
    (callback) => ccontrib.cv_freetype_FreeType2_loadFontData_buf(
      ref,
      cbuffer.cast<ffi.Char>(),
      buffer.length,
      idx,
      callback,
    ),
    (c) {
      malloc.free(cbuffer);
      c.complete();
    },
  );
}