Skip to content

Commit 2ce7209

Browse files
committed
byte array dump of font
1 parent 8ccd68f commit 2ce7209

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

source_code_gen/loadfont.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,11 @@ def getcharset(filename: str):
3636
a = ""
3737
with open(filename, 'rb') as f:
3838
f.seek(1626)
39-
a = f.read(256)
39+
a = f.read(2048)
4040
return a
4141

42+
43+
4244
def main():
4345
scriptdir = path.dirname(__file__)
4446
filename = scriptdir + "/Bm437_IBM_CGA.FON"
@@ -47,7 +49,14 @@ def main():
4749
print(a)
4850
print(plot8bitpatternastext(a,"*"," "))
4951
s = getcharset(filename)
50-
print(s)
52+
b = '[8,'
53+
for i in range(2048):
54+
b += str(s[i])
55+
if i< 2047:
56+
b += ','
57+
b += "]"
58+
print(b)
59+
5160

5261

5362
if __name__ == "__main__":

0 commit comments

Comments
 (0)