Open ttyniwa opened 3 years ago
Please merge #62 first.
The following code will be printed across two lines due to wrong alignment.
bytes += ticket.row([ PosColumn( text: 'R右R', width: 12, styles: PosStyles(align: PosAlign.right), containsCjk: true),
The receipt on the right is before the bug was fixed. left is after the bug fixed.
Tested with below code.
Future<List<int>> debugCjk(PaperSize paper, CapabilityProfile profile) async { final Generator ticket = Generator(paper, profile); List<int> bytes = []; bytes += ticket.text( '漢字ひらがなカタカナ', styles: PosStyles( align: PosAlign.center, height: PosTextSize.size2, width: PosTextSize.size2, ), containsCjk: true, ); bytes += ticket.text( 'L左L', styles: PosStyles(align: PosAlign.left), containsCjk: true, ); bytes += ticket.text( 'C中央C', styles: PosStyles(align: PosAlign.center), containsCjk: true, ); bytes += ticket.text( 'R右R', styles: PosStyles(align: PosAlign.right), containsCjk: true, ); bytes += ticket.row([ PosColumn( text: 'L左L', width: 4, styles: PosStyles(align: PosAlign.left), containsCjk: true), PosColumn( text: 'L左L', width: 4, styles: PosStyles(align: PosAlign.left), containsCjk: true), PosColumn( text: 'L左L', width: 4, styles: PosStyles(align: PosAlign.left), containsCjk: true), ]); bytes += ticket.row([ PosColumn( text: 'C中央C', width: 4, styles: PosStyles(align: PosAlign.center), containsCjk: true), PosColumn( text: 'C中央C', width: 4, styles: PosStyles(align: PosAlign.center), containsCjk: true), PosColumn( text: 'C中央C', width: 4, styles: PosStyles(align: PosAlign.center), containsCjk: true), ]); bytes += ticket.row([ PosColumn( text: 'R右R', width: 4, styles: PosStyles(align: PosAlign.right), containsCjk: true), PosColumn( text: 'R右R', width: 4, styles: PosStyles(align: PosAlign.right), containsCjk: true), PosColumn( text: 'R右R', width: 4, styles: PosStyles(align: PosAlign.right), containsCjk: true), ]); bytes += ticket.row([ PosColumn( text: 'left', width: 4, styles: PosStyles(align: PosAlign.left)), PosColumn( text: 'left', width: 4, styles: PosStyles(align: PosAlign.left)), PosColumn( text: 'left', width: 4, styles: PosStyles(align: PosAlign.left)), ]); bytes += ticket.row([ PosColumn( text: 'center', width: 4, styles: PosStyles(align: PosAlign.center)), PosColumn( text: 'center', width: 4, styles: PosStyles(align: PosAlign.center)), PosColumn( text: 'center', width: 4, styles: PosStyles(align: PosAlign.center)), ]); bytes += ticket.row([ PosColumn( text: 'right', width: 4, styles: PosStyles(align: PosAlign.right)), PosColumn( text: 'right', width: 4, styles: PosStyles(align: PosAlign.right)), PosColumn( text: 'right', width: 4, styles: PosStyles(align: PosAlign.right)), ]); ticket.feed(1); ticket.cut(); return bytes; }
@andrey-ushakov Could you merge #62 & #63 and release?
Please merge #62 first.
Overview
The following code will be printed across two lines due to wrong alignment.
Test
The receipt on the right is before the bug was fixed. left is after the bug fixed.
Tested with below code.