/* bdf.h : BDF font loader */ /* original Copyright 2003 Jon Mayo -- June 1, 2003 * released to PUBLIC DOMAIN on August 25, 2006 * Updated April 10, 2008 */ /**************************************************************************/ #ifndef BDF_H #define BDF_H #include struct bdf_font; struct bdf_glyph; /* a glyph is a small mono bitmap */ struct bdf_glyph { unsigned width; /* width of the glyph in bits(pixels) */ unsigned height; /* height of the glyph */ unsigned pitch; /* number of bytes per row */ int xofs, yofs; /* X,Y offset for bounding box */ int rc; /* reference count */ uint8_t bitmap[]; /* bitmap data */ }; /* font is a collection of glyphs */ struct bdf_font { unsigned nr_glyph; unsigned undefined; unsigned ascent, descent; struct bdf_glyph *glyph[]; }; struct bdf_font *loadFont(const char *filename); void freeFont(struct bdf_font **f); #endif /* BDF_H */