Commit b8b6c9aa authored by Andrey's avatar Andrey

Kanji commands

parent 799e4de3
...@@ -33,7 +33,8 @@ const cFontB = '${esc}M1'; // Font B ...@@ -33,7 +33,8 @@ const cFontB = '${esc}M1'; // Font B
const cTurn90On = '${esc}V1'; // Turn 90° clockwise rotation mode on const cTurn90On = '${esc}V1'; // Turn 90° clockwise rotation mode on
const cTurn90Off = '${esc}V0'; // Turn 90° clockwise rotation mode off const cTurn90Off = '${esc}V0'; // Turn 90° clockwise rotation mode off
const cCodeTable = '${esc}t'; // Select character code table [N] const cCodeTable = '${esc}t'; // Select character code table [N]
const cKanjiCancel = '$fs.'; // Cancel Kanji character mode const cKanjiOn = '$fs&'; // Select Kanji character mode
const cKanjiOff = '$fs.'; // Cancel Kanji character mode
// Print Position // Print Position
const cAlignLeft = '${esc}a0'; // Left justification const cAlignLeft = '${esc}a0'; // Left justification
...@@ -50,7 +51,8 @@ const cRasterImg = '${gs}v0'; // Print raster bit image [obsolete command] ...@@ -50,7 +51,8 @@ const cRasterImg = '${gs}v0'; // Print raster bit image [obsolete command]
const cBitImg = '$esc*'; // Set bit image mode const cBitImg = '$esc*'; // Set bit image mode
// Barcode // Barcode
const cBarcodeSelectPos = '${gs}H'; // Select print position of HRI characters [N] const cBarcodeSelectPos =
'${gs}H'; // Select print position of HRI characters [N]
const cBarcodeSelectFont = '${gs}f'; // Select font for HRI characters [N] const cBarcodeSelectFont = '${gs}f'; // Select font for HRI characters [N]
const cBarcodeSetH = '${gs}h'; // Set barcode height [N] const cBarcodeSetH = '${gs}h'; // Set barcode height [N]
const cBarcodeSetW = '${gs}w'; // Set barcode width [N] const cBarcodeSetW = '${gs}w'; // Set barcode width [N]
......
...@@ -115,7 +115,9 @@ class Printer { ...@@ -115,7 +115,9 @@ class Printer {
// Cancel Kanji mode // Cancel Kanji mode
if (cancelKanji) { if (cancelKanji) {
_socket.write(cKanjiCancel); _socket.write(cKanjiOff);
} else {
_socket.write(cKanjiOn);
} }
// Set local code table // Set local code table
...@@ -137,7 +139,7 @@ class Printer { ...@@ -137,7 +139,7 @@ class Printer {
/// Sens raw command(s) /// Sens raw command(s)
void sendRaw(List<int> cmd, {bool cancelKanji = true}) { void sendRaw(List<int> cmd, {bool cancelKanji = true}) {
if (cancelKanji) { if (cancelKanji) {
_socket.write(cKanjiCancel); _socket.write(cKanjiOff);
} }
_socket.add(Uint8List.fromList(cmd)); _socket.add(Uint8List.fromList(cmd));
} }
...@@ -165,7 +167,7 @@ class Printer { ...@@ -165,7 +167,7 @@ class Printer {
/// If [codeTable] is null, global code table is used. /// If [codeTable] is null, global code table is used.
/// If global code table is null, default printer code table is used. /// If global code table is null, default printer code table is used.
void printCodeTable({PosCodeTable codeTable}) { void printCodeTable({PosCodeTable codeTable}) {
_socket.write(cKanjiCancel); _socket.write(cKanjiOff);
if (codeTable != null) { if (codeTable != null) {
_socket.add( _socket.add(
......
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