loadFromFile static method
void
loadFromFile(
- String family,
- String filePath, {
- FontWeight weight = FontWeight.normal,
- FontStyle style = FontStyle.normal,
Registers a font from a file path.
Reads the file synchronously. Throws if the file does not exist or is not a valid font file.
Implementation
static void loadFromFile(
String family,
String filePath, {
FontWeight weight = FontWeight.normal,
FontStyle style = FontStyle.normal,
}) {
final bytes = File(filePath).readAsBytesSync();
load(family, bytes, weight: weight, style: style);
}