loadFontBufferAsync method
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();
},
);
}