summaryrefslogtreecommitdiff
path: root/tools/gen_display_resources.py
diff options
context:
space:
mode:
authorsommersoft <sommersoft@users.noreply.github.com>2019-07-27 10:46:53 -0500
committerGitHub <noreply@github.com>2019-07-27 10:46:53 -0500
commitcebdadd0f6122826337c962b3d443bd41d1de69d (patch)
treee2aeb661c3760f7aaf152bc1bbd95fd120161ab8 /tools/gen_display_resources.py
parentc335f170d7d561d07ca7412da60c260e13c5e746 (diff)
parentd99d3bd471920cdd9b2683b7dbd538551f7aee43 (diff)
Merge branch 'master' into dynamic_support_matrix
Diffstat (limited to 'tools/gen_display_resources.py')
-rw-r--r--tools/gen_display_resources.py24
1 files changed, 14 insertions, 10 deletions
diff --git a/tools/gen_display_resources.py b/tools/gen_display_resources.py
index 7b28c3105..a731cbd9c 100644
--- a/tools/gen_display_resources.py
+++ b/tools/gen_display_resources.py
@@ -29,7 +29,6 @@ class BitmapStub:
self.rows[y] = bytes(row)
f = bitmap_font.load_font(args.font, BitmapStub)
-real_bb = [0, 0]
# Load extra characters from the sample file.
sample_characters = set()
@@ -61,13 +60,11 @@ for c in all_characters:
print("Font missing character:", c, ord(c))
filtered_characters = filtered_characters.replace(c, "")
continue
- x, y, dx, dy = g["bounds"]
if g["shift"][1] != 0:
raise RuntimeError("y shift")
- real_bb[0] = max(real_bb[0], x - dx)
- real_bb[1] = max(real_bb[1], y - dy)
-tile_x, tile_y = real_bb
+x, y, dx, dy = f.get_bounding_box()
+tile_x, tile_y = x - dx, y - dy
total_bits = tile_x * len(all_characters)
total_bits += 32 - total_bits % 32
bytes_per_row = total_bits // 8
@@ -101,14 +98,21 @@ c_file.write("""\
""")
c_file.write("""\
-uint32_t terminal_transparency[1] = {0x00000000};
-
-// These colors are RGB 565 with the bytes swapped.
-uint32_t terminal_colors[1] = {0xffff0000};
+_displayio_color_t terminal_colors[2] = {
+ {
+ .rgb888 = 0x000000,
+ .rgb565 = 0x0000,
+ .luma = 0x00
+ },
+ {
+ .rgb888 = 0xffffff,
+ .rgb565 = 0xffff,
+ .luma = 0xff
+ },
+};
displayio_palette_t supervisor_terminal_color = {
.base = {.type = &displayio_palette_type },
- .opaque = terminal_transparency,
.colors = terminal_colors,
.color_count = 2,
.needs_refresh = false