Extract the typeface out into its own file

pull/365/head
Jesse Vincent 8 years ago
parent a6a2288c20
commit 891bab11ec

@ -0,0 +1,167 @@
* Kaleidoscope-LED-AlphaSquare -- 4x4 pixel LED alphabet
* Copyright (C) 2017 Gergely Nagy
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef KALEIDOSCOPE_LED_FONT
#define KALEIDOSCOPE_LED_FONT
#define ALPHASQUARE_SYMBOL_A SYM4x4(1, 1, 1, 1, \
1, 0, 0, 1, \
1, 1, 1, 1, \
1, 0, 0, 1)
#define ALPHASQUARE_SYMBOL_B SYM4x4(1, 1, 1, 1, \
1, 0, 1, 1, \
1, 1, 0, 1, \
1, 1, 1, 1)
#define ALPHASQUARE_SYMBOL_C SYM4x4(1, 1, 1, 1, \
1, 0, 0, 0, \
1, 0, 0, 0, \
1, 1, 1, 1)
#define ALPHASQUARE_SYMBOL_D SYM4x4(1, 1, 1, 0, \
1, 0, 0, 1, \
1, 0, 0, 1, \
1, 1, 1, 0)
#define ALPHASQUARE_SYMBOL_E SYM4x4(1, 1, 1, 1, \
1, 1, 0, 0, \
1, 0, 0, 0, \
1, 1, 1, 1)
#define ALPHASQUARE_SYMBOL_F SYM4x4(1, 1, 1, 1, \
1, 0, 0, 0, \
1, 1, 1, 0, \
1, 0, 0, 0)
#define ALPHASQUARE_SYMBOL_G SYM4x4(1, 1, 1, 0, \
1, 0, 0, 0, \
1, 0, 0, 1, \
1, 1, 1, 1)
#define ALPHASQUARE_SYMBOL_H SYM4x4(1, 0, 0, 1, \
1, 1, 1, 1, \
1, 0, 0, 1, \
1, 0, 0, 1)
#define ALPHASQUARE_SYMBOL_I SYM4x4(1, 1, 1, 1, \
0, 1, 1, 0, \
0, 1, 1, 0, \
1, 1, 1, 1)
#define ALPHASQUARE_SYMBOL_J SYM4x4(1, 1, 1, 1, \
0, 0, 0, 1, \
1, 0, 0, 1, \
0, 1, 1, 0)
#define ALPHASQUARE_SYMBOL_K SYM4x4(1, 0, 0, 1, \
1, 1, 0, 0, \
1, 1, 0, 0, \
1, 0, 1, 1)
#define ALPHASQUARE_SYMBOL_L SYM4x4(1, 0, 0, 0, \
1, 0, 0, 0, \
1, 0, 0, 0, \
1, 1, 1, 1)
#define ALPHASQUARE_SYMBOL_M SYM4x4(1, 0, 1, 1, \
1, 1, 1, 1, \
1, 1, 0, 1, \
1, 0, 0, 1)
#define ALPHASQUARE_SYMBOL_N SYM4x4(1, 0, 0, 1, \
1, 1, 0, 1, \
1, 0, 1, 1, \
1, 0, 0, 1)
#define ALPHASQUARE_SYMBOL_O SYM4x4(1, 1, 1, 1, \
1, 0, 0, 1, \
1, 0, 0, 1, \
1, 1, 1, 1)
#define ALPHASQUARE_SYMBOL_P SYM4x4(1, 1, 1, 1, \
1, 0, 0, 1, \
1, 1, 1, 1, \
1, 0, 0, 0)
#define ALPHASQUARE_SYMBOL_Q SYM4x4(1, 1, 1, 1, \
1, 0, 0, 1, \
1, 0, 1, 1, \
1, 1, 1, 1)
#define ALPHASQUARE_SYMBOL_R SYM4x4(1, 1, 1, 1, \
1, 0, 0, 1, \
1, 1, 1, 0, \
1, 0, 1, 1)
#define ALPHASQUARE_SYMBOL_S SYM4x4(1, 1, 1, 1, \
1, 1, 0, 0, \
0, 0, 1, 1, \
1, 1, 1, 1)
#define ALPHASQUARE_SYMBOL_T SYM4x4(1, 1, 1, 1, \
0, 1, 1, 0, \
0, 1, 1, 0, \
0, 1, 1, 0)
#define ALPHASQUARE_SYMBOL_U SYM4x4(1, 0, 0, 1, \
1, 0, 0, 1, \
1, 0, 0, 1, \
1, 1, 1, 1)
#define ALPHASQUARE_SYMBOL_V SYM4x4(1, 0, 0, 1, \
1, 0, 0, 1, \
1, 0, 0, 1, \
0, 1, 1, 0)
#define ALPHASQUARE_SYMBOL_W SYM4x4(1, 0, 0, 1, \
1, 0, 1, 1, \
1, 1, 1, 1, \
1, 0, 1, 1)
#define ALPHASQUARE_SYMBOL_X SYM4x4(1, 0, 0, 1, \
0, 1, 1, 0, \
0, 1, 1, 0, \
1, 0, 0, 1)
#define ALPHASQUARE_SYMBOL_Y SYM4x4(1, 0, 0, 1, \
1, 1, 1, 1, \
0, 1, 1, 0, \
0, 1, 1, 0)
#define ALPHASQUARE_SYMBOL_Z SYM4x4(1, 1, 1, 1, \
0, 0, 1, 1, \
1, 1, 0, 0, \
1, 1, 1, 1)
// ---------------------
#define ALPHASQUARE_SYMBOL_1 SYM4x4(0, 1, 1, 0, \
1, 0, 1, 0, \
0, 0, 1, 0, \
1, 1, 1, 1)
#define ALPHASQUARE_SYMBOL_2 SYM4x4(0, 1, 1, 0, \
1, 0, 0, 1, \
0, 0, 1, 0, \
1, 1, 0, 1)
#define ALPHASQUARE_SYMBOL_3 SYM4x4(1, 1, 1, 1, \
0, 0, 1, 1, \
0, 0, 0, 1, \
1, 1, 1, 1)
#define ALPHASQUARE_SYMBOL_4 SYM4x4(1, 0, 0, 1, \
1, 1, 1, 1, \
0, 0, 0, 1, \
0, 0, 0, 1)
#define ALPHASQUARE_SYMBOL_5 SYM4x4(1, 1, 1, 1, \
1, 0, 0, 0, \
0, 1, 1, 1, \
1, 1, 1, 1)
#define ALPHASQUARE_SYMBOL_6 SYM4x4(0, 1, 1, 0, \
1, 0, 0, 0, \
1, 1, 1, 1, \
1, 1, 1, 1)
#define ALPHASQUARE_SYMBOL_7 SYM4x4(1, 1, 1, 1, \
0, 0, 0, 1, \
0, 0, 1, 0, \
0, 1, 0, 0)
#define ALPHASQUARE_SYMBOL_8 SYM4x4(1, 1, 1, 0, \
1, 0, 1, 1, \
1, 1, 0, 1, \
0, 1, 1, 1)
#define ALPHASQUARE_SYMBOL_9 SYM4x4(1, 1, 1, 1, \
1, 0, 0, 1, \
1, 1, 1, 1, \
0, 0, 0, 1)
#define ALPHASQUARE_SYMBOL_0 SYM4x4(0, 1, 1, 0, \
1, 0, 0, 1, \
1, 0, 0, 1, \
0, 1, 1, 0)
#endif

@ -17,157 +17,51 @@
*/
#include <Kaleidoscope-LED-AlphaSquare.h>
#include <Kaleidoscope/LED-AlphaSquare-4x4.h>
namespace kaleidoscope {
static const uint16_t alphabet[] PROGMEM = {
SYM4x4(1, 1, 1, 1,
1, 0, 0, 1,
1, 1, 1, 1,
1, 0, 0, 1), // A
SYM4x4(1, 1, 1, 1,
1, 0, 1, 1,
1, 1, 0, 1,
1, 1, 1, 1), // B
SYM4x4(1, 1, 1, 1,
1, 0, 0, 0,
1, 0, 0, 0,
1, 1, 1, 1), // C
SYM4x4(1, 1, 1, 0,
1, 0, 0, 1,
1, 0, 0, 1,
1, 1, 1, 0), // D
SYM4x4(1, 1, 1, 1,
1, 1, 0, 0,
1, 0, 0, 0,
1, 1, 1, 1), // E
SYM4x4(1, 1, 1, 1,
1, 0, 0, 0,
1, 1, 1, 0,
1, 0, 0, 0), // F
SYM4x4(1, 1, 1, 0,
1, 0, 0, 0,
1, 0, 0, 1,
1, 1, 1, 1), // G
SYM4x4(1, 0, 0, 1,
1, 1, 1, 1,
1, 0, 0, 1,
1, 0, 0, 1), // H
SYM4x4(1, 1, 1, 1,
0, 1, 1, 0,
0, 1, 1, 0,
1, 1, 1, 1), // I
SYM4x4(1, 1, 1, 1,
0, 0, 0, 1,
1, 0, 0, 1,
0, 1, 1, 0), // J
SYM4x4(1, 0, 0, 1,
1, 1, 0, 0,
1, 1, 0, 0,
1, 0, 1, 1), // K
SYM4x4(1, 0, 0, 0,
1, 0, 0, 0,
1, 0, 0, 0,
1, 1, 1, 1), // L
SYM4x4(1, 0, 1, 1,
1, 1, 1, 1,
1, 1, 0, 1,
1, 0, 0, 1), // M
SYM4x4(1, 0, 0, 1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YMBOL_0
};
cRGB AlphaSquare::color = {0x80, 0x80, 0x80};
AlphaSquare::AlphaSquare(void) {

Loading…
Cancel
Save