setFont method
void
setFont(})
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,
}) {
assert(() {
if (_page.pdfDocument.verbose) {
_buf.putComment('setFont');
}
return true;
}());
_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');
}
}