setFont method Null safety

void setFont(
  1. PdfFont font,
  2. double size,
  3. {double? charSpace,
  4. double? wordSpace,
  5. double? scale,
  6. PdfTextRenderingMode? mode = PdfTextRenderingMode.fill,
  7. double? rise}
)

Set the current font and size

Implementation

void setFont(
  PdfFont font,
  double size, {
  double? charSpace,
  double? wordSpace,
  double? scale,
  PdfTextRenderingMode? mode = PdfTextRenderingMode.fill,
  double? rise,
}) {
  _buf.putString('${font.name} ');
  PdfNum(size).output(_buf);
  _buf.putString(' Tf\n');
  if (charSpace != null) {
    PdfNum(charSpace).output(_buf);
    _buf.putString(' Tc\n');
  }
  if (wordSpace != null) {
    PdfNum(wordSpace).output(_buf);
    _buf.putString(' Tw\n');
  }
  if (scale != null) {
    PdfNum(scale * 100).output(_buf);
    _buf.putString(' Tz\n');
  }
  if (rise != null) {
    PdfNum(rise).output(_buf);
    _buf.putString(' Ts\n');
  }
  if (mode != PdfTextRenderingMode.fill) {
    _buf.putString('${mode!.index} Tr\n');
  }
}