Add store resources
This commit is contained in:
+2
-1
@@ -8,7 +8,8 @@
|
||||
"segment",
|
||||
"display",
|
||||
"led",
|
||||
"speedometer"
|
||||
"speedometer",
|
||||
"car"
|
||||
],
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 176 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.3 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.0 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 831 B |
Binary file not shown.
|
After Width: | Height: | Size: 890 B |
Binary file not shown.
|
After Width: | Height: | Size: 878 B |
@@ -1,42 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
from subprocess import run
|
||||
|
||||
from bdfparser import Font
|
||||
from PIL import Image
|
||||
|
||||
font = Font("civic-segments.bdf")
|
||||
print(
|
||||
f"This font's global size is "
|
||||
f"{font.headers['fbbx']} x {font.headers['fbby']} (pixel), "
|
||||
f"it contains {len(font)} glyphs."
|
||||
)
|
||||
chars_to_export = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]
|
||||
for char_str in chars_to_export:
|
||||
char = font.glyph(char_str)
|
||||
bitmap = char.draw()
|
||||
im = Image.frombytes(
|
||||
"RGBA",
|
||||
(bitmap.width(), bitmap.height()),
|
||||
bitmap.tobytes(
|
||||
"RGBA",
|
||||
bytesdict={
|
||||
0: b"\x00\x00\x00\x00", # transparent background
|
||||
1: b"\xff\xff\xff\xff", # white glyph
|
||||
},
|
||||
),
|
||||
)
|
||||
output_path = f"../resources/{char_str}.png"
|
||||
im.save(output_path, "PNG")
|
||||
run(
|
||||
[
|
||||
"zopflipng",
|
||||
"-y",
|
||||
"--iterations=500",
|
||||
"--filters=01234mepb",
|
||||
"--lossy_8bit",
|
||||
"--lossy_transparent",
|
||||
output_path,
|
||||
output_path,
|
||||
]
|
||||
)
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user