printCodeTable method

List<int> printCodeTable({
  1. String? codeTable,
})

Print selected code table.

If codeTable is null, global code table is used. If global code table is null, default printer code table is used.

Implementation

List<int> printCodeTable({String? codeTable}) {
  List<int> bytes = [];
  bytes += cKanjiOff.codeUnits;

  if (codeTable != null) {
    bytes += Uint8List.fromList(
      List.from(cCodeTable.codeUnits)..add(_profile.getCodePageId(codeTable)),
    );
  }

  bytes += Uint8List.fromList(List<int>.generate(256, (i) => i));

  // Back to initial code table
  setGlobalCodeTable(_codeTable);
  return bytes;
}