cuu 56e45b58fd remove debug output of thermal_printer | před 2 roky | |
---|---|---|
.. | ||
etc | před 2 roky | |
usr | před 2 roky | |
.gitignore | před 2 roky | |
Makefile | před 2 roky | |
NotoSansCJK-Regular.ttf | před 2 roky | |
README.md | před 2 roky | |
config.h | před 2 roky | |
devterm_thermal_printer.c | před 2 roky | |
ftype.c | před 2 roky | |
ftype.h | před 2 roky | |
logo.h | před 3 roky | |
pcf_5x7-ISO8859-1_5x7.h | před 3 roky | |
pcf_6x12-ISO8859-1_6x12.h | před 3 roky | |
pcf_7x14-ISO8859-1_7x14.h | před 3 roky | |
printer.c | před 2 roky | |
printer.h | před 2 roky | |
test.txt | před 2 roky | |
ttf_Px437_PS2thin1_8x16.h | před 3 roky | |
ttf_Px437_PS2thin2_8x16.h | před 3 roky | |
utf8-utils.c | před 2 roky | |
utf8-utils.h | před 2 roky | |
utils.c | před 2 roky | |
utils.h | před 2 roky |
echo "Hello DevTerm" > /tmp/DEVTERM_PRINTER_IN
echo -e "Hello DevTerm\n\n\n\n\n\n" > /tmp/DEVTERM_PRINTER_IN
cat file.txt > /tmp/DEVTERM_PRINTER_IN
ncal -hb | tee > /tmp/DEVTERM_PRINTER_IN
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
n:0-F, set printer printing density
echo -en "\x12\x23\x8" > /tmp/DEVTERM_PRINTER_IN
print the test page
echo -en "\x12\x54" > /tmp/DEVTERM_PRINTER_IN
Edit /usr/local/etc/devterm-printer
,point to an existed ttf file,eg:
TTF=/usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc
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,
then
echo "鉴于对人类家庭所有成员的固有尊严及其平等的和不移的权利的承认,乃是世界自由、正义与和平的基础" > /tmp/DEVTERM_PRINTER_IN
to print unicode characters
echo -en "\x1b\x56\x0" >/tmp/DEVTERM_PRINTER_IN
disable rotation
echo -en "\x1b\x56\x1" >/tmp/DEVTERM_PRINTER_IN
90 degree
echo -en "\x1b\x56\x2" >/tmp/DEVTERM_PRINTER_IN
180 degree
echo -en "\x1b\x56\x3" >/tmp/DEVTERM_PRINTER_IN
270 degree