summaryrefslogtreecommitdiff
path: root/makefont.py
blob: 22ee5762372c3cfc0790a4ce18e47d1fa13d3ae8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# this is a simple script to convert the binfont.src into binary
# everything but 0 an 1 are ignored

import binascii 

f=open("binfont.src",'r')
o=open("binfont.bin",'wb')

b=""
l=0
while True:

    c=f.read(1)

    if not c:
	break

    if c=="0":
	l+=1
	b+=c

    if c=="1":
	l+=1
	b+=c

    if l==8:
	print b
	l=0
	o.write(chr(int(b,2)))
	b=""





print "eof"



o.close()