diff options
| -rw-r--r-- | Makefile | 4 | ||||
| -rw-r--r-- | data/binfont.src (renamed from binfont.src) | 0 | ||||
| -rw-r--r-- | makefont.py | 42 | ||||
| -rw-r--r-- | tools/binarize.py | 40 |
4 files changed, 42 insertions, 44 deletions
@@ -29,8 +29,8 @@ Fool.img: mbr.bin kernel.bin fill.bin FoolData.img: binfont.bin cat $^ > $@ -binfont.bin: binfont.src - python makefont.py +binfont.bin: data/binfont.src + python tools/binarize.py $< $@ #some data just to fill up to the target image_size fill.bin: boot/fill.asm diff --git a/binfont.src b/data/binfont.src index c1d9ccc..c1d9ccc 100644 --- a/binfont.src +++ b/data/binfont.src diff --git a/makefont.py b/makefont.py deleted file mode 100644 index 5d5d419..0000000 --- a/makefont.py +++ /dev/null @@ -1,42 +0,0 @@ -# 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" or c=='_': - l+=1 - b+="0" - - if c=="1" or c=='X': - l+=1 - b+="1" - - if l==8: -# print b - l=0 - o.write(chr(int(b,2))) - b="" - - - - - -print "eof" - - - -o.close() - - diff --git a/tools/binarize.py b/tools/binarize.py new file mode 100644 index 0000000..6dcbdef --- /dev/null +++ b/tools/binarize.py @@ -0,0 +1,40 @@ +# this is a simple script to convert the ascii files into binaries +# everything but 0 an 1 , or alternatively _ and X is ignored in +# source file. + +import binascii +import sys + + +f=open(sys.argv[1],'r') +o=open(sys.argv[2],'wb') + +print "binarizing " + sys.argv[1] + " to "+sys.argv[2] + "." + +b="" +l=0 + +while True: + + c=f.read(1) + + if not c: + break + + if c=="0" or c=='_': + l+=1 + b+="0" + + if c=="1" or c=='X': + l+=1 + b+="1" + + if l==8: +# print b + l=0 + o.write(chr(int(b,2))) + b="" + +o.close() + + |
