Skip to content

Commit

Permalink
Add support for bigger font sizes
Browse files Browse the repository at this point in the history
  • Loading branch information
zobbe committed May 24, 2022
1 parent b79bf91 commit 9a344e3
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ public class EscPosPrinterCommands {
public static final byte[] TEXT_SIZE_DOUBLE_HEIGHT = new byte[]{0x1D, 0x21, 0x01};
public static final byte[] TEXT_SIZE_DOUBLE_WIDTH = new byte[]{0x1D, 0x21, 0x10};
public static final byte[] TEXT_SIZE_BIG = new byte[]{0x1D, 0x21, 0x11};
public static final byte[] TEXT_SIZE_BIG_2 = new byte[]{0x1D, 0x21, 0x22};
public static final byte[] TEXT_SIZE_BIG_3 = new byte[]{0x1D, 0x21, 0x33};
public static final byte[] TEXT_SIZE_BIG_4 = new byte[]{0x1D, 0x21, 0x44};
public static final byte[] TEXT_SIZE_BIG_5 = new byte[]{0x1D, 0x21, 0x55};
public static final byte[] TEXT_SIZE_BIG_6 = new byte[]{0x1D, 0x21, 0x66};

public static final byte[] TEXT_UNDERLINE_OFF = new byte[]{0x1B, 0x2D, 0x00};
public static final byte[] TEXT_UNDERLINE_ON = new byte[]{0x1B, 0x2D, 0x01};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ public class PrinterTextParser {

public static final String ATTR_FORMAT_TEXT_FONT_SIZE = "size";
public static final String ATTR_FORMAT_TEXT_FONT_SIZE_BIG = "big";
public static final String ATTR_FORMAT_TEXT_FONT_SIZE_BIG_2 = "big-2";
public static final String ATTR_FORMAT_TEXT_FONT_SIZE_BIG_3 = "big-3";
public static final String ATTR_FORMAT_TEXT_FONT_SIZE_BIG_4 = "big-4";
public static final String ATTR_FORMAT_TEXT_FONT_SIZE_BIG_5 = "big-5";
public static final String ATTR_FORMAT_TEXT_FONT_SIZE_BIG_6 = "big-6";
public static final String ATTR_FORMAT_TEXT_FONT_SIZE_TALL = "tall";
public static final String ATTR_FORMAT_TEXT_FONT_SIZE_WIDE = "wide";
public static final String ATTR_FORMAT_TEXT_FONT_SIZE_NORMAL = "normal";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,21 @@ public PrinterTextParserColumn(PrinterTextParserLine textParserLine, String text
case PrinterTextParser.ATTR_FORMAT_TEXT_FONT_SIZE_BIG:
textParser.addTextSize(EscPosPrinterCommands.TEXT_SIZE_BIG);
break;
case PrinterTextParser.ATTR_FORMAT_TEXT_FONT_SIZE_BIG_2:
textParser.addTextSize(EscPosPrinterCommands.TEXT_SIZE_BIG_2);
break;
case PrinterTextParser.ATTR_FORMAT_TEXT_FONT_SIZE_BIG_3:
textParser.addTextSize(EscPosPrinterCommands.TEXT_SIZE_BIG_3);
break;
case PrinterTextParser.ATTR_FORMAT_TEXT_FONT_SIZE_BIG_4:
textParser.addTextSize(EscPosPrinterCommands.TEXT_SIZE_BIG_4);
break;
case PrinterTextParser.ATTR_FORMAT_TEXT_FONT_SIZE_BIG_5:
textParser.addTextSize(EscPosPrinterCommands.TEXT_SIZE_BIG_5);
break;
case PrinterTextParser.ATTR_FORMAT_TEXT_FONT_SIZE_BIG_6:
textParser.addTextSize(EscPosPrinterCommands.TEXT_SIZE_BIG_6);
break;
}
} else {
textParser.addTextSize(textParser.getLastTextSize());
Expand Down

0 comments on commit 9a344e3

Please sign in to comment.