#ifndef FONT_H
#define FONT_H


#include "os.h"
#include "color.h"


typedef struct FontS {
	uint8_t   width;         // Width of each character in pixels.
	uint8_t   height;        // Height of each character in pixels.
	uint8_t   span;          // Number of characters per line in font data.
	uint8_t   count;         // Number of characters in font, minus 1.
	uint16_t  widthPixels;   // Width of line of font data in pixels/bits.
	uint16_t  heightPixels;  // Number of lines of font data in pixels/bits.
	uint8_t  *bits;          // Actual font bits.
} FontT;


FontT    *fontFromRAMLoad(uint8_t *pointer);
uint16_t  fontHeightGet(FontT *font);
FontT    *fontLoad(char *filename);
void      fontRender(FontT *font, char *string, ColorT foreground, ColorT background, uint16_t x, uint16_t y);
void      fontUnload(FontT **font);
uint16_t  fontWidthGet(FontT *font);


#endif // FONT_H
