2015-12-22 15:02:43 -05:00
|
|
|
// Font structures for newer Adafruit_GFX (1.1 and later).
|
|
|
|
// Example fonts are included in 'Fonts' directory.
|
|
|
|
// To use a font in your Arduino sketch, #include the corresponding .h
|
|
|
|
// file and pass address of GFXfont struct to setFont(). Pass NULL to
|
|
|
|
// revert to 'classic' fixed-space bitmap font.
|
|
|
|
|
|
|
|
#ifndef _GFXFONT_H_
|
|
|
|
#define _GFXFONT_H_
|
|
|
|
|
2018-07-14 15:21:57 -04:00
|
|
|
/// Font data stored PER GLYPH
|
|
|
|
typedef struct {
|
2019-12-27 17:10:08 -05:00
|
|
|
uint16_t bitmapOffset; ///< Pointer into GFXfont->bitmap
|
|
|
|
uint8_t width; ///< Bitmap dimensions in pixels
|
|
|
|
uint8_t height; ///< Bitmap dimensions in pixels
|
|
|
|
uint8_t xAdvance; ///< Distance to advance cursor (x axis)
|
|
|
|
int8_t xOffset; ///< X dist from cursor pos to UL corner
|
|
|
|
int8_t yOffset; ///< Y dist from cursor pos to UL corner
|
2015-12-22 15:02:43 -05:00
|
|
|
} GFXglyph;
|
|
|
|
|
2018-07-14 15:21:57 -04:00
|
|
|
/// Data stored for FONT AS A WHOLE
|
2019-12-27 17:10:08 -05:00
|
|
|
typedef struct {
|
|
|
|
uint8_t *bitmap; ///< Glyph bitmaps, concatenated
|
|
|
|
GFXglyph *glyph; ///< Glyph array
|
2020-05-13 10:42:20 -04:00
|
|
|
uint16_t first; ///< ASCII extents (first char)
|
|
|
|
uint16_t last; ///< ASCII extents (last char)
|
2019-12-27 17:10:08 -05:00
|
|
|
uint8_t yAdvance; ///< Newline distance (y axis)
|
2015-12-22 15:02:43 -05:00
|
|
|
} GFXfont;
|
|
|
|
|
|
|
|
#endif // _GFXFONT_H_
|