From aadb62d5a2b69914cd2cdeb91e275d106f5fa90c Mon Sep 17 00:00:00 2001 From: Dmitry Mikhirev Date: Sat, 8 Sep 2012 23:46:34 +0400 Subject: add support for LCD with en-jp (katakana) font --- brainuino.ino | 3 -- font.h | 155 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ pinout.h | 3 ++ 3 files changed, 158 insertions(+), 3 deletions(-) diff --git a/brainuino.ino b/brainuino.ino index 72e287e..80993c8 100644 --- a/brainuino.ino +++ b/brainuino.ino @@ -20,9 +20,6 @@ #include #include -// undefine the following if your LCD does not support Russian font -#define RUSSIAN - #include "pinout.h" #include "game.h" #include "lcdprint.h" diff --git a/font.h b/font.h index e95b397..34271be 100644 --- a/font.h +++ b/font.h @@ -21,6 +21,7 @@ #define font_h #include +#include "pinout.h" struct charcode { const int32_t uni; @@ -28,6 +29,10 @@ struct charcode { }; const charcode charmap[] PROGMEM = { + +#ifdef RUSSIAN +// English + Russian font + // tilde {0x007e, 0xe9}, // latin-1 supplement @@ -155,6 +160,156 @@ const charcode charmap[] PROGMEM = { {0x2212, 0x2e}, {0x2218, 0xef}, {0x22c5, 0xdf} + +#else +// English + Japan (katakana) font + +// latin-1 supplement + {0x00a2, 0xec}, + {0x00a5, 0x5c}, + {0x00b0, 0xdf}, + {0x00b5, 0xe4}, + {0x00b7, 0xa5}, + {0x00e4, 0xe1}, + {0x00f1, 0xee}, + {0x00f6, 0xef}, + {0x00f7, 0xfd}, + {0x00fc, 0xf5}, +// greek + {0x0391, 0x41}, + {0x0392, 0x42}, + {0x0395, 0x45}, + {0x0396, 0x5a}, + {0x0397, 0x48}, + {0x0399, 0x49}, + {0x039a, 0x4b}, + {0x039c, 0x4d}, + {0x039d, 0x4e}, + {0x039f, 0x4f}, + {0x03a1, 0x50}, + {0x03a3, 0xf6}, + {0x03a4, 0x54}, + {0x03a5, 0x59}, + {0x03a7, 0x58}, + {0x03a9, 0xf4}, + {0x03b1, 0xe0}, + {0x03b2, 0xe2}, + {0x03b5, 0xe3}, + {0x03b8, 0xf2}, + {0x03bc, 0xe4}, + {0x03bf, 0x6f}, + {0x03c0, 0xf7}, + {0x03c1, 0xe6}, + {0x03c3, 0xe5}, +// cyrillic + {0x0401, 0x45}, + {0x0410, 0x41}, + {0x0412, 0x42}, + {0x0414, 0x44}, + {0x0415, 0x45}, + {0x0417, 0x33}, + {0x041a, 0x4b}, + {0x041c, 0x4d}, + {0x041d, 0x48}, + {0x041e, 0x4f}, + {0x0420, 0x50}, + {0x0421, 0x43}, + {0x0422, 0x54}, + {0x0423, 0x59}, + {0x0425, 0x58}, + {0x042c, 0x62}, + {0x0430, 0x61}, + {0x0435, 0x65}, + {0x043e, 0x6f}, + {0x043f, 0x6e}, + {0x0440, 0x70}, + {0x0441, 0x63}, + {0x0443, 0x79}, + {0x0445, 0x78}, + {0x0451, 0x65}, +// general punctuation + {0x2010, 0x2e}, + {0x2011, 0x2e}, + {0x2012, 0x2e}, + {0x2013, 0x2e}, + {0x2014, 0x2e}, + {0x2015, 0x2e}, +// ohm sign + {0x2126, 0xf4}, +// arrows + {0x2190, 0x7f}, + {0x2192, 0x79}, +// mathematical operators + {0x2211, 0xf6}, + {0x2212, 0x2e}, + {0x221a, 0xe8}, + {0x221e, 0xf3}, + {0x22c5, 0xa5}, +// cjk symbols and punctuation + {0x3001, 0xa4}, + {0x3002, 0xa1}, + {0x3003, 0x22}, + {0x300c, 0xa2}, + {0x300d, 0xa3}, +// katakana + {0x30a1, 0xa7}, + {0x30a2, 0xb1}, + {0x30a3, 0xa8}, + {0x30a4, 0xb2}, + {0x30a5, 0xa9}, + {0x30a6, 0xb3}, + {0x30a7, 0xaa}, + {0x30a8, 0xb4}, + {0x30a9, 0xab}, + {0x30aa, 0xb5}, + {0x30ab, 0xb6}, + {0x30ad, 0xb7}, + {0x30af, 0xb8}, + {0x30b1, 0xb9}, + {0x30b3, 0xba}, + {0x30b5, 0xbb}, + {0x30b7, 0xbc}, + {0x30b9, 0xbd}, + {0x30bb, 0xbe}, + {0x30bd, 0xbf}, + {0x30bf, 0xc0}, + {0x30c1, 0xc1}, + {0x30c3, 0xaf}, + {0x30c4, 0xc2}, + {0x30c6, 0xc3}, + {0x30c8, 0xc4}, + {0x30ca, 0xc5}, + {0x30cb, 0xc6}, + {0x30cc, 0xc7}, + {0x30cd, 0xc8}, + {0x30ce, 0xc9}, + {0x30cf, 0xca}, + {0x30d2, 0xcb}, + {0x30d5, 0xcc}, + {0x30d8, 0xcd}, + {0x30db, 0xce}, + {0x30de, 0xcf}, + {0x30df, 0xd0}, + {0x30e0, 0xd1}, + {0x30e1, 0xd2}, + {0x30e2, 0xd3}, + {0x30e3, 0xac}, + {0x30e4, 0xd4}, + {0x30e5, 0xad}, + {0x30e6, 0xd5}, + {0x30e7, 0xae}, + {0x30e8, 0xd6}, + {0x30e9, 0xd7}, + {0x30ea, 0xd8}, + {0x30eb, 0xd9}, + {0x30ec, 0xda}, + {0x30ed, 0xdb}, + {0x30ef, 0xdc}, + {0x30f2, 0xa6}, + {0x30f3, 0xdd}, + {0x30fb, 0xa5}, + {0x30fc, 0xb0} +#endif }; #endif diff --git a/pinout.h b/pinout.h index bcb2ae9..02f2398 100644 --- a/pinout.h +++ b/pinout.h @@ -25,6 +25,9 @@ digital pins 2 and 3 must be used for interrupts */ #ifndef pinout_h #define pinout_h +// undefine the following if your LCD does not support Russian font +#define RUSSIAN + // digital pins connected to LCD display #define LCD4 7 #define LCD6 8 -- cgit v1.2.1