Skip to content

Commit 074a6ff

Browse files
* changes
1 parent bee2ae5 commit 074a6ff

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

lib/src/generator.dart

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import 'package:hex/hex.dart';
1212
import 'package:image/image.dart';
1313
import 'package:gbk_codec/gbk_codec.dart';
1414
import 'package:esc_pos_utils/esc_pos_utils.dart';
15-
import 'enums.dart';
1615
import 'commands.dart';
1716

1817
class Generator {
@@ -485,11 +484,11 @@ class Generator {
485484
_colIndToPosition(colInd + cols[i].width) - spaceBetweenRows;
486485
int maxCharactersNb = ((toPos - fromPos) / charWidth).floor();
487486

488-
if (!cols[i].containsChinese) {
487+
if (true) {
489488
// CASE 1: containsChinese = false
490489
Uint8List encodedToPrint = cols[i].textEncoded != null
491490
? cols[i].textEncoded!
492-
: _encode(cols[i].text);
491+
: _encode(cols[i].text, isKanji: true);
493492

494493
// If the col's content is too long, split it to the next row
495494
int realCharactersNb = encodedToPrint.length;
@@ -516,6 +515,7 @@ class Generator {
516515
isNextRow = true;
517516
nextRow.add(PosColumn(
518517
textEncoded: encodedToPrintNextRow,
518+
containsChinese: true,
519519
width: cols[i].width,
520520
styles: cols[i].styles));
521521
} else {
@@ -524,12 +524,11 @@ class Generator {
524524
text: '', width: cols[i].width, styles: cols[i].styles));
525525
}
526526
// end rows splitting
527-
bytes += _text(
528-
encodedToPrint,
529-
styles: cols[i].styles,
530-
colInd: colInd,
531-
colWidth: cols[i].width,
532-
);
527+
bytes += _text(encodedToPrint,
528+
styles: cols[i].styles,
529+
colInd: colInd,
530+
colWidth: cols[i].width,
531+
isKanji: true);
533532
} else {
534533
// CASE 1: containsChinese = true
535534
// Split text into multiple lines if it too long

0 commit comments

Comments
 (0)