/** * \file * * * \brief Font 8x6 IBM-PC 8bit * * * \author Stefano Fedrigo * */ #ifndef GFX_FONT_H #define GFX_FONT_H #include /* uint8_t */ #include /* PROGMEM */ typedef struct Font { /** * Pointer to glyph data. * * Data is an array of at most 256 glyphs packed together. * Raster format must be the same of the bitmap. */ const pgm_uint8_t *glyph; uint8_t width; /**< Pixel width of character cell. */ uint8_t height; /**< Pixel height of character cell. */ uint8_t first; /**< First encoded character in glyph array. */ uint8_t last; /**< Last encoded character in glyph array (inclusive). */ /** Array of glyph offsets in bytes. NULL for fixed-width fonts. */ const pgm_uint16_t *offset; const pgm_uint8_t *widths; } Font; /** Return true if glyph \a c is available in \a font. */ #define FONT_HAS_GLYPH(font, c) ((c) >= (font)->first && (c) <= (font)->last) /** The default font. */ #define default_font font_luBS14 extern const struct Font default_font; #endif /* GFX_FONT_H */