textEncoded method

List<int> textEncoded(
  1. Uint8List textBytes, {
  2. PosStyles styles = const PosStyles(),
  3. int linesAfter = 0,
  4. int? maxCharsPerLine,
})

Implementation

List<int> textEncoded(
  Uint8List textBytes, {
  PosStyles styles = const PosStyles(),
  int linesAfter = 0,
  int? maxCharsPerLine,
}) {
  List<int> bytes = [];
  bytes += _text(textBytes, styles: styles, maxCharsPerLine: maxCharsPerLine);
  // Ensure at least one line break after the text
  bytes += emptyLines(linesAfter + 1);
  return bytes;
}