load static method

void load(
  1. String family,
  2. Uint8List bytes, {
  3. FontWeight weight = FontWeight.normal,
  4. FontStyle style = FontStyle.normal,
})

Registers a font from raw bytes.

family is the font family name used in TextStyle.fontFamily and ParagraphStyle.fontFamily.

bytes must be a valid TTF or OTF font file.

Use weight and style to register multiple variants of the same family.

Implementation

static void load(
  String family,
  Uint8List bytes, {
  FontWeight weight = FontWeight.normal,
  FontStyle style = FontStyle.normal,
}) {
  _registry.putIfAbsent(family, () => {})[_FontKey(weight, style)] = bytes;
}