PdfStandardFont constructor Null safety

PdfStandardFont(
  1. PdfFontFamily fontFamily,
  2. double size,
  3. {PdfFontStyle? style,
  4. List<PdfFontStyle>? multiStyle}
)

Initializes a new instance of the PdfStandardFont class with font family, size and font style.

//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 = document.save();
//Close the document.
document.dispose();

Implementation

PdfStandardFont(PdfFontFamily fontFamily, double size,
    {PdfFontStyle? style, List<PdfFontStyle>? multiStyle}) {
  _initialize(size, style: style, multiStyle: multiStyle);
  _fontFamily = fontFamily;
  _checkStyle();
  _initializeInternals();
}