2011-05-11 21:18:46 +00:00
|
|
|
#ifndef __FONTS_H_
|
|
|
|
#define __FONTS_H_
|
|
|
|
|
|
|
|
/* Partially based on original code for the KS0108 by Stephane Rey */
|
|
|
|
/* Based on code code by Kevin Townsend */
|
|
|
|
|
|
|
|
#include <sysdefs.h>
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
const uint8_t widthBits; // width, in bits (or pixels), of the character
|
|
|
|
} FONT_CHAR_INFO;
|
|
|
|
|
|
|
|
struct FONT_DEF {
|
|
|
|
uint8_t u8Width; /* Character width for storage */
|
|
|
|
uint8_t u8Height; /* Character height for storage */
|
|
|
|
uint8_t u8FirstChar; /* The first character available */
|
|
|
|
uint8_t u8LastChar; /* The last character available */
|
|
|
|
const uint8_t *au8FontTable; /* Font table start address in memory */
|
|
|
|
const FONT_CHAR_INFO *charInfo; /* Pointer to array of char information */
|
2011-05-22 19:06:45 +00:00
|
|
|
const uint16_t *charExtra; /* Pointer to array of extra char info */
|
2011-05-11 21:18:46 +00:00
|
|
|
};
|
|
|
|
|
2011-07-23 12:30:20 +00:00
|
|
|
struct EXTFONT {
|
|
|
|
char type; // 0: none, 1: static, 2: loaded
|
|
|
|
char name[13];
|
|
|
|
struct FONT_DEF def;
|
|
|
|
};
|
2011-05-11 21:18:46 +00:00
|
|
|
|
2011-07-23 12:30:20 +00:00
|
|
|
typedef const struct FONT_DEF * FONT;
|
2011-05-14 20:21:51 +00:00
|
|
|
|
2011-07-23 12:30:20 +00:00
|
|
|
#define FONT_DEFAULT 0
|
|
|
|
#define FONT_INTERNAL 1
|
|
|
|
#define FONT_EXTERNAL 2
|
2011-05-14 20:21:51 +00:00
|
|
|
|
|
|
|
extern const struct FONT_DEF * font;
|
2011-07-23 12:30:20 +00:00
|
|
|
extern struct EXTFONT efont;
|
2011-05-14 20:21:51 +00:00
|
|
|
|
2011-05-11 21:18:46 +00:00
|
|
|
#endif
|