修正addHR文字大小問題

This commit is contained in:
Jay
2017-09-03 10:34:04 +08:00
parent 41d7a1c4a3
commit 2197e6ab98
4 changed files with 17 additions and 5 deletions
@@ -59,6 +59,8 @@ public class PrinterBle {
final public static int ALIGN_RIGHT = 0x02;
private int lastAlign = 0x00;
private int lastWidth = 1;
private int lastHeigh = 1;
// 藍芽狀態
public int mState = 0x00;
@@ -412,20 +414,29 @@ public class PrinterBle {
public PrinterBle setSize(int w, int h) {
if (w < 1 || h < 1 || w > 3 || h > 3) return this;
lastWidth = w;
lastHeigh = h;
return addText(String.format("__&s%d,%d__", w, h));
}
public PrinterBle addHR() {
int align = this.lastAlign;
int w = lastWidth;
int h = lastHeigh;
setAlign(ALIGN_CENTER);
resetSize();
textNewLine();
addTextln(StringUtils.repeat('-', 20));
setAlign(align);
setSize(w, h);
return this;
}
public void resetSize() {
public PrinterBle resetSize() {
lastHeigh = 1;
lastWidth = 1;
setSize(1, 1);
return this;
}
public ArrayList<String> getDataQueue() {