Commit cc3d4399 authored by Andrey's avatar Andrey

set code table

parent 82dd0b8b
...@@ -21,6 +21,7 @@ class Printer { ...@@ -21,6 +21,7 @@ class Printer {
} }
final Socket _socket; final Socket _socket;
PosCodeTable _codeTable = PosCodeTable.pc437;
/// Creates a new socket connection to the network printer. /// Creates a new socket connection to the network printer.
/// ///
...@@ -41,6 +42,15 @@ class Printer { ...@@ -41,6 +42,15 @@ class Printer {
_socket.destroy(); _socket.destroy();
} }
void setCodeTable(PosCodeTable codeTable) {
_codeTable = codeTable;
_socket.add(
Uint8List.fromList(
List.from(cCodeTable.codeUnits)..add(codeTable.value),
),
);
}
/// Generic print for internal use /// Generic print for internal use
/// ///
/// [colInd] range: 0..11 /// [colInd] range: 0..11
...@@ -136,6 +146,7 @@ class Printer { ...@@ -136,6 +146,7 @@ class Printer {
/// Clear the buffer and reset text styles /// Clear the buffer and reset text styles
void reset() { void reset() {
_socket.write(cInit); _socket.write(cInit);
setCodeTable(_codeTable);
} }
/// Skips [n] lines /// Skips [n] lines
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment