PdfStandardFont class
Represents one of the 14 standard PDF fonts. It's used to create a standard PDF font to draw the text in to the PDF
//Create a new PDF document.
PdfDocument document = PdfDocument()
..pages.add().graphics.drawString(
'Hello World!', PdfStandardFont(PdfFontFamily.helvetica, 12),
brush: PdfBrushes.black);
//Save the document.
List<int> bytes = await document.save();
//Close the document.
document.dispose();
Constructors
-
PdfStandardFont(PdfFontFamily fontFamily, double size, {PdfFontStyle? style, List<
PdfFontStyle> ? multiStyle}) - Initializes a new instance of the PdfStandardFont class with font family, size and font style.
-
PdfStandardFont.prototype(PdfStandardFont prototype, double size, {PdfFontStyle? style, List<
PdfFontStyle> ? multiStyle}) - Initializes a new instance of the PdfStandardFont class with PdfStandardFont as prototype, size and font style.
Properties
- fontFamily → PdfFontFamily
-
Gets the font family.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- height → double
-
Gets the height of the font in points.
no setterinherited
- name → String
-
Gets the font name.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- size → double
-
Gets the font size.
no setterinherited
- style → PdfFontStyle
-
Gets style of the font.
no setterinherited
Methods
-
measureString(
String text, {Size? layoutArea, PdfStringFormat? format}) → Size -
Measures a string by using this font.
inherited
-
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