summaryrefslogtreecommitdiff
path: root/src/compile_eeprom.py
diff options
context:
space:
mode:
authorBrett Weiland <brett_weiland@bpcsapce.com>2023-01-12 13:41:48 -0600
committerBrett Weiland <brett_weiland@bpcsapce.com>2023-01-12 13:41:48 -0600
commitb666668d0e6b67e4632e65486cae814ab5abbc39 (patch)
tree0cf0c2d689799c5e98d505e632248fdc5ed5a072 /src/compile_eeprom.py
parent94304b11e7220f060dbc345de5fa1952d0465016 (diff)
updating for linkedin
Diffstat (limited to 'src/compile_eeprom.py')
-rwxr-xr-xsrc/compile_eeprom.py18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/compile_eeprom.py b/src/compile_eeprom.py
index dee9341..3fbd60d 100755
--- a/src/compile_eeprom.py
+++ b/src/compile_eeprom.py
@@ -18,7 +18,6 @@ page_bit_height = 8
page_cnt = 4
-
#fonts
# for some reason BdfFontFile.BdfFontFile.bitmap doesn't have proper spacing
# so we'll just manually go through each character ourselves
@@ -27,6 +26,7 @@ page_cnt = 4
# get to big for litteraly no reason
header.write("/** GENERATED BY EEPROM COMPILER SCRIPT **/\r\n\r\n")
+header.write("#include \"paint.h\"\r\n")
header.write("// FONTS\r\n")
for file in os.listdir("{}/fonts/".format(data_path)):
@@ -36,20 +36,28 @@ for file in os.listdir("{}/fonts/".format(data_path)):
font_bdf = BdfFontFile.BdfFontFile(font_fd)
font_name = file.split('.')[0].capitalize()
- header.write("#define FONT_{}_ADDR\t0x{:04x}\r\n".format(font_name, output.tell()))
+ #header.write("#define FONT_{}_ADDR\t0x{:04x}\r\n".format(font_name, output.tell()))
+ header.write("font_t FONT_{} = {{ \r\n".format(font_name))
first_char = False
for char in enumerate(font_bdf.glyph):
if char[1]:
if not first_char:
first_char = True
- header.write(("#define FONT_{}_FIRST_CHAR\t{}\r\n"
- "#define FONT_{}_WIDTH\t{}\r\n"
- "#define FONT_{}_HEIGHT\t{}\r\n").format(
+ header.write((
+ " .FONT_{}_WIDTH\t{}\r\n"
+ " .FONT_{}_HEIGHT\t{}\r\n").format(
font_name, char[0],
font_name, char[1][-1].size[0],
font_name, char[1][-1].size[1]))
+# header.write(("#define FONT_{}_FIRST_CHAR\t{}\r\n"
+# "#define FONT_{}_WIDTH\t{}\r\n"
+# "#define FONT_{}_HEIGHT\t{}\r\n").format(
+# font_name, char[0],
+# font_name, char[1][-1].size[0],
+# font_name, char[1][-1].size[1]))
output.write(char[1][-1].tobytes('raw'))
+ header.write("}\r\n")
header.write("\r\n\r\n// IMAGES\r\n#define IMG_BEGIN\t0x{:04x}\r\n".format(output.tell()))