Skip to content

Commit 8ccd68f

Browse files
committed
extract bit patterns
1 parent 18b189f commit 8ccd68f

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

source_code_gen/loadfont.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,22 @@ def getcharbmp(filename: str, ch: str):
3232
a = f.read(8)
3333
return a
3434

35+
def getcharset(filename: str):
36+
a = ""
37+
with open(filename, 'rb') as f:
38+
f.seek(1626)
39+
a = f.read(256)
40+
return a
41+
3542
def main():
3643
scriptdir = path.dirname(__file__)
3744
filename = scriptdir + "/Bm437_IBM_CGA.FON"
3845
ch = ">"
3946
a = getcharbmp(filename, ch)
4047
print(a)
4148
print(plot8bitpatternastext(a,"*"," "))
49+
s = getcharset(filename)
50+
print(s)
4251

4352

4453
if __name__ == "__main__":

0 commit comments

Comments
 (0)