summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--font2.h133
-rw-r--r--mirror_font.py25
2 files changed, 158 insertions, 0 deletions
diff --git a/font2.h b/font2.h
new file mode 100644
index 0000000..8dd8c97
--- /dev/null
+++ b/font2.h
@@ -0,0 +1,133 @@
+#ifndef FONT_H_
+#define FONT_H_
+
+#include <avr/pgmspace.h>
+
+const unsigned char PROGMEM chr_1[] = {0x08,0x00,0x04,0x22,0x02,0x22,0x04,0x00,0x00}; // happy smiley
+const unsigned char PROGMEM chr_2[] = {0x08,0x00,0x02,0x24,0x04,0x24,0x02,0x00,0x00}; // sad smiley
+const unsigned char PROGMEM chr_3[] = {0x05,0x18,0x37,0x3a,0x37,0x18}; // skull
+const unsigned char PROGMEM chr_4[] = {0x05,0x18,0x24,0x12,0x24,0x18}; // heart
+const unsigned char PROGMEM chr_5[] = {0x05,0x1b,0x2c,0x7b,0x2c,0x1b}; // invader1
+const unsigned char PROGMEM chr_6[] = {0x05,0x5f,0x2d,0x3c,0x2d,0x5f}; // invader2
+const unsigned char PROGMEM chr_7[] = {0x05,0x39,0x6f,0x78,0x6f,0x39}; // invader3
+const unsigned char PROGMEM chr_8[] = {0x05,0x1f,0x2e,0x3f,0x2e,0x1f}; // ghost
+const unsigned char PROGMEM chr_9[] = {0x05,0x3c,0x16,0x1f,0x16,0x3c}; // fox
+const unsigned char PROGMEM chr_10[] = {0x07,0x3e,0x02,0x02,0x00,0x3e,0x28,0x20}; // <LF>
+const unsigned char PROGMEM chr_11[] = {0x05,0x06,0x06,0x7c,0x53,0x3f}; // 2 musical notes
+const unsigned char PROGMEM chr_12[] = {0x04,0x03,0x7f,0x20,0x18}; // musical note
+const unsigned char PROGMEM chr_13[] = {0x07,0x1c,0x22,0x22,0x00,0x3e,0x28,0x16}; // <CR>
+const unsigned char PROGMEM chr_14[] = {0x05,0x60,0x51,0x4f,0x51,0x60}; // glass
+const unsigned char PROGMEM chr_15[] = {0x04,0x3f,0x2f,0x2f,0x7f}; // mobile
+const unsigned char PROGMEM chr_16[] = {0x04,0x07,0x33,0x55,0x98}; // flash
+const unsigned char PROGMEM chr_17[] = {0x05,0x70,0x8e,0x9f,0x8e,0x70}; // lightbulb
+const unsigned char PROGMEM chr_18[] = {0x05,0x08,0x1c,0x2a,0x08,0x08}; // <-
+const unsigned char PROGMEM chr_19[] = {0x05,0x08,0x08,0x2a,0x1c,0x08}; // ->
+const unsigned char PROGMEM chr_20[] = {0x05,0x06,0x09,0x59,0x66,0x70}; // male
+const unsigned char PROGMEM chr_21[] = {0x05,0x30,0x4a,0x4f,0x4a,0x30}; // female
+const unsigned char PROGMEM chr_22[] = {0x07,0x30,0x77,0x4d,0x59,0x4d,0x77,0x30}; // telephone
+const unsigned char PROGMEM chr_23[] = {0x05,0x11,0x12,0x5c,0x12,0x11}; // stick figure
+const unsigned char PROGMEM chr_24[] = {0x07,0x08,0x14,0x2a,0x55,0x2a,0x14,0x08}; // diamond
+const unsigned char PROGMEM chr_25[] = {0x05,0x1c,0x22,0x3a,0x2a,0x1c}; // clock
+const unsigned char PROGMEM chr_26[] = {0x05,0x04,0x3c,0x7e,0x3c,0x04}; // bell
+const unsigned char PROGMEM chr_27[] = {0x05,0x63,0x55,0x49,0x41,0x41}; // sigma
+const unsigned char PROGMEM chr_28[] = {0x05,0x1d,0x23,0x20,0x23,0x1d}; // omega
+const unsigned char PROGMEM chr_29[] = {0x06,0x08,0x1c,0x3e,0x7f,0x63,0x41}; // left
+const unsigned char PROGMEM chr_30[] = {0x06,0x41,0x63,0x7f,0x3e,0x1c,0x08}; // right
+const unsigned char PROGMEM chr_31[] = {0x07,0x0e,0x11,0x0e,0x00,0x7f,0x08,0x37}; // ok
+const unsigned char PROGMEM chr_32[] = {0x03,0x00,0x00,0x00}; // <space>
+const unsigned char PROGMEM chr_33[] = {0x01,0x7d}; // !
+const unsigned char PROGMEM chr_34[] = {0x03,0x60,0x00,0x60}; // "
+const unsigned char PROGMEM chr_35[] = {0x05,0x14,0x7f,0x14,0x7f,0x14}; // #
+const unsigned char PROGMEM chr_36[] = {0x05,0x12,0x2a,0x7f,0x2a,0x24}; // $
+const unsigned char PROGMEM chr_37[] = {0x05,0x62,0x64,0x08,0x13,0x23}; // %
+const unsigned char PROGMEM chr_38[] = {0x05,0x36,0x49,0x35,0x02,0x05}; // &
+const unsigned char PROGMEM chr_39[] = {0x02,0x50,0x60}; // '
+const unsigned char PROGMEM chr_40[] = {0x03,0x1c,0x22,0x41}; // (
+const unsigned char PROGMEM chr_41[] = {0x03,0x41,0x22,0x1c}; // )
+const unsigned char PROGMEM chr_42[] = {0x05,0x22,0x14,0x6b,0x14,0x22}; // *
+const unsigned char PROGMEM chr_43[] = {0x05,0x08,0x08,0x3e,0x08,0x08}; // +
+const unsigned char PROGMEM chr_44[] = {0x02,0x01,0x02}; // ,
+const unsigned char PROGMEM chr_45[] = {0x04,0x08,0x08,0x08,0x08}; // -
+const unsigned char PROGMEM chr_46[] = {0x01,0x01}; // .
+const unsigned char PROGMEM chr_47[] = {0x05,0x03,0x04,0x08,0x10,0x60}; // /
+const unsigned char PROGMEM chr_48[] = {0x04,0x3e,0x41,0x41,0x3e}; // 0
+const unsigned char PROGMEM chr_49[] = {0x03,0x21,0x7f,0x01}; // 1
+const unsigned char PROGMEM chr_50[] = {0x04,0x23,0x45,0x49,0x31}; // 2
+const unsigned char PROGMEM chr_51[] = {0x04,0x22,0x41,0x49,0x36}; // 3
+const unsigned char PROGMEM chr_52[] = {0x04,0x0c,0x14,0x24,0x7f}; // 4
+const unsigned char PROGMEM chr_53[] = {0x04,0x72,0x51,0x51,0x4e}; // 5
+const unsigned char PROGMEM chr_54[] = {0x04,0x1e,0x29,0x49,0x46}; // 6
+const unsigned char PROGMEM chr_55[] = {0x04,0x40,0x47,0x58,0x60}; // 7
+const unsigned char PROGMEM chr_56[] = {0x04,0x36,0x49,0x49,0x36}; // 8
+const unsigned char PROGMEM chr_57[] = {0x04,0x30,0x49,0x4a,0x3c}; // 9
+const unsigned char PROGMEM chr_58[] = {0x01,0x0a}; // :
+const unsigned char PROGMEM chr_59[] = {0x02,0x01,0x0a}; // ;
+const unsigned char PROGMEM chr_60[] = {0x04,0x08,0x14,0x22,0x41}; // <
+const unsigned char PROGMEM chr_61[] = {0x04,0x14,0x14,0x14,0x14}; // =
+const unsigned char PROGMEM chr_62[] = {0x04,0x41,0x22,0x14,0x08}; // >
+const unsigned char PROGMEM chr_63[] = {0x04,0x20,0x45,0x48,0x30}; // ?
+const unsigned char PROGMEM chr_64[] = {0x05,0x26,0x49,0x4f,0x41,0x3e}; // @
+const unsigned char PROGMEM chr_65[] = {0x04,0x3f,0x48,0x48,0x3f}; // A
+const unsigned char PROGMEM chr_66[] = {0x04,0x7f,0x49,0x49,0x36}; // B
+const unsigned char PROGMEM chr_67[] = {0x04,0x3e,0x41,0x41,0x22}; // C
+const unsigned char PROGMEM chr_68[] = {0x04,0x7f,0x41,0x41,0x3e}; // D
+const unsigned char PROGMEM chr_69[] = {0x04,0x7f,0x49,0x49,0x41}; // E
+const unsigned char PROGMEM chr_70[] = {0x04,0x7f,0x48,0x48,0x40}; // F
+const unsigned char PROGMEM chr_71[] = {0x04,0x3e,0x41,0x49,0x2e}; // G
+const unsigned char PROGMEM chr_72[] = {0x04,0x7f,0x08,0x08,0x7f}; // H
+const unsigned char PROGMEM chr_73[] = {0x03,0x41,0x7f,0x41}; // I
+const unsigned char PROGMEM chr_74[] = {0x04,0x02,0x01,0x01,0x7e}; // J
+const unsigned char PROGMEM chr_75[] = {0x04,0x7f,0x08,0x14,0x63}; // K
+const unsigned char PROGMEM chr_76[] = {0x04,0x7f,0x01,0x01,0x01}; // L
+const unsigned char PROGMEM chr_77[] = {0x05,0x7f,0x20,0x18,0x20,0x7f}; // M
+const unsigned char PROGMEM chr_78[] = {0x04,0x7f,0x30,0x0c,0x7f}; // N
+const unsigned char PROGMEM chr_79[] = {0x04,0x3e,0x41,0x41,0x3e}; // O
+const unsigned char PROGMEM chr_80[] = {0x04,0x7f,0x48,0x48,0x30}; // P
+const unsigned char PROGMEM chr_81[] = {0x04,0x3e,0x41,0x42,0x3d}; // Q
+const unsigned char PROGMEM chr_82[] = {0x04,0x7f,0x48,0x4c,0x33}; // R
+const unsigned char PROGMEM chr_83[] = {0x04,0x32,0x49,0x49,0x26}; // S
+const unsigned char PROGMEM chr_84[] = {0x05,0x40,0x40,0x7f,0x40,0x40}; // T
+const unsigned char PROGMEM chr_85[] = {0x04,0x7e,0x01,0x01,0x7e}; // U
+const unsigned char PROGMEM chr_86[] = {0x05,0x70,0x0c,0x03,0x0c,0x70}; // V
+const unsigned char PROGMEM chr_87[] = {0x05,0x7e,0x01,0x0e,0x01,0x7e}; // W
+const unsigned char PROGMEM chr_88[] = {0x05,0x63,0x14,0x08,0x14,0x63}; // X
+const unsigned char PROGMEM chr_89[] = {0x05,0x60,0x10,0x0f,0x10,0x60}; // Y
+const unsigned char PROGMEM chr_90[] = {0x04,0x43,0x4d,0x51,0x61}; // Z
+const unsigned char PROGMEM chr_91[] = {0x03,0x7f,0x41,0x41}; // [
+const unsigned char PROGMEM chr_92[] = {0x05,0x60,0x10,0x08,0x04,0x03}; // backslash
+const unsigned char PROGMEM chr_93[] = {0x03,0x41,0x41,0x7f}; // ]
+const unsigned char PROGMEM chr_94[] = {0x03,0x20,0x40,0x20}; // ^
+const unsigned char PROGMEM chr_95[] = {0x04,0x01,0x01,0x01,0x01}; // _
+const unsigned char PROGMEM chr_96[] = {0x02,0x60,0x10}; // `
+const unsigned char PROGMEM chr_97[] = {0x04,0x02,0x15,0x15,0x0f}; // a
+const unsigned char PROGMEM chr_98[] = {0x04,0x7f,0x11,0x11,0x0e}; // b
+const unsigned char PROGMEM chr_99[] = {0x04,0x0e,0x11,0x11,0x02}; // c
+const unsigned char PROGMEM chr_100[] = {0x04,0x0e,0x11,0x11,0x7f}; // d
+const unsigned char PROGMEM chr_101[] = {0x04,0x0e,0x15,0x15,0x09}; // e
+const unsigned char PROGMEM chr_102[] = {0x04,0x10,0x3f,0x50,0x40}; // f
+const unsigned char PROGMEM chr_103[] = {0x04,0x08,0x15,0x15,0x1e}; // g
+const unsigned char PROGMEM chr_104[] = {0x04,0x7f,0x08,0x08,0x07}; // h
+const unsigned char PROGMEM chr_105[] = {0x01,0x5f}; // i
+const unsigned char PROGMEM chr_106[] = {0x03,0x02,0x01,0x5e}; // j
+const unsigned char PROGMEM chr_107[] = {0x04,0x7f,0x08,0x14,0x23}; // k
+const unsigned char PROGMEM chr_108[] = {0x03,0x41,0x7f,0x01}; // l
+const unsigned char PROGMEM chr_109[] = {0x05,0x1f,0x10,0x0f,0x10,0x0f}; // m
+const unsigned char PROGMEM chr_110[] = {0x04,0x1f,0x10,0x10,0x0f}; // n
+const unsigned char PROGMEM chr_111[] = {0x04,0x0e,0x11,0x11,0x0e}; // o
+const unsigned char PROGMEM chr_112[] = {0x04,0x1f,0x12,0x12,0x0c}; // p
+const unsigned char PROGMEM chr_113[] = {0x04,0x0c,0x12,0x12,0x1f}; // q
+const unsigned char PROGMEM chr_114[] = {0x03,0x0f,0x10,0x10}; // r
+const unsigned char PROGMEM chr_115[] = {0x04,0x09,0x15,0x15,0x12}; // s
+const unsigned char PROGMEM chr_116[] = {0x04,0x10,0x7e,0x11,0x11}; // t
+const unsigned char PROGMEM chr_117[] = {0x04,0x1e,0x01,0x01,0x1f}; // u
+const unsigned char PROGMEM chr_118[] = {0x05,0x18,0x06,0x01,0x06,0x18}; // v
+const unsigned char PROGMEM chr_119[] = {0x05,0x1e,0x01,0x06,0x01,0x1e}; // w
+const unsigned char PROGMEM chr_120[] = {0x05,0x11,0x0a,0x04,0x0a,0x11}; // x
+const unsigned char PROGMEM chr_121[] = {0x04,0x18,0x05,0x05,0x1e}; // y
+const unsigned char PROGMEM chr_122[] = {0x04,0x13,0x15,0x19,0x11}; // z
+const unsigned char PROGMEM chr_123[] = {0x03,0x08,0x36,0x41}; // {
+const unsigned char PROGMEM chr_124[] = {0x01,0xff}; // |
+const unsigned char PROGMEM chr_125[] = {0x03,0x41,0x36,0x08}; // }
+const unsigned char PROGMEM chr_126[] = {0x05,0x08,0x10,0x08,0x04,0x08}; // ~
+
+#endif /* FONT_H_ */
diff --git a/mirror_font.py b/mirror_font.py
new file mode 100644
index 0000000..db5b5c3
--- /dev/null
+++ b/mirror_font.py
@@ -0,0 +1,25 @@
+#!/usr/bin/python
+
+import sys
+import os
+import re
+import json
+
+result = {}
+
+with open('font.h') as font:
+ for line in font:
+ if 'PROGMEM' in line:
+ hexes = re.findall(r'(0x[0-9a-fA-F]+)',line)
+ prefix = hexes[:1]
+ contents = hexes[1:]
+ length = len(contents)
+ literal = int(re.findall(r'chr_([0-9]+)',line)[0])
+ description = re.findall(r'\/\/(.*)$',line)[0].strip()
+ newhexes = []
+ newhexes.append(prefix[0])
+ for row in contents:
+ bitstring = '{0:08b}'.format(int(row,16))
+ newbits = bitstring[::-1]
+ newhexes.append( format(int(newbits,2), '#04x'))
+ print "const unsigned char PROGMEM chr_%s[] = {%s}; // %s" % (literal,','.join(newhexes),description)