loadFontFromList function

Future<void> loadFontFromList(
  1. Uint8List list, {
  2. String? fontFamily,
})

Loads a font from a buffer and makes it available for rendering text.

  • list: A list of bytes containing the font file.
  • fontFamily: The family name used to identify the font in text styles. If this is not provided, then the family name will be extracted from the font file.

Implementation

Future<void> loadFontFromList(Uint8List list, {String? fontFamily}) {
  return _futurize(
    (_Callback<void> callback) {
      _loadFontFromList(list, callback, fontFamily ?? '');
      return null;
    }
  ).then((_) => _sendFontChangeMessage());
}