Browse Source

make the generator script output two columns

master
Lephenixnoir 2 months ago
parent
commit
ecc83c2d0b
2 changed files with 14 additions and 3 deletions
  1. 14
    3
      gen.py
  2. BIN
      uf5x7.png

+ 14
- 3
gen.py View File

@@ -100,16 +100,27 @@ class Block:
blocks = [ Block(file) for file in files ]
height = sum(b.height() for b in blocks)

result = PIL.Image.new("RGB", (112, height))
left_height = 0
for b in blocks:
left_height += b.height()
if 2 * left_height >= height: break

result = PIL.Image.new("RGB", (2 * 112 + 8, left_height), color=WHITE)

x = 0
y = 0

for b in blocks:
header = b.header()
result.paste(header, (0, y))
result.paste(header, (x, y))
y += header.height

body = b.body()
result.paste(body, (0, y))
result.paste(body, (x, y))
y += body.height

if y >= left_height:
y = 0
x += 112 + 8

result.save("uf5x7.png")

BIN
uf5x7.png View File


Loading…
Cancel
Save