diff --git a/Code/thermal_printer/README.md b/Code/thermal_printer/README.md index 6a8ec9f..6b1bb7e 100644 --- a/Code/thermal_printer/README.md +++ b/Code/thermal_printer/README.md @@ -16,11 +16,28 @@ #### ESC ! n set printer font index,n:0-4 -`echo -en "\x1b\x21\x0" > /tmp/DEVTERM_PRINTER_IN` -`echo -en "\x1b\x21\x1" > /tmp/DEVTERM_PRINTER_IN` -`echo -en "\x1b\x21\x2" > /tmp/DEVTERM_PRINTER_IN` -`echo -en "\x1b\x21\x3" > /tmp/DEVTERM_PRINTER_IN` -`echo -en "\x1b\x21\x4" > /tmp/DEVTERM_PRINTER_IN` +`echo -en "\x1d\x21\x0" > /tmp/DEVTERM_PRINTER_IN` +`echo -en "\x1d\x21\x1" > /tmp/DEVTERM_PRINTER_IN` +`echo -en "\x1d\x21\x2" > /tmp/DEVTERM_PRINTER_IN` +`echo -en "\x1d\x21\x3" > /tmp/DEVTERM_PRINTER_IN` +`echo -en "\x1d\x21\x4" > /tmp/DEVTERM_PRINTER_IN` + +##### ascii font size +1. 0 = 8x16 +1. 1 = 5x7 +1. 2 = 6x12 +1. 3 = 7x14 +1. 4 = 8x16 + +##### unicode font size + +1. 0 = 12x12 +1. 1 = 14x14 +1. 2 = 16x16 +1. 3 = 18x18 +1. 4 = 20x20 + + https://github.com/clockworkpi/DevTerm/blob/81addc7f4ba1eb4acb2f59fb1fef70386dbe1f0d/Code/thermal_printer/devterm_thermal_printer.c#L381 @@ -42,15 +59,16 @@ then restart devterm-printer.service with ``` sudo systemctl restart devterm-printer ``` -devterm-printer daemon will auto detect if the ttf file existed,if exists, devterm-printer will use the ttf as default font -if ttf file not existed, devterm-printer will fallback to ascii mode - -use above set printer font index,n:0-4 command to set font size, -1. 0 = 12x12 -1. 1 = 14x14 -1. 2 = 16x16 -1. 3 = 18x18 -1. 4 = 20x20 +devterm-printer daemon will auto detect the ttf font file + +#### switch to UNICODE MODE +``` +echo -en "\x1b\x21\x1" > /tmp/DEVTERM_PRINTER_IN +``` +#### switch back to default ASCII mode +``` +echo -en "\x1b\x21\x0" > /tmp/DEVTERM_PRINTER_IN +``` then