fontFromAssetBundle function
Future<TtfFont>
fontFromAssetBundle(
- String key, {
- AssetBundle? bundle,
- bool cache = true,
- PdfBaseCache? pdfCache,
- bool protect = false,
Loads a font from an asset bundle key. If used multiple times with the same font name, it will be included multiple times in the pdf file
Implementation
Future<TtfFont> fontFromAssetBundle(
String key, {
AssetBundle? bundle,
bool cache = true,
PdfBaseCache? pdfCache,
bool protect = false,
}) async {
bundle ??= rootBundle;
final bytes = await bundle.load(key);
return TtfFont(bytes, protect: protect);
}