#ifndef lint
static char *sccsid = "@(#)term_font.c	1.5 (UKC) 17/10/88";
#endif  lint

/*
 *	Descriptions of term's built-in fonts
 *
 *	Martin Guy, UKC, September 1988
 */

#include <stdio.h>		/* for NULL */
#include "term_font.h"		/* structure definition */

static unsigned char hoffset8x10[128-33] = {

/*  !"#$%&'()*+,-./ */     3, 1, 0, 1, 1, 0, 3, 3, 1, 0, 1, 1, 1, 3, 1,
/* 0123456789:;<=>? */  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 2, 2, 1, 1, 1,
/* @ABCDEFGHIJKLMNO */  1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 0, 1, 1,
/* PQRSTUVWXYZ[\]^_ */  1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 3, 1, 1, 0, 0,
/* `abcdefghijklmno */  0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 2, 0, 1, 1,
/* pqrstuvwxyz{|}~  */	1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 2, 3, 1, 0, 1

};

static unsigned char hoffset6x8[128-33] = {

/*  !"#$%&'()*+,-./ */     2, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 2, 0,
/* 0123456789:;<=>? */  0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 1, 1, 1, 0,
/* @ABCDEFGHIJKLMNO */  0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0,
/* PQRSTUVWXYZ[\]^_ */  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0,
/* `abcdefghijklmno */  1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0,
/* pqrstuvwxyz{|}~  */	0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 2, 1, 0, 0

};

static unsigned char hoffset7x10[128-33] = {

/*  !"#$%&'()*+,-./ */     3, 1, 0, 1, 1, 0, 2, 2, 2, 1, 1, 1, 1, 3, 1,
/* 0123456789:;<=>? */  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 2, 1, 1, 2, 1,
/* @ABCDEFGHIJKLMNO */  1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 0, 1, 1,
/* PQRSTUVWXYZ[\]^_ */  1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 2, 1, 2, 1, 0,
/* `abcdefghijklmno */  2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 2, 0, 1, 1,
/* pqrstuvwxyz{|}~  */	1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 3, 2, 1, 1

};

static unsigned char hoffset8x16[128-33] = {

/*  !"#$%&'()*+,-./ */     3, 1, 0, 1, 1, 0, 3, 3, 1, 0, 1, 2, 1, 3, 1,
/* 0123456789:;<=>? */  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 2, 0, 1, 0, 1,
/* @ABCDEFGHIJKLMNO */  0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1,
/* PQRSTUVWXYZ[\]^_ */  1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 3, 1, 1, 0, 0,
/* `abcdefghijklmno */  1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 0, 2, 0, 1, 1,
/* pqrstuvwxyz{|}~  */	1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 3, 0, 0, 0

};

#if 0		/* For reference - definition is in term_font.h */
struct term_font {
	int tf_width;	/* width of char in pixels (how much the printing
			 * position advances by when you print it) */
	int tf_height;	/* height in pixels of character square */
	int tf_size;	/* "point size" equivalent in pixels */
	unsigned char *tf_hoffset;
			/* horizontal distance from plotting position to the
			 * character's reference point, indexed with offset of 33 */
	int tf_voffset; /* vertical offset */
	int tf_select;	/* what to send in \033[%dm to select the font */
	char *tf_name;	/* Font name for debugging */
} term_font[];
#endif

/* The table we export.  The order: (0,1,2,3) = (8x10,6x8,8x16,7x10)
 * matches the values returned by term in an <esc>Z report.
 */

struct term_font term_font[] = {

	{ 8, 10,  8,  hoffset8x10,  7, 10, "7x10" },
	{ 6,  8,  6,  hoffset6x8,   6, 11, "6x8" },
	{ 8, 16, 14,  hoffset8x16, 11, 12, "8x16" },
	{ 7, 10,  8,  hoffset7x10,  7, 13, "7x10" },

	{ 0,  0,  0,  NULL,  0,  0, NULL }		/* End marker */
};
