Rework capabilities format based on Mike's ideas.

This commit is contained in:
Michael Elsdörfer 2016-08-27 12:17:35 +02:00
parent 3fd1a3de5d
commit 216184f43f
1 changed files with 234 additions and 189 deletions

View File

@ -1,207 +1,252 @@
# Description of the format
abstract:
# Defines non-standard code pages that the printer supports, but
# that we won't find in Python's encoding system. If you define one
# here, don't forget to add it to codePageMap to assign it to a slot.
customCodePages:
sample:
# This maps the indexed code page slots to code page names.
# Often, the slot assignment is the same, but the device only
# supports a subset.
codePageMap:
0: "CP437"
1: "CP932"
3: "sample"
# Maybe not all of the codepages in the map are supported. This
# is for subprofiles to select which ones the device knows.
codePages: [sample, cp932]
# Define code pages that implementors are likely not to find in iconv etc.
codepages:
blank: [
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
]
TCVN-3-1: [
" ",
" ",
" ăâêôơưđ ",
" àảãáạ ằẳẵắ ",
" ặầẩẫấậè ẻẽ",
"éẹềểễếệìỉ ĩíịò",
" ỏõóọồổỗốộờởỡớợù",
" ủũúụừửữứựỳỷỹýỵ ",
]
TCVN-3-2: [
" ",
" ",
" ĂÂ Ð ÊÔƠƯ ",
" ÀẢÃÁẠ ẰẲẴẮ ",
" ẶẦẨẪẤẬÈ ẺẼ",
"ÉẸỀỂỄẾỆÌỈ ĨÍỊÒ",
" ỎÕÓỌỒỔỖỐỘỜỞỠỚỢÙ",
" ỦŨÚỤỪỬỮỨỰỲỶỸÝỴ "
]
# Many recent Epson-branded thermal receipt printers.
default:
columns: 42
barcodeB: true
bitImage: true
graphics: true
starCommands: false
qrCode: true
customCodePages:
TCVN-3-1: [
" ",
" ",
" ăâêôơưđ ",
" àảãáạ ằẳẵắ ",
" ặầẩẫấậè ẻẽ",
"éẹềểễếệìỉ ĩíịò",
" ỏõóọồổỗốộờởỡớợù",
" ủũúụừửữứựỳỷỹýỵ ",
]
TCVN-3-2: [
" ",
" ",
" ĂÂ Ð ÊÔƠƯ ",
" ÀẢÃÁẠ ẰẲẴẮ ",
" ẶẦẨẪẤẬÈ ẺẼ",
"ÉẸỀỂỄẾỆÌỈ ĨÍỊÒ",
" ỎÕÓỌỒỔỖỐỘỜỞỠỚỢÙ",
" ỦŨÚỤỪỬỮỨỰỲỶỸÝỴ "
]
commands:
LineFeed:
name: Line feed
FeedAndCut:
name: Feed and cut
SetAbsolutePrintPos:
name: Set absolute print position
GraphicsData:
name: Graphics data
# Commented-out slots are TODO (might just need uncomment, might
# need verification/research)
codePageMap:
0: "CP437"
1: "CP932"
2: "CP850"
3: "CP860"
4: "CP863"
5: "CP865"
#6: // Hiragana
#7: // One-pass printing Kanji characters
#8: // Page 8 [One-pass printing Kanji characters]
11: "CP851"
12: "CP853"
13: "CP857"
14: "CP737"
15: "ISO8859_7"
16: "CP1252"
17: "CP866"
18: "CP852"
19: "CP858"
#20: // Thai Character Code 42
#21: // Thai Character Code 1"
#22: // Thai Character Code 13
#23: // Thai Character Code 14
#24: // Thai Character Code 16
#25: // Thai Character Code 17
#26: // Thai Character Code 18
30: 'TCVN-3-1', # TCVN-3: Vietnamese
31: 'TCVN-3-2', # TCVN-3: Vietnamese
32: "CP720"
33: "CP775"
34: "CP855"
35: "CP861"
36: "CP862"
37: "CP864"
38: "CP869"
39: "ISO8859_2"
40: "ISO8859_15"
41: "CP1098"
42: "CP774"
43: "CP772"
44: "CP1125"
45: "CP1250"
46: "CP1251"
47: "CP1253"
48: "CP1254"
49: "CP1255"
50: "CP1256"
51: "CP1257"
52: "CP1258"
53: "RK1048"
#66: // Devanagari
#67: // Bengali
#68: // Tamil
#69: // Telugu
#70: // Assamese
#71: // Oriya
#72: // Kannada
#73: // Malayalam
#74: // Gujarati
#75: // Punjabi
#82: // Marathi
#254:
#255:
profiles:
default:
name: Default profile
description: Many recent Epson-branded thermal receipt printers
commands:
BarcodeB: true
BitImage: true
GraphicsData: true
QrCode: true
features:
starCommands: false
font:
0:
columns: 40
1:
columns: 50
colors:
- black
# Commented-out slots are TODO (might just need uncomment, might
# need verification/research)
codepages:
0: CP437
1: CP932
2: CP850
3: CP860
4: CP863
5: CP865
#6: // Hiragana
#7: // One-pass printing Kanji characters
#8: // Page 8 [One-pass printing Kanji characters]
11: CP851
12: CP853
13: CP857
14: CP737
15: ISO8859_7
16: CP1252
17: CP866
18: CP852
19: CP858
#20: // Thai Character Code 42
#21: // Thai Character Code 1
#22: // Thai Character Code 13
#23: // Thai Character Code 14
#24: // Thai Character Code 16
#25: // Thai Character Code 17
#26: // Thai Character Code 18
30: 'TCVN-3-1' # TCVN-3: Vietnamese
31: 'TCVN-3-2' # TCVN-3: Vietnamese
32: CP720
33: CP775
34: CP855
35: CP861
36: CP862
37: CP864
38: CP869
39: ISO8859_2
40: ISO8859_15
41: CP1098
42: CP774
43: CP772
44: CP1125
45: CP1250
46: CP1251
47: CP1253
48: CP1254
49: CP1255
50: CP1256
51: CP1257
52: CP1258
53: RK1048
#66: // Devanagari
#67: // Bengali
#68: // Tamil
#69: // Telugu
#70: // Assamese
#71: // Oriya
#72: // Kannada
#73: // Malayalam
#74: // Gujarati
#75: // Punjabi
#82: // Marathi
#254:
#255:
# Designed for non-Epson printers sold online. Without knowing
# their character encoding table, only CP437 output is assumed,
# and graphics() calls will be disabled, as it usually prints junk
# on these models.
simple:
codePages:
- cp437
graphics: false
# Designed for non-Epson printers sold online. Without knowing
# their character encoding table, only CP437 output is assumed,
# and graphics() calls will be disabled, as it usually prints junk
# on these models.
simple:
inherits: default
name: Simple profile
codePages:
0: CP437
commands:
graphicsData: false
# Profile for Star-branded printers.
star:
inherits: default
starCommands: true
star:
name: Star-branded printers
inherits: default
features:
starCommands: false
epson:
inherits: default
manufacturer: "Epson"
printers:
P-822D:
inherits: default
manufacturer: "Epson"
commands:
graphicsData: false
# http://support.epostraders.co.uk/support-files/documents/3/l7O-TM-T88II_TechnicalRefGuide.pdf
TM-T88II:
inherits: default
manufacturer: "Epson"
fonts:
a:
columns: 42
b:
columns: 56
codePages:
0: PC437
1: Katakana
2: PC850
3: PC860
4: PC863
5: PC865
19: PC858
255: blank
"P-822D":
inherits: default
graphics: false
# http://support.epostraders.co.uk/support-files/documents/3/l7O-TM-T88II_TechnicalRefGuide.pdf
TM-T88III:
inherits: default
manufacturer: "Epson"
fonts:
a:
columns: 42
b:
columns: 56
codePages:
- PC437 # 0
- Katakana # 1
- PC850 # 2
- PC860 # 3
- PC863 # 4
- PC865 # 5
- WPC1252 # 16
- PC866 # 17
- PC852 # 18
- PC858 # 19
- blank
TM-P80:
inherits: default
manufacturer: "Epson"
fonts:
a:
columns: 48
b:
columns: 64
kanji:
columns: 24
# http://support.epostraders.co.uk/support-files/documents/3/l7O-TM-T88II_TechnicalRefGuide.pdf
"TM-T88II":
inherits: epson
columns:
a: 42
b: 56
codePages:
- PC437 # 0
- Katakana # 1
- PC850 # 2
- PC860 # 3
- PC863 # 4
- PC865 # 5
- PC858 # 19
- blank
TM-P80 (42 column emulation mode):
inherits: TM-P80
fonts:
a:
columns: 42
b:
columns: 60
kanji:
columns: 21
# http://support.epostraders.co.uk/support-files/documents/3/l7O-TM-T88II_TechnicalRefGuide.pdf
"TM-T88III":
inherits: epson
columns:
a: 42
b: 56
codePages:
- PC437 # 0
- Katakana # 1
- PC850 # 2
- PC860 # 3
- PC863 # 4
- PC865 # 5
- WPC1252 # 16
- PC866 # 17
- PC852 # 18
- PC858 # 19
- blank
TM-P60II 2 (58mm):
inherits: default
manufacturer: "Epson"
media:
width:
mm: 58
fonts:
a: {columns: 35}
b: {columns: 42}
c: {columns: 52}
TM-P60II 2 (60mm):
inherits: default
manufacturer: "Epson"
media:
width:
mm: 60
fonts:
a: {columns: 36}
b: {columns: 43}
c: {columns: 54}
"TM-P80":
inherits: epson
defaultColumnConfig: default
columnConfigs:
default: {'a': 48, 'b': 64, 'kanji': 24}
'42_emulation': {'a': 42, 'b': 60, 'kanji': 21}
TM-P20 2:
inherits: default
manufacturer: "Epson"
fonts: [a, b c, d, e, f]
"TM-P60II 2":
inherits: epson
columnConfigs:
'58mm_paper': {'a': 35, 'b': 42, 'c': 52}
'60mm_paper': {'a': 36, 'b': 43, 'c': 54}
"TM-P20 2":
inherits: epson
# Has 5 fonts!
"TM-T90":
inherits: epson
colors:
- black
- red
TM-T90:
inherits: default
manufacturer: "Epson"
colors:
- black
- red