add Zeile and Teilung format commands
This commit is contained in:
parent
abfa240411
commit
57bb6a18b3
3 changed files with 31 additions and 8 deletions
|
@ -332,7 +332,7 @@ void sendChar(char c,char c2) { //c2 =0 for 1 byte characters
|
|||
#endif
|
||||
keypress[0]=64; keypress[2]=16; //ALT + ArrowDown(Top Right Key)
|
||||
//TODO: count 3 hammer strokes for every bold written character, additional count_bufferedchars+=2
|
||||
}else if (c==117) { //u.
|
||||
}else if (c==117) { //u
|
||||
#ifdef DEBUG
|
||||
Serial1.println("Format: Underline"); //echo
|
||||
#endif
|
||||
|
@ -349,6 +349,18 @@ void sendChar(char c,char c2) { //c2 =0 for 1 byte characters
|
|||
Serial1.println("Format: Move Up"); //echo
|
||||
#endif
|
||||
keypress[1]=32; keypress[2]=16; //CODE + ArrowDown(Top Right Key)
|
||||
}else if (c==116) { //t
|
||||
#ifdef DEBUG
|
||||
Serial1.println("Format: Teilung"); //echo
|
||||
#endif
|
||||
keypress[0]=64; keypress[8]=32; //ALT + 2
|
||||
//Changing Teilung cylces through: 10, 12, 15
|
||||
}else if (c==122) { //z
|
||||
#ifdef DEBUG
|
||||
Serial1.println("Format: Zeile"); //echo
|
||||
#endif
|
||||
keypress[0]=64; keypress[7]=64; //ALT + 1
|
||||
//Changing Zeile cylces through: 1, 1 1/2, 2
|
||||
}
|
||||
waitFormatChar=false;
|
||||
keyimplemented=false; //do not count as printed key
|
||||
|
@ -390,7 +402,7 @@ void sendChar(char c,char c2) { //c2 =0 for 1 byte characters
|
|||
Serial1.println("Waiting for Format Char"); //echo
|
||||
#endif
|
||||
return; //stop function, do not print anything
|
||||
}else{
|
||||
}else{ //character is not available on printer
|
||||
keypress[1]=128; // [SPACE] //print space to keep text aligned
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
Nor
|
||||
\uUnderline\u\u
|
||||
\bBold\b
|
||||
\k\k\k\k\k\k mal
|
||||
\j\j\j\j
|
||||
Nor
|
||||
\uUnderline\u\u
|
||||
\bBold\b
|
||||
\k\k\k\k\k\k mal
|
||||
\j\j\j\j
|
||||
Teilung 10
|
||||
\tTeilung 12
|
||||
\tTeilung 15\t
|
||||
Zeile1\z
|
||||
Zeile1 1/2\z
|
||||
Zeile 2\z
|
||||
|
|
|
@ -4,6 +4,11 @@ import codecs
|
|||
|
||||
import argparse
|
||||
|
||||
# For Formatting to work as expected, set Printer to following default settings:
|
||||
# Zeile Teilung ___ MODUS S.ENDE
|
||||
# 1 10
|
||||
# Zeile=1, Teilung=10, Not Bold, Not Underlined
|
||||
|
||||
|
||||
serialdevice='/dev/ttyUSB0'
|
||||
|
||||
|
@ -54,7 +59,7 @@ def main():
|
|||
for iline,line in enumerate(lines):
|
||||
if not set(line).issubset(chars+'\\'):
|
||||
print(str(iline)+":"+str(line))
|
||||
print("Contains non printable characters")
|
||||
print("Contains non printale characters")
|
||||
exit()
|
||||
if len(line)>charsperline:
|
||||
print(str(iline)+":"+str(line))
|
||||
|
|
Loading…
Add table
Reference in a new issue