name property

String name

Gets the font name.

//Create a new PDF document.
PdfDocument document = PdfDocument();
//Create a new PDF font instance.
PdfFont font = PdfStandardFont(PdfFontFamily.helvetica, 12);
//Draw string to PDF page.
document.pages.add().graphics.drawString(
    'Font Name: ${font.name}\nFont Size: ${font.size}\nFont Height: ${font.height}\nFont Style: ${font.style}',
    font);
//Save the document.
List<int> bytes = await document.save();
//Close the document.
document.dispose();

Implementation

String get name => _helper.metrics!.name;