vectorscope / hershey.c

/** \file
 * Hershey fonts for the numbers 0-9
 * From:
 * http://paulbourke.net/dataformats/hershey/
 *
 * Point x,y == -1 => pen up
 * Otherwise draw in a continuous path
 */

#include "hershey.h"

#define POINT(x,y) { x, y }

const path_t digits[][32] = {
	[0] = {
		POINT( 9,21),
		POINT( 6,20),
		POINT( 4,17),
		POINT( 3,12),
		POINT( 3, 9),
		POINT( 4, 4),
		POINT( 6, 1),
		POINT( 9, 0),
		POINT(11, 0),
		POINT(14, 1),
		POINT(16, 4),
		POINT(17, 9),
		POINT(17,12),
		POINT(16,17),
		POINT(14,20),
		POINT(11,21),
		POINT( 9,21),
	},
	[1] = {
		POINT( 6,17),
		POINT( 8,18),
		POINT(11,21),
		POINT(11, 0),
	},
	[2] = {
		POINT( 4,16),
		POINT( 4,17),
		POINT( 5,19),
		POINT( 6,20),
		POINT( 8,21),
		POINT(12,21),
		POINT(14,20),
		POINT(15,19),
		POINT(16,17),
		POINT(16,15),
		POINT(15,13),
		POINT(13,10),
		POINT( 3, 0),
		POINT(17, 0),
	},
	[3] = {
		POINT( 5,21),
		POINT(16,21),
		POINT(10,13),
		POINT(13,13),
		POINT(15,12),
		POINT(16,11),
		POINT(17, 8),
		POINT(17, 6),
		POINT(16, 3),
		POINT(14, 1),
		POINT(11, 0),
		POINT( 8, 0),
		POINT( 5, 1),
		POINT( 4, 2),
		POINT( 3, 4),
	},
	[4] = {
		POINT(13,21),
		POINT( 3, 7),
		POINT(18, 7),
		POINT(-1,-1),
		POINT(13,21),
		POINT(13, 0),
	},
	[5] = {
		POINT(15,21),
		POINT( 5,21),
		POINT( 4,12),
		POINT( 5,13),
		POINT( 8,14),
		POINT(11,14),
		POINT(14,13),
		POINT(16,11),
		POINT(17, 8),
		POINT(17, 6),
		POINT(16, 3),
		POINT(14, 1),
		POINT(11, 0),
		POINT( 8, 0),
		POINT( 5, 1),
		POINT( 4, 2),
		POINT( 3, 4),
	},
	[6] = {
		POINT(16,18),
		POINT(15,20),
		POINT(12,21),
		POINT(10,21),
		POINT( 7,20),
		POINT( 5,17),
		POINT( 4,12),
		POINT( 4, 7),
		POINT( 5, 3),
		POINT( 7, 1),
		POINT(10, 0),
		POINT(11, 0),
		POINT(14, 1),
		POINT(16, 3),
		POINT(17, 6),
		POINT(17, 7),
		POINT(16,10),
		POINT(14,12),
		POINT(11,13),
		POINT(10,13),
		POINT( 7,12),
		POINT( 5,10),
		POINT( 4, 7),
	},
	[7] = {
		POINT(17,21),
		POINT( 7, 0),
		POINT(-1,-1),
		POINT( 3,21),
		POINT(17,21),
	},
	[8] = {
		POINT( 8,21),
		POINT( 5,20),
		POINT( 4,18),
		POINT( 4,16),
		POINT( 5,14),
		POINT( 7,13),
		POINT(11,12),
		POINT(14,11),
		POINT(16, 9),
		POINT(17, 7),
		POINT(17, 4),
		POINT(16, 2),
		POINT(15, 1),
		POINT(12, 0),
		POINT( 8, 0),
		POINT( 5, 1),
		POINT( 4, 2),
		POINT( 3, 4),
		POINT( 3, 7),
		POINT( 4, 9),
		POINT( 6,11),
		POINT( 9,12),
		POINT(13,13),
		POINT(15,14),
		POINT(16,16),
		POINT(16,18),
		POINT(15,20),
		POINT(12,21),
		POINT( 8,21),
	},
	[9] = {
		POINT(16,14),
		POINT(15,11),
		POINT(13, 9),
		POINT(10, 8),
		POINT( 9, 8),
		POINT( 6, 9),
		POINT( 4,11),
		POINT( 3,14),
		POINT( 3,15),
		POINT( 4,18),
		POINT( 6,20),
		POINT( 9,21),
		POINT(10,21),
		POINT(13,20),
		POINT(15,18),
		POINT(16,14),
		POINT(16, 9),
		POINT(15, 4),
		POINT(13, 1),
		POINT(10, 0),
		POINT( 8, 0),
		POINT( 5, 1),
		POINT( 4, 3),
	},
};
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.