PdfBundledFont class

A font offered in the font menu without a file picker, its bytes loaded lazily on pick (loadBundledFont).

By default the bytes come from an assetKey in the asset bundle, but a host can instead supply raw loadBytes (application-provided fonts, or fonts read from a source Flutter's asset bundle can't reach) - either way the outlines embed into the document so the text renders everywhere.

Constructors

PdfBundledFont(String label, String assetKey, {String? package, Future<Uint8List> loadBytes()?})
const

Properties

assetKey String
The asset bundle key (e.g. packages/dart_pdf_editor_assets/assets/fonts/DejaVuSans.ttf). Used to load the bytes when loadBytes is null, and as this entry's cache key.
final
hashCode int
The hash code for this object.
no setterinherited
label String
The name shown in the font menu.
final
loadBytes Future<Uint8List> Function()?
An optional loader for the font's program bytes, overriding assetKey. Lets an app provide font bytes directly instead of declaring an asset.
final
package String?
The package whose fonts: declaration registers this face with the engine for the menu-row preview (e.g. dart_pdf_editor_assets). Null when the face is not a package asset, in which case the row previews in the menu's default face (the bytes still embed on pick).
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited