Source

vectorscope / asteroids-font.c

/** \file
 * Super simple font from Asteroids.
 *
 * http://www.edge-online.com/wp-content/uploads/edgeonline/oldfiles/images/feature_article/2009/05/asteroids2.jpg
 */

#include <avr/io.h>
#include <avr/pgmspace.h>
#include <stdint.h>
#include "asteroids-font.h"

#define P(x,y)	((((x) & 0xF) << 4) | (((y) & 0xF) << 0))
#define UP 0xFE
#define LAST 0xFF
 
const PROGMEM asteroids_char_t asteroids_font[] = {
	['0' - 0x20] = { P(0,0), P(8,0), P(8,12), P(0,12), P(0,0), P(8,12), LAST },
	['1' - 0x20] = { P(4,0), P(4,12), LAST },
	['2' - 0x20] = { P(0,12), P(8,12), P(8,7), P(0,5), P(0,0), P(8,0), LAST },
	['3' - 0x20] = { P(0,12), P(8,12), P(8,0), P(0,0), UP, P(0,6), P(8,6), LAST },
	['4' - 0x20] = { P(0,12), P(0,6), P(8,6), UP, P(8,12), P(8,0), LAST },
	['5' - 0x20] = { P(0,0), P(8,0), P(8,5), P(0,6), P(0,12), P(8,12), LAST },
	['6' - 0x20] = { P(0,12), P(0,0), P(8,0), P(8,5), P(0,7), LAST },
	['7' - 0x20] = { P(0,12), P(8,12), P(8,6), P(4,0), LAST },
	['8' - 0x20] = { P(0,0), P(8,0), P(8,12), P(0,12), P(0,0), UP, P(0,6), P(8,6), },
	['9' - 0x20] = { P(8,0), P(8,12), P(0,12), P(0,7), P(8,5), LAST },
	['A' - 0x20] = { P(0,0), P(0,8), P(4,12), P(8,8), P(8,0), UP, P(0,4), P(8,4) },
	['B' - 0x20] = { P(0,0), P(0,12), P(4,12), P(8,8), P(6,6), P(8,4), P(4,0), P(0,0) },
	['C' - 0x20] = { P(8,0), P(0,0), P(0,12), P(8,12), LAST },
	['D' - 0x20] = { P(0,0), P(0,12), P(4,12), P(8,8), P(8,4), P(4,0), P(0,0), LAST },
	['E' - 0x20] = { P(8,0), P(0,0), P(0,12), P(8,12), UP, P(0,6), P(6,6), LAST },
	['F' - 0x20] = { P(0,0), P(0,12), P(8,12), UP, P(0,6), P(6,6), LAST },
	['G' - 0x20] = { P(6,6), P(8,4), P(8,0), P(0,0), P(0,12), P(8,12), LAST },
	['H' - 0x20] = { P(0,0), P(0,12), UP, P(0,6), P(8,6), UP, P(8,12), P(8,0) },
	['I' - 0x20] = { P(0,0), P(8,0), UP, P(4,0), P(4,12), UP, P(0,12), P(8,12) },
	['J' - 0x20] = { P(0,4), P(4,0), P(8,0), P(8,12), LAST },
	['K' - 0x20] = { P(0,0), P(0,12), UP, P(8,12), P(0,6), P(6,0), LAST },
	['L' - 0x20] = { P(8,0), P(0,0), P(0,12), LAST },
	['M' - 0x20] = { P(0,0), P(0,12), P(4,8), P(8,12), P(8,0), LAST },
	['N' - 0x20] = { P(0,0), P(0,12), P(8,0), P(8,12), LAST },
	['O' - 0x20] = { P(0,0), P(0,12), P(8,12), P(8,0), P(0,0), LAST },
	['P' - 0x20] = { P(0,0), P(0,12), P(8,12), P(8,6), P(0,5), LAST },
	['Q' - 0x20] = { P(0,0), P(0,12), P(8,12), P(8,4), P(0,0), UP, P(4,4), P(8,0) },
	['R' - 0x20] = { P(0,0), P(0,12), P(8,12), P(8,6), P(0,5), UP, P(4,5), P(8,0) },
	['S' - 0x20] = { P(0,2), P(2,0), P(8,0), P(8,5), P(0,7), P(0,12), P(6,12), P(8,10) },
	['T' - 0x20] = { P(0,12), P(8,12), UP, P(4,12), P(4,0), LAST },
	['U' - 0x20] = { P(0,12), P(0,4), P(4,0), P(8,4), P(8,12), LAST },
	['V' - 0x20] = { P(0,12), P(4,0), P(8,12), LAST },
	['W' - 0x20] = { P(0,12), P(2,0), P(4,4), P(6,0), P(8,12), LAST },
	['X' - 0x20] = { P(0,0), P(8,12), UP, P(0,12), P(8,0), LAST },
	['Y' - 0x20] = { P(0,12), P(4,6), P(8,12), UP, P(4,6), P(4,0), LAST },
	['Z' - 0x20] = { P(0,12), P(8,12), P(0,0), P(8,0), UP, P(2,6), P(6,6), LAST },
};