"""Probe's 5x7 hex glyphs, independent of the ROM and build workspace.""" FONT = { '0':'01110 10001 10011 10101 11001 10001 01110', '1':'00100 01100 00100 00100 00100 00100 01110', '2':'01110 10001 00001 00010 00100 01000 11111', '3':'11110 00001 00001 01110 00001 00001 11110', '4':'00010 00110 01010 10010 11111 00010 00010', '5':'11111 10000 11110 00001 00001 10001 01110', '6':'00110 01000 10000 11110 10001 10001 01110', '7':'11111 00001 00010 00100 01000 01000 01000', '8':'01110 10001 10001 01110 10001 10001 01110', '9':'01110 10001 10001 01111 00001 00010 01100', 'A':'01110 10001 10001 11111 10001 10001 10001', 'B':'11110 10001 10001 11110 10001 10001 11110', 'C':'01110 10001 10000 10000 10000 10001 01110', 'D':'11110 10001 10001 10001 10001 10001 11110', 'E':'11111 10000 10000 11110 10000 10000 11111', 'F':'11111 10000 10000 11110 10000 10000 10000', } def tile(ch): rows=FONT[ch].split();out=bytearray() for y in range(8): pixels=[2]*8 if y<7: for x,bit in enumerate(rows[y]): if bit=='1':pixels[x+1]=1 for x in range(0,8,2):out.append(pixels[x]|pixels[x+1]<<4) return bytes(out)