#!/usr/bin/env python3 """Bold (2px) uppercase Russian font, 6px wide (cols 1..6, col0 = 1px left bearing), body rows 3..11 (all glyphs 9 rows tall to match the stock ASCII caps). 12 letters reuse the stock ASCII/digit glyph bytes; the rest are hand-drawn. """ # Cyrillic upper -> stock ASCII char whose glyph bitmap is identical REUSE = {"А":"A","В":"B","Е":"E","З":"3","К":"K","М":"M","Н":"H", "О":"O","Р":"P","С":"C","Т":"T","Х":"X"} # hand-drawn, exactly 9 rows -> placed at rows 3..11 (top-of-cap = 3, baseline = 11) _U = { "Б":[".######",".##....",".##....",".#####.",".##..##",".##..##",".##..##",".##..##",".#####."], "Г":[".######",".##....",".##....",".##....",".##....",".##....",".##....",".##....",".##...."], "Д":["..#####","..##..#","..##..#","..##..#","..##..#","..##..#","..##..#",".######",".##..##"], "Ж":[".#.#.#.",".#.#.#.","..###..","...#...","...#...","..###..",".#.#.#.",".#.#.#.",".#.#.#."], "И":[".##..##",".##..##",".##.###",".#####.",".#####.",".###.##",".##..##",".##..##",".##..##"], "Й":["..####.","...##..",".##..##",".##.###",".#####.",".###.##",".##..##",".##..##",".##..##"], "Л":["..#####","..##..#","..##..#","..##..#","..##..#","..##..#",".##...#",".##...#",".##...#"], "П":[".######",".##..##",".##..##",".##..##",".##..##",".##..##",".##..##",".##..##",".##..##"], "У":[".##.##.",".##.##.","..###..","...##..","...##..","...##..","..##...",".##....",".#....."], "Ф":["...##..",".######",".#.##.#",".#.##.#",".#.##.#",".######","...##..","...##..","...##.."], "Ц":[".##.##.",".##.##.",".##.##.",".##.##.",".##.##.",".##.##.",".##.##.",".#####.","....##."], "Ч":[".##..##",".##..##",".##..##",".######",".....##",".....##",".....##",".....##",".....##"], "Ш":[".#.##.#",".#.##.#",".#.##.#",".#.##.#",".#.##.#",".#.##.#",".#.##.#",".#.##.#",".######"], "Щ":[".#.##.#",".#.##.#",".#.##.#",".#.##.#",".#.##.#",".#.##.#",".#.##.#",".######","......#"], "Ъ":[".###...","..##...","..##...","..##...","..####.","..##.##","..##.##","..##.##","..####."], "Ы":[".##...#",".##...#",".##...#",".##...#",".####.#",".##.#.#",".##.#.#",".##.#.#",".####.#"], "Ь":[".##....",".##....",".##....",".##....",".#####.",".##..##",".##..##",".##..##",".#####."], "Э":[".#####.",".##..##",".....##","...####",".....##",".....##",".....##",".##..##",".#####."], "Ю":[".#..##.",".#.#..#",".#.#..#",".####.#",".#.#..#",".#.#..#",".#.#..#",".#.#..#",".#..##."], "Я":[".######",".##..##",".##..##",".######",".....##","....#.#","...#..#","..#...#",".#....#"], "Ё":[".#.#...",".......",".######",".##....",".#####.",".##....",".##....",".##....",".######"], } def unique_rows(ch): body = _U[ch] # exactly 9 rows -> rows 3..11 grid = ["......."] * 14 for i, r in enumerate(body): grid[3 + i] = r return grid LETTERS = list(REUSE.keys()) + list(_U.keys())