from pathlib import Path
G = {
' ': ".....|.....|.....|.....|.....|.....",
'!': "..#..|..#..|..#..|.....|..#..|.....",
'"': ".#.#.|.#.#.|.....|.....|.....|.....",
'#': ".#.#.|#####|.#.#.|#####|.#.#.|.....",
'$': ".####|#.#..|.###.|..#.#|####.|.....",
'%': "##..#|##.#.|..#..|.#.##|#..##|.....",
'&': ".##..|#..#.|.##.#|#..#.|.##.#|.....",
"'": "..#..|..#..|.....|.....|.....|.....",
'(': "...#.|..#..|..#..|..#..|...#.|.....",
')': ".#...|..#..|..#..|..#..|.#...|.....",
'*': ".....|.#.#.|..#..|.#.#.|.....|.....",
'+': ".....|..#..|.###.|..#..|.....|.....",
',': ".....|.....|.....|..#..|..#..|.#...",
'-': ".....|.....|.###.|.....|.....|.....",
'.': ".....|.....|.....|.....|..#..|.....",
'/': "....#|...#.|..#..|.#...|#....|.....",
'0': ".###.|#..##|#.#.#|##..#|.###.|.....",
'1': "..#..|.##..|..#..|..#..|.###.|.....",
'2': ".###.|#...#|..##.|.#...|#####|.....",
'3': "####.|....#|.###.|....#|####.|.....",
'4': "...#.|..##.|.#.#.|#####|...#.|.....",
'5': "#####|#....|####.|....#|####.|.....",
'6': ".###.|#....|####.|#...#|.###.|.....",
'7': "#####|...#.|..#..|.#...|.#...|.....",
'8': ".###.|#...#|.###.|#...#|.###.|.....",
'9': ".###.|#...#|.####|....#|.###.|.....",
':': ".....|..#..|.....|..#..|.....|.....",
';': ".....|..#..|.....|..#..|..#..|.#...",
'<': "...#.|..#..|.#...|..#..|...#.|.....",
'=': ".....|.###.|.....|.###.|.....|.....",
'>': ".#...|..#..|...#.|..#..|.#...|.....",
'?': ".###.|#...#|..##.|.....|..#..|.....",
'@': ".###.|#.###|#.#.#|#.###|.##..|.....",
'A': ".###.|#...#|#####|#...#|#...#|.....",
'B': "####.|#...#|####.|#...#|####.|.....",
'C': ".####|#....|#....|#....|.####|.....",
'D': "####.|#...#|#...#|#...#|####.|.....",
'E': "#####|#....|####.|#....|#####|.....",
'F': "#####|#....|####.|#....|#....|.....",
'G': ".####|#....|#..##|#...#|.###.|.....",
'H': "#...#|#...#|#####|#...#|#...#|.....",
'I': ".###.|..#..|..#..|..#..|.###.|.....",
'J': "..###|...#.|...#.|#..#.|.##..|.....",
'K': "#..#.|#.#..|##...|#.#..|#..#.|.....",
'L': "#....|#....|#....|#....|#####|.....",
'M': "#...#|##.##|#.#.#|#...#|#...#|.....",
'N': "#...#|##..#|#.#.#|#..##|#...#|.....",
'O': ".###.|#...#|#...#|#...#|.###.|.....",
'P': "####.|#...#|####.|#....|#....|.....",
'Q': ".###.|#...#|#.#.#|#..#.|.##.#|.....",
'R': "####.|#...#|####.|#..#.|#...#|.....",
'S': ".####|#....|.###.|....#|####.|.....",
'T': "#####|..#..|..#..|..#..|..#..|.....",
'U': "#...#|#...#|#...#|#...#|.###.|.....",
'V': "#...#|#...#|#...#|.#.#.|..#..|.....",
'W': "#...#|#...#|#.#.#|##.##|#...#|.....",
'X': "#...#|.#.#.|..#..|.#.#.|#...#|.....",
'Y': "#...#|.#.#.|..#..|..#..|..#..|.....",
'Z': "#####|...#.|..#..|.#...|#####|.....",
'[': ".###.|.#...|.#...|.#...|.###.|.....",
'\\': "#....|.#...|..#..|...#.|....#|.....",
']': ".###.|...#.|...#.|...#.|.###.|.....",
'^': "..#..|.#.#.|#...#|.....|.....|.....",
'_': ".....|.....|.....|.....|.....|#####",
'`': ".#...|..#..|.....|.....|.....|.....",
'a': ".....|.###.|....#|.####|.####|.....",
'b': "#....|#....|####.|#...#|####.|.....",
'c': ".....|.####|#....|#....|.####|.....",
'd': "....#|....#|.####|#...#|.####|.....",
'e': ".....|.###.|#####|#....|.###.|.....",
'f': "..##.|.#...|###..|.#...|.#...|.....",
'g': ".....|.####|#...#|.####|....#|.###.",
'h': "#....|#....|####.|#...#|#...#|.....",
'i': "..#..|.....|.##..|..#..|.###.|.....",
'j': "...#.|.....|..##.|...#.|...#.|.##..",
'k': "#....|#..#.|###..|#..#.|#...#|.....",
'l': ".##..|..#..|..#..|..#..|.###.|.....",
'm': ".....|##.#.|#.#.#|#.#.#|#...#|.....",
'n': ".....|####.|#...#|#...#|#...#|.....",
'o': ".....|.###.|#...#|#...#|.###.|.....",
'p': ".....|####.|#...#|####.|#....|#....",
'q': ".....|.####|#...#|.####|....#|....#",
'r': ".....|#.##.|##...|#....|#....|.....",
's': ".....|.####|.##..|...##|####.|.....",
't': ".#...|###..|.#...|.#...|..##.|.....",
'u': ".....|#...#|#...#|#...#|.####|.....",
'v': ".....|#...#|#...#|.#.#.|..#..|.....",
'w': ".....|#...#|#.#.#|#.#.#|.#.#.|.....",
'x': ".....|#...#|.###.|.###.|#...#|.....",
'y': ".....|#...#|#...#|.####|....#|.###.",
'z': ".....|#####|..##.|.##..|#####|.....",
'{': "...##|..#..|.##..|..#..|...##|.....",
'|': "..#..|..#..|..#..|..#..|..#..|.....",
'}': "##...|..#..|..##.|..#..|##...|.....",
'~': ".....|.#..#|#.##.|.....|.....|.....",
}
out = bytearray(256 * 6)
for ch, art in G.items():
rows = art.split("|")
assert len(rows) == 6 and all(len(r) == 5 for r in rows), ch
for y, row in enumerate(rows):
out[ord(ch) * 6 + y] = sum(0x80 >> x for x, c in enumerate(row) if c == "#")
assert len(G) == 95
(Path(__file__).resolve().parent / "font6x6.bin").write_bytes(bytes(out))