PdfTrueTypeFont class Null safety

Represents TrueType font.

//Create a new PDF document.
PdfDocument document = PdfDocument();
//Create a new PDF true type font instance and draw string to PDF page.
document.pages.add().graphics.drawString(
    'Hello World!',
    PdfTrueTypeFont(fontStream, 12),
    brush: PdfBrushes.black,
    bounds: Rect.fromLTWH(0, 0, 100, 50));
//Saves the document.
List<int> bytes = document.save();
//Dispose the document.
document.dispose();
Inheritance

Constructors

PdfTrueTypeFont(List<int> fontData, double size, {PdfFontStyle? style, List<PdfFontStyle>? multiStyle})
Initializes a new instance of the PdfTrueTypeFont class. [...]
PdfTrueTypeFont.fromBase64String(String fontData, double size, {PdfFontStyle? style, List<PdfFontStyle>? multiStyle})
Initializes a new instance of the PdfTrueTypeFont class. [...]

Properties

hashCode int
The hash code for this object. [...]
read-only, inherited
height double
Gets the height of the font in points. [...]
read-only, inherited
name String
Gets the font name. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
size double
Gets the font size. [...]
read-only, inherited
style PdfFontStyle
Gets style of the font. [...]
read-only, inherited

Methods

measureString(String text, {Size? layoutArea, PdfStringFormat? format}) Size
Measures a string by using this font. [...]
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
A string representation of this object. [...]
inherited

Operators

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