initial commit

This commit is contained in:
svo
2018-08-07 12:53:00 +03:00
commit 8d5bcafe97
99 changed files with 126 additions and 0 deletions

BIN
Glass_TTY_VT220.ttf Normal file

Binary file not shown.

28
VT200 Normal file
View File

@@ -0,0 +1,28 @@
[62;0"p F
P0;0;1;4;1;1{U
???????/???????;???}???/???A???;?M??M??/???????;g}gg}g?/?B??B??;
GSS}SS_/?@@B@@?;CIcOGcA/A@??@A@;kQQQk?_/@AAAA@A;??GEA??/???????;
?wCA???/??@A???;???ACw?/???A@??;OSwOwSO/?@???@?;OOO{OOO/???@???;
???????/?CB@???;OOOOOOO/???????;???????/??BB???;??_OGCA/A@?????;
wCAAACw/?@AAA@?;?GC}???/?AABAA?;CaaQQQK/BAAAAAA;AAAQYUa/@AAAAA@;
_ogca}_/?????B?;]IIIIIq/@AAAAA@;wcQQQQc/@AAAAA@;AAAaQIE/??B????;
kQQQQQk/@AAAAA@;KQQQQQ{/?AAAAA@;??KK???/??BB???;??KK???/?CB@???;
O?g?C?A/????@?A;ggggggg/???????;A?C?g?O/A?@????;CAAqIIC/???A???;
w_oGGGo/B?@AAA@;?ggggo?/@AAAA@A;_QUYYQa/@AAAAA@;w????w?/@AAA@@E;
cQQQQQ{/@AAAAA@;ogggggo/@AAAAA?;_OOwOO_/?@@B@@?;?gggggO/@AAAAAA;
G?O_O?G/A?@?@?A;w????w?/@AAA@BA;w??C?w?/@AAA@BA;w___OOG/B???@@A;
??oGGGw/AA@???B;wO___Ow/B??@??B;w_____w/B?????B;oGGGGGo/@AAAAA@;
wOGGGo?/B????BA;Ogggggw/AA@???B;wGGGGGo/F@@@@@?;oGGGGGO/@AAAAA@;
GGGwGGG/???B???;w?????w/CDDDDDB;GO_w_OG/A@?B?@A;{QQYSO_/@AAAAA@;
w_____?/BAAAAA@;w___??w/BAAA@?B;OGGgggO/@AAAAA@;w??w??w/BAABAAB;
OGGgggo/@AAAAA@;w??w??w/BAABAAF;w_____w/??????B;GGw___?/??BAAA@;
}O{AAA{/B?@AAA@;ogcaaa}/B?????B;}QQQQQa/BAAAAA@;}????}?/BAAAABE;
?{AAA}?/EBAAABE;}QQQQQQ/BAAAAAA;wCC}CCw/?@@B@@?;}AAAAAA/B??????;
E?gOg?E/B?????B;}?_OGC}/B@????B;}?_RHC}/B@????B;}OOOggE/B?????B;
oGCAAA}/B?????B;}CGoGC}/B?????B;}_____}/B?????B;{AAAAA{/@AAAAA@;
}AAAAA}/B?????B;KQqQQQ}/A@????B;}aaaaa[/B??????;{AAAAAA/@AAAAAA;
EAA}AAE/???B???;MOOOOO}/@AAAAA@;EgO}OgE/B??B??B;}QQQQ[_/BAAAAA@;
}OOOOO_/BAAAAA@;}OOO_?}/BAAA@?B;CAAQQQk/@AAAAA@;}??}??}/BAABAAB;
AAQQQQ{/AAAAAA@;}??}??}/BAABAAF;]OOOOO}/??????B/)U~

BIN
u0400.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 B

BIN
u0401.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 B

BIN
u0402.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 B

BIN
u0403.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 B

BIN
u0404.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 B

BIN
u0405.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 91 B

BIN
u0406.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 87 B

BIN
u0407.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 B

BIN
u0408.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 B

BIN
u0409.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 B

BIN
u040a.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 B

BIN
u040b.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 B

BIN
u040c.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 B

BIN
u040d.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 B

BIN
u040e.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 B

BIN
u040f.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 91 B

BIN
u0410.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 B

BIN
u0411.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 B

BIN
u0412.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 91 B

BIN
u0413.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 91 B

BIN
u0414.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 89 B

BIN
u0415.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 B

BIN
u0416.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 91 B

BIN
u0417.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 89 B

BIN
u0418.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 B

BIN
u0419.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 B

BIN
u041a.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 B

BIN
u041b.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 B

BIN
u041c.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 B

BIN
u041d.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 B

BIN
u041e.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 B

BIN
u041f.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 B

BIN
u0420.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 B

BIN
u0421.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 B

BIN
u0422.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 87 B

BIN
u0423.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 B

BIN
u0424.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 B

BIN
u0425.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 B

BIN
u0426.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 B

BIN
u0427.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 B

BIN
u0428.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 B

BIN
u0429.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 B

BIN
u042a.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 B

BIN
u042b.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 B

BIN
u042c.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 B

BIN
u042d.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 B

BIN
u042e.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 B

BIN
u042f.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 B

BIN
u0430.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 B

BIN
u0431.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 B

BIN
u0432.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 B

BIN
u0433.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 B

BIN
u0434.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 B

BIN
u0435.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 B

BIN
u0436.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 B

BIN
u0437.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 B

BIN
u0438.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 B

BIN
u0439.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 B

BIN
u043a.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 B

BIN
u043b.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 77 B

BIN
u043c.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 B

BIN
u043d.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 B

BIN
u043e.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 B

BIN
u043f.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 B

BIN
u0440.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 B

BIN
u0441.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 87 B

BIN
u0442.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 B

BIN
u0443.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 B

BIN
u0444.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 B

BIN
u0445.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 B

BIN
u0446.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 B

BIN
u0447.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 B

BIN
u0448.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 B

BIN
u0449.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 B

BIN
u044a.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 B

BIN
u044b.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 B

BIN
u044c.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 B

BIN
u044d.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 B

BIN
u044e.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 B

BIN
u044f.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 B

BIN
u0450.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 B

BIN
u0451.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 B

BIN
u0452.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 B

BIN
u0453.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 B

BIN
u0454.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 B

BIN
u0455.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 B

BIN
u0456.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 B

BIN
u0457.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 B

BIN
u0458.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 B

BIN
u0459.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 B

BIN
u045a.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 B

BIN
u045b.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 B

BIN
u045c.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 B

BIN
u045d.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 B

BIN
u045e.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 B

BIN
vt220glyphs.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

98
vtparse.py Normal file
View File

@@ -0,0 +1,98 @@
import os
import sys
import re
import png
def tobin(x, count=8):
"""
Integer to binary
Count is number of bits
"""
return "".join(map(lambda y:str((x>>y)&1), range(count-1, -1, -1)))
def chartosixel(c):
return ord(c) - 077
# 7x10 char matrix
class vtchar:
m = []
charcode = 0
def __init__(self, code):
self.m = [' ' for x in range(7*10)]
self.charcode = code
def sixel(self, nsixel, topbottom, c):
bits = chartosixel(c)
rang3 = range(6 - 2*topbottom)
for b in rang3:
bit = (bits>>b) & 001
self.m[(topbottom*6+b)*7 + nsixel] = '01'[bit]
def sixelpack(self, spair):
sp = spair.strip().split('/')
for tb in [0,1]:
for sc in range(7):
self.sixel(sc,tb,sp[tb][sc])
def dump(self):
i = 0
for c in self.m:
print c,
i = i + 1
if i % 7 == 0: print('\n')
def writepng(self):
# pack
s=[]
i = 0
b = 0
for c in self.m:
i = i + 1
b = b | (int(c)<<(9-((i-1)%7)))
if i % 7 == 0:
b = b | (b>>1)
s.append(tobin(~b,10))
s.append(tobin(~0,10))
b = 0
s = map(lambda x: map(int, x), s)
f = open('u%04x.png'%self.charcode, 'wb')
w = png.Writer(len(s[0]), len(s), greyscale=True, bitdepth=1)
w.write(f, s)
f.close()
print 'Opening file "VT200"...'
try:
text = open('VT200').read().replace('\n', ' ')
except:
print "error"
sys.exit(1)
fontdef = re.compile('.*\033P([0-9]\;){5}[0-9]\{\s*[A-Za-z]+\s+(?P<sixels>[^\033]*)\033\/')
try:
sixels = fontdef.match(text).expand('\g<sixels>')
except:
print "VT200 doesn't seem to contain character definitions"
sys.exit(2)
test=False
if test:
v = vtchar(0)
#v.sixelpack('~~~~~~~/~~~~~~~')
#v.dump()
v.sixelpack('ogcacgo/B?????B')
v.dump()
v.writepng()
sys.exit(0)
charcode = 1024
for chardef in sixels.split(';'):
v=vtchar(charcode)
v.sixelpack(chardef)
#v.dump()
v.writepng()
charcode = charcode + 1