/*
Copyright (c) 2007-2013, John Ryland
*/
#ifndef __FONT_H__
#define __FONT_H__

#include <image.h>

typedef struct {
    unsigned char   left;
    unsigned char   top;
    unsigned char   horiAdvance;
    unsigned char   vertAdvance;
    unsigned char   width;
    unsigned char   height;
    unsigned char   dummy1;
    unsigned char   dummy2;
    unsigned int    pixel_data_offset;
    unsigned int    dummy3;
} Glyph;

typedef struct {
    int		    	fd;
    unsigned	    bits_per_pixel;
    unsigned	    pixel_size;
    unsigned	    map_size;
    Glyph	    	*glyphs;
    unsigned char   *pixel_data;
} Font;

extern Font openFont(const char *mapableFont);
extern void closeFont(Font font);
extern void drawText(Image *image, int x1, int y1, Font font, const char *text);

#endif /* __FONT_H__ */

