drawString method Null safety

void drawString(
  1. PdfFont font,
  2. double size,
  3. String s,
  4. double x,
  5. double y,
  6. {double charSpace = 0,
  7. double wordSpace = 0,
  8. double scale = 1,
  9. PdfTextRenderingMode mode = PdfTextRenderingMode.fill,
  10. double rise = 0}
)

This draws a string.

Implementation

void drawString(
  PdfFont font,
  double size,
  String s,
  double x,
  double y, {
  double charSpace = 0,
  double wordSpace = 0,
  double scale = 1,
  PdfTextRenderingMode mode = PdfTextRenderingMode.fill,
  double rise = 0,
}) {
  _page.addFont(font);

  _buf.putString('BT ');
  PdfNumList([x, y]).output(_buf);
  _buf.putString(' Td ');
  setFont(font, size,
      charSpace: charSpace,
      mode: mode,
      rise: rise,
      scale: scale,
      wordSpace: wordSpace);
  _buf.putString('[');
  font.putText(_buf, s);
  _buf.putString(']TJ ET\n');
}